Tuesday, April 21, 2015

Re: [LINUX_Newbies] sudo fsck

 

On 21Apr2015 12:33, Gene Henley <mhenley2@verizon.net> wrote:
> I have checked disks in Mac and PC.
> I have five Linux boxes I use. I ask
> for opinions about the
> sudo fsck terminal checking of
> hard drives.

Personally I prefer to get a root shell ("su" or "sudo $SHELL" depending on
your system) and run fsck from within there.

It is best to umount the filesystems to be checked; fscking a mounted
filesystem is dangerous. You can usually "fsck -n" (no action) an _idle_
mounted filesystem, or a filesystem mounted read-only. You really should not
fsck a mounted filesystem in "repair" mode (no "-n") - the OS is actively using
it.

It extreme conditions you can fsck an idle (or, better, read-only) filesystem
for repair. This is usually only justified if the filesystem is /; make sure
that the minimum number of processes are running on your system if you do this.
Normally that means booting your system single user, which should start almost
no processes.

If you have to fsck /, it is better to boot from another medium. For example a
rescue disk (many Linux install CDROMs/DVDROMs include a rescue mode) where you
boot from the CDROM/DVDROM (or USB thumb drive) and run the fsck from there. On
Macs and some other platforms there is a rescue/repair boot option, so that you
do not require an external medium. (And of course Macs can boot single user -
hold down Cmd-S during boot.)

Cheers,
Cameron Simpson <cs@zip.com.au>

__._,_.___

Posted by: Cameron Simpson <cs@zip.com.au>
Reply via web post Reply to sender Reply to group Start a New Topic Messages in this topic (2)
To unsubscribe from this list, please email LINUX_Newbies-unsubscribe@yahoogroups.com & you will be removed.

.

__,_._,___

No comments:

Post a Comment