LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Linux Scandisk equivalent. (https://www.linuxquestions.org/questions/linux-software-2/linux-scandisk-equivalent-112826/)

xode 11-05-2003 05:54 PM

Linux Scandisk equivalent.
 
What is the equivalent in Linux for scandisk in Windows? The Linux program that I need is one that will check the hard drive sector by sector and that will identify and mark out any bad sectors that are found.

randomblast 11-05-2003 05:57 PM

badblocks or fsck
you'll find them in /sbin

xode 11-05-2003 06:39 PM

Next questions: when running as root, fsck and badblocks both say that running them while the file system is mounted will cause severe damage to the file system (i.e. the hard drive). The questions are: (1) how does root unmount the hard drive?; (2) how are badblocks and fsck accessed while the hard drive is unmounted?; (3) how is the hard drive remounted?.

Scruff 11-05-2003 08:39 PM

1. the command: umount /dev/hda1 will unmount partition hda1. Wherever / is, is where you would unmount, however: you can't unmount it while using applications from it :) My / partition is at /dev/hda3. You can find this by doing: cat /proc/partitions.

I have not used either fsck or badblocks yet as my filesystem is always unmounted cleanly thanks to UPS and some good luck ;) I'm sure there is an easier way to run fsck, but you could create a bootdisk, boot from it and run a scan while the drive/partition is not mounted.

ugenn 11-05-2003 11:20 PM

i think it i safe to run fsck if u could remount / as read-only but dont take my word for it. u'll need to shutdown every daemon and process (eg syslog)
that writes to the disk before remounting though.

Cerbere 11-06-2003 02:09 AM

Sounds like another job for Tom's Root/Boot. It's still one of the best rescue/recovery disks out there. Unless you don't have a floppy drive, then get Knoppix or Slackware Live.

Enjoy!
--- Cerbere

randomblast 11-06-2003 05:43 AM

or alternatively you could just boot into rescue mode from your mandrake disc

yapp 11-06-2003 06:12 AM

to check your root system:

Code:

telinit 1              # single user mode, closes all programs + network
mount -o remount,ro /  # remount read only
fsck -f /dev/hd..      # run the checker
or: e2fsck -f /dev/hd..
mount -o remount,rw /  # read-write again.
runlevel                # see the current/previous runlevel
telinit 3              # use the previous runlevel in this command



All times are GMT -5. The time now is 11:54 PM.