[plug] Filesystems

Cameron Patrick cameron at patrick.wattle.id.au
Fri Feb 28 15:42:44 WST 2003


On Fri, Feb 28, 2003 at 03:19:53PM +0800, Daniel Pearson wrote:
| Once an install and format of the partition, etc.. has been done, how can
| you tell what file system its using (assuming you're dealing with someone
| else's machine and they have no idea if they selected ext2 or ext3 :) ?

In general: mount -v /dev/hdXX /mnt will tell what type of filesystem
mount thinks it is, e.g.:

# mount -v /dev/hda6 /win_d
mount: you didn't specify a filesystem type for /dev/hda6
       I will try type vfat
/dev/hda6 on /win_d type vfat (rw)

In the specific case of ext[23], you can use dumpe2fs -h /dev/hdXX to
get voluminous information about a filesystem, e.g.:

# dumpe2fs -h /dev/hda8 
dumpe2fs 1.32 (09-Nov-2002)
Filesystem volume name:   <none>
Last mounted on:          <not available>
Filesystem UUID:          fa5cbb8f-3cdf-4dec-9683-cb4139416594
Filesystem magic number:  0xEF53
Filesystem revision #:    1 (dynamic)
Filesystem features:      has_journal filetype needs_recovery sparse_super large_file
Default mount options:    (none)
Filesystem state:         clean
Errors behavior:          Continue
Filesystem OS type:       Linux
	<snip>
Last mount time:          Fri Feb 28 07:20:47 2003
Last write time:          Fri Feb 28 07:20:47 2003
Mount count:              12
Maximum mount count:      -1
Last checked:             Fri Feb 21 23:41:41 2003
Check interval:           0 (<none>)
	<snip>

In particular, it tells you that this particular partition (a) is ext3
("has_journal"); (b) is currently mounted ("needs_recovery"); (c) was
last fsck'ed about a week ago.

You can change an ext2 filesystem to ext3 using tune2fs:
	tune2fs -j /dev/hda8
I think this works even on a mounted file system.

Then you have to edit /etc/fstab and change the line for the partition
to say ext3 instead on ext2.  Oh, and it's probably best not to do this if
your kernel doesn't have ext3 support compiled in. :)

| Also, assuming you're using ext3, whats the best way to go about doing an
| integrity check? Just use fsck, or will some switches need to be added?

fsck will do, but you probably want to use fsck -f -v /dev/hdXX to force
to check even if it was safely unmounted.  You also can't (safely) check
a filesystem if it's mounted read-write.  You can remount a partition
read-only like so:
	mount /dev/hda8 -o remount,ro

CP.



More information about the plug mailing list