Checking Hard Drive

Paul O'Malley ompaul at eircom.net
Thu May 18 07:03:13 UTC 2006


Richard wrote:

> What command would I use to check the hard and its partition,
> making sure all is well?
>
> Thanks -
> Rich
>
>
Hi,

To do this you must be in single user mode, or boot from a Live CD.
Press escape while booting during grub and choose rescue.

fsck -y /dev/DISKNAME

It stands for File System ChecK. Never run it on a mounted file system.

Or you can send the following shutdown command.

sudo shutdown -H now

This will force a fsck of all partitions when the machine next boots.
Potential problem if there is an inconsistancy you may need to specify 
an "alternative superblock" for fsck to work with.
Read this part carefully from the man page:

-b superblock
Instead of using the normal superblock, use an alternative
superblock specified by superblock. This option is normally
used when the primary superblock has been corrupted. The loca‐
tion of the backup superblock is dependent on the file system’s
blocksize. For filesystems with 1k blocksizes, a backup
superblock can be found at block 8193; for filesystems with 2k
blocksizes, at block 16384; and for 4k blocksizes, at block
32768.

When done do a "mount -a" and when done I always like to reboot but you 
don't have to.

Regards,

Paul O'Malley




More information about the ubuntu-users mailing list