How to check if a disk has filesystem

…and how to identify the filesystem type if there is one.

/dev/sda1 has an ext4 filesystem

file -s /dev/sda1
/dev/sda1: Linux rev 1.0 ext4 filesystem data (needs journal recovery) (extents) (huge files)

If it is a logical volume

file -s /dev/mapper/vg-log_lv
/dev/mapper/vg-log_lv: symbolic link to `../dm-8'
file -s /dev/dm-8
/dev/dm-8: SGI XFS filesystem data (blksz 4096, inosz 256, v2 dirs)

Continue reading

Advertisements

How to check if a disk or partition has filesystem

This partition has an ext4 filesystem

file -s /dev/sda1
/dev/sda1: Linux rev 1.0 ext4 filesystem data (needs journal recovery) (extents) (huge files)

This device is a part of an LVM

file -s /dev/sdf
/dev/sdf: LVM2 (Linux Logical Volume Manager) , UUID: o67VcqRE41iVFAy0qlfP5cYefvFRt1H

This disk has a GRUB boot loader installed
Continue reading

How to create a new filesystem without reboot in RHEL 6

On creating a new partition in RHEL 6, you might see these messages:

WARNING: Re-reading the partition table failed with error 16: Device or resource busy.
The kernel still uses the old table. The new table will be used at
the next reboot or after you run partprobe(8) or kpartx(8)
Syncing disks.

You will also not be able to create filesystem on the new partition. Continue reading

Megaraid, media errors

Application(Hadoop) logs I/O errors:

2016-02-15 02:48:04,911 WARN org.apache.hadoop.hdfs.server.common.Storage: Failed to add storage for block pool: \
BP-   2136893094-Server_IP-1400619662809 : BlockPoolSliceStorage.recoverTransitionRead: attempt to load an used \
block  storage: /path
ExitCodeException exitCode=1: du: cannot access `/path': Input/output error
du: cannot access `/path': Input/output error
du: cannot access `/path': Input/output error

SCSI reports “Medium Error” in /var/log/messages:

Feb 15 02:47:04 hostame kernel: EXT4-fs error (device sdi): __ext4_get_inode_loc: unable to read inode \
block -  inode=50331696, block=201326626
Feb 15 02:47:33 hostame kernel: sd 0:2:8:0: [sdi] Unhandled sense code
Feb 15 02:47:33 hostame kernel: sd 0:2:8:0: [sdi] Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE
Feb 15 02:47:33 hostame kernel: sd 0:2:8:0: [sdi] Sense Key : Medium Error [current]
Feb 15 02:47:33 hostame kernel: sd 0:2:8:0: [sdi] Add. Sense: No additional sense information
Feb 15 02:47:33 hostame kernel: sd 0:2:8:0: [sdi] CDB: Read(10): 28 00 60 00 01 10 00 00 08 00

Continue reading