How do I find filesystem type
Does anyone know of a command that would return the fs type if given the device name.
Example: =============== # whatfs /dev/hda1 ext3 =============== I know that I can do 'fdisk -l /dev/hda' and I can then look for /dev/hda1, but that complicates what I am doing. I would appreciate any help. |
# cat /proc/mounts | grep /dev/hda1
|
Try: fsck -N /dev/hda1
Executes and shows the internal command used to fire up the appropriate file system checker. Should display something like: fsck 1.27 (8-Mar-2002) [/sbin/fsck.ext3 (1) -- /boot] fsck.ext3 /dev/hda1 Shows the fsck version, checker executable, command number, file system label and the command to start the checker. I ran this on RedHat 7.3 with my hda1 labeled as /boot and mounted as /boot. Oh... the file system is ext3. The file system type for the device is the extension of fsck.xxxx. |
and here the type would be ntfs
fsck -N /dev/hda1 fsck 1.24a (02-Sep-2001) fsck: fsck.ntfs: not found |
I see what your trying to do,
maybe an easier way some variation of this may work cat /proc/mounts | grep /dev/hda1 | cut -d "a" -f2- | cut -d "/" -f2- | cut -d " " -f2 this returned ntfs play around with it |
All times are GMT -5. The time now is 09:38 PM. |