Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I am looking for the Linux equivalent to deep scan and repair a hard disk surface (bad sectors). Preferably a program with a GUI that I can install from Ubuntu repositories and run myself, but I'll go into terminal if I have to.
Backgrounder:
Recently, my laptop's fan quit.
(maybe dust accumulation or something, because eventually I got it to start turning again by simply prodding through the vent holes with a toothpick).
It would overheat, and go into emergency immediate shutdown at 255 degrees.
This created LOTS of bad sectors on my hard disk. I am way above the "normal OK" threshold of 100, at about 800. "S.M.A.R.T." thinks my hard disk is bad, and tells me it's about to fail, replace immediately, and hit F1 to continue each time I boot.
I am about certain my hard disk is just fine, as these bad sectors only appeared and multiplied after several overheating shutdowns.
In MS-DOS, we used to run the command "FDISK C: /F" (/f was to fix bad sectors and if bad to permanently exclude them from a format so they are skipped and not used or seen).
How can this be done in Linux?
GParted does not appear to do this: it is way too fast to delete and recreate a partion to be doing any deep surface scanning and repairing. It's a quick MBR write and quick format at best.
excerpt from 'man fsck';
fsck - check and repair a Linux file system
SYNOPSIS
fsck [ -sAVRTNP ] [ -C fd ] [ -t fstype ] [filesys ... ] [--] [ fs-specific-options ]
DESCRIPTION
fsck is used to check and optionally repair one or more Linux file systems. filesys can be a device name (e.g. /dev/hdc1, /dev/sdb2), a mount point (e.g. /, /usr, /home), or an ext2 label or UUID specifier (e.g. UUID=8868abf6-88c5-4a83-98b8-bfc24057f7bd or LABEL=root). Normally, the fsck program will try to run filesystems on different physical disk drives in parallel to reduce total amount time to check all of the filesystems.
If no filesystems are specified on the command line, and the -A option is not specified, fsck will default to checking filesystems in /etc/fstab serial. This is equivalent to the -As options.
The exit code returned by fsck is the sum of the following conditions:
0 - No errors
1 - File system errors corrected
2 - System should be rebooted
4 - File system errors left uncorrected
8 - Operational error
16 - Usage or syntax error
32 - Fsck canceled by user request
128 - Shared library error
The exit code returned when multiple file systems are checked is the bit-wise OR of the exit codes for each file system that is checked.
In actuality, fsck is simply a front-end for the various file system checkers (fsck.fstype) available under Linux. The file system-specific checker is searched for in /sbin first, then in /etc/fs and /etc, and finally in the directories listed in the PATH environment variable. Please see the file system-specific checker manual pages for further details.
Thanks guys. I'm not home right now to try this out, but I am under the initial impression this isn't exactly what I am looking for:
I really need to do a low-level format. To wipe out any (erroneous) tagging of bad sectors, re-test that surface and prepare it PRIOR to formatting (also called a low-level format), then format with the final file system.
In MS-DOS we could identify and quarantine bad sectors so the format command skips over them. So the "chkdsk /f" was to fix the surface, to prep it, PRIOR to formatting. It also resets incorrectly labelled bad sectors by the OS on a formatted partition.
Riht now after several sudden shutdowns due to overheating many sectors were mislabeled by the OS, and this error has not gone away after reformatting it several times.
So what I am looking for, is something for a low-level format, throw-out any existing parameters, and to re-check that surface, prior to formatting - not the high-level format that is happening now.
Forgive me if my terminology is off or mislead, as I am using old knowledge that may be different in Linux filesystems.
If your testing the disk integrity then you should use the manufactures disk utilities.
Yes I read that, thanks, but Toshiba doesn't seem to offer a manufacturer's utility for LINUX to check the integrity of the disks in their notebooks. I'm not even sure what model hdd is in there to begin with. In MS-DOS this would not have been an issue.
Good idea. Why not take it a step further, post a big notice on the startpage of linuxquestions reading: "attention newbies: go away! read manpages, and when you are linux-fluent, come back!". Lets keep Linux to the geeks, and keep the former windows users where they belong, back in the windows world.
Your not wanting to do a low level then just a creation of a a filesystem with badblocks check.
ou can look at 'Linux Command Guide' or 'Ultimate Linux Newbie Guide' to assist with system work.
Thanks for those, but:
Ultimate Linux Newbie Guide will gladly tell me the difference between Unix and Linux, but a search on "badblocks" comes up empty.
In the Linux Command Guide, it says that badblocks is a command for high-density (1.44MB) floppies. Not quite what I had in mind.
Toshiba doesn't offer manufacturers dist utilities for Linux. Under MS-DOS that was never an issue ("chkdsk /f").
In my experience, manufacturers disk utilities are OS-independent -- they are standalone tools that you burn to a CD or otherwise put onto a removable media, and boot. The installed OS has no bearing on these tools.
One thing I'd like to point out, is that repeatedly mentioning "..in MSDOS this is not an issue.." will not further your cause; We aren't dealing with MSDOS here.
Being encouraged to read the manpages for a tool or command, is not an insult or a brush-off -- the suggestion is so that maybe you will see the functionality you desire, IN the man pages, and if so, you now know what tool & options you need to do/use, and can ask for more specific help using that tool/options.
The man page for `mkfs` (a direct relation to mke2fs) indicates that it can also make MSDOS or FAT filesystems, and when used with the -c option, will do a bad-blocks check before building the filesystem on the device. Perhaps this is what you would like?
In the Linux Command Guide, it says that badblocks is a command for high-density (1.44MB) floppies. Not quite what I had in mind.
I cannot tell what guide you read, but here is what the manpage you didn't read says:
Quote:
DESCRIPTION
badblocks is used to search for bad blocks on a device (usually a disk partition). device is the special file corresponding to the device (e.g /dev/hdc1). last-block is the last block to be checked; if it is not specified, the last block on the device is used as a default. first-block is an optional parameter specifying the starting block number for the test, which allows the testing to start in the middle of the disk. If it is not specified the first block on the disk is used as a default.
So you can run
Code:
badblocks /dev/hda
assuming hda is your disk, to mark the bad blocks.
In MS-DOS, we used to run the command "FDISK C: /F" (/f was to fix bad sectors and if bad to permanently exclude them from a format so they are skipped and not used or seen).
Post #6:
Quote:
In MS-DOS we could identify and quarantine bad sectors so the ...
Post #8:
Quote:
In MS-DOS this would not have been an issue.
Post #10:
Quote:
Under MS-DOS that was never an issue ("chkdsk /f").
I suggest this not to insult, but to help you realize that linux is not a "better windows", but it is a replacement OS that is better. It is different.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.