[TriLUG] How to identify a block device's filesystem type?

Michael Coburn michael at gravis.ca
Thu Oct 24 15:51:40 EDT 2013


On Thu, Oct 24, 2013 at 3:44 PM, Brian Gerard <bgerard at gmail.com> wrote:
>
> On 10/24/13 1:49 PM, Michael Coburn wrote:
>>
>>
>> I have some hard drives laying around, that were once part of a mdadm RAID5
>> array.  I put them back together using --assemble, but I can't remember
>> what filesystem I had formatted them with.  Does anyone know how I can
>> sample the block device and know conclusively what filesystem is on there?
>
>
> Have you tried dumpe2fs(8) yet?

Guess it isn't an ext based FS

root at raspbx:~# dumpe2fs /dev/md0
dumpe2fs 1.42.5 (29-Jul-2012)
dumpe2fs: Bad magic number in super-block while trying to open /dev/md0
Couldn't find valid filesystem superblock.

But thank you Brian you got me thinking in the right direction:

root at raspbx:~# fsck -N /dev/md0
fsck from util-linux 2.20.1
fsck: fsck.jfs: not found
fsck: error 2 while executing fsck.jfs for /dev/md0

Ah ha!  JFS :)

root at raspbx:~# apt-get install jfsutils
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following NEW packages will be installed:
  jfsutils
0 upgraded, 1 newly installed, 0 to remove and 226 not upgraded.
Need to get 0 B/294 kB of archives.
After this operation, 1,059 kB of additional disk space will be used.
debconf: delaying package configuration, since apt-utils is not installed
Selecting previously unselected package jfsutils.
(Reading database ... 35957 files and directories currently installed.)
Unpacking jfsutils (from .../jfsutils_1.1.15-2_armhf.deb) ...
Processing triggers for man-db ...
Setting up jfsutils (1.1.15-2) ...
root at raspbx:~# fsck -N /dev/md0
fsck from util-linux 2.20.1
[/sbin/fsck.jfs (1) -- /dev/md0] fsck.jfs /dev/md0
root at raspbx:~# fsck  /dev/md0
fsck from util-linux 2.20.1
fsck.jfs version 1.1.15, 04-Mar-2011
processing started: 10/24/2013 15:49:59
Using default parameter: -p
The current device is:  /dev/md0
Block size in bytes:  4096
Filesystem size in blocks:  244193248
**Phase 0 - Replay Journal Log
Filesystem is clean.
root at raspbx:~# mount /dev/md0 /media/data/
root at raspbx:~# mount | grep jfs
/dev/md0 on /media/data type jfs (rw,relatime)

Kudos Brian


More information about the TriLUG mailing list