fsck in solaris

Solaris does have fsck and it can be run on many file systems. However, with the release of zfs from Solaris, fsck is quickly being phased out by the “zpool scrub” command. It does not make sense to run fsck on a zfs file system. Trying to will likely give an error

root@computer:~# fsck /data
fsck: could not find mountpoint /data in mnttab nor vfstab

/data of course being a mounted zfs pool. ZFS doesn’t rely on mnttab or vfstab since it integrates directly into the kernel. So none of those files need to be modified. Instead use the zpool scrub command as follows:

root@computer:~# zfs list data
NAME   USED  AVAIL  REFER  MOUNTPOINT
data   150K   357M  39.8K  /data
root@computer:~# zpool status data
  pool: data
 state: ONLINE
 scan: none requested
config:

        NAME             STATE     READ WRITE CKSUM
        data             ONLINE       0     0     0
          raidz3-0       ONLINE       0     0     0
            /disk/disk1  ONLINE       0     0     0
            /disk/disk2  ONLINE       0     0     0
            /disk/disk3  ONLINE       0     0     0
            /disk/disk4  ONLINE       0     0     0
            /disk/disk5  ONLINE       0     0     0
        spares
          /disk/disk6    AVAIL

errors: No known data errors
root@computer:~# zpool scrub data
root@computer:~# zpool status data
  pool: data
 state: ONLINE
 scan: scrub repaired 0 in 0h0m with 0 errors on Sat Jul 23 02:59:18 2011
config:

        NAME             STATE     READ WRITE CKSUM
        data             ONLINE       0     0     0
          raidz3-0       ONLINE       0     0     0
            /disk/disk1  ONLINE       0     0     0
            /disk/disk2  ONLINE       0     0     0
            /disk/disk3  ONLINE       0     0     0
            /disk/disk4  ONLINE       0     0     0
            /disk/disk5  ONLINE       0     0     0
        spares
          /disk/disk6    AVAIL

errors: No known data errors

fsck is likely one of those things that will be available on a system since it has it’s purposes. People may not want to always use zfs, for example. So using fsck to check non zfs file systems is the next best option. However, if possible, it is recommended to switch over to solaris zfs since it is a very feature rich file system.

Be the first to comment

Leave a Reply