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!
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.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
I'm a total newbie and need some help on checking for badblocks on my hard drive.
First, I know I have bad sectors on my drive because when I had Windows installed on it, I could run chkdsk and saw 96 KB of bad sectors.
Now, when I installed Mandrake Linux, I used the installer to create my ext2 and linux swap partitions. But it never offered the option of checking for bad blocks (using mke2fs with the -c option). So I'm not sure if it checked for bad blocks.
All I want to do is run "e2fsck -cf" on the entire hard drive (all partitions including swap). But I thought I read that fsck should not be run on mounted devices, so when exactly should I run e2fsck? Should I boot up using a boot disk like tomsrtbt and then run e2fsck on the unmounted devices? What happens if I press ESC at the start (when the Mandrake splash screen comes up and gives me 3 secs) resulting in a prompt that says "boot:", can I run e2fsck at that prompt?
I also want to try running "badblocks -n". But I read that badblocks should not be run on mounted partitions. Should this be done from boot disk?
I know that Mandrake runs e2fsck at boot everytime, the problem is, I'm not certain it checks for bad blocks since the hard drive is flagged sucessfully unmounted because I shutdown properly.
Yes, these utilities should not be run while the device is mounted. Using something like Tom's root boot disk is a great idea for times like this. If your drive is mounted, use the "umount" command (man umount) to unmount the drive, then run badblocks or e2fsk. After running your can reboot, or you can mount the drive.
You may think I'm a liar, but I have a disk where scandisk found about 200k of bad blocks. After formatting with ext2 and fat32 and ext2 again, the bad blocks went away (at least weren't no more listed) and I never had problems filling up the disk.
A good test for bad blocks is dd. It'll hand if it encounters a bad block:
No way, my friend, because you are right. Bad sectors, or bad blocks, are pretty much probabilistic -- not absolute. Just like data can be retrieved from an "erased" hard drive, in most cases, the actual magnetic domains (or bits) on the hard drive that may be registering as bad might be ignored just by the simple act of working with a different file system. Those domains are a lot smaller than a sector or block and really only make a difference if there are a whole bunch of bad ones right next to each other.
Does e2fsck work for the swap partition too? Or should I use fsck? Or does it make no sense to run a filesystem check on the swap? Should I just run "badblocks" on the swap partition and would it be used the same way as on the ext2 partition?