LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This 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


Reply
  Search this Thread
Old 02-26-2012, 08:02 PM   #1
John Yate
LQ Newbie
 
Registered: Feb 2012
Location: Cheshire East, England
Posts: 3

Rep: Reputation: Disabled
Question About fixing disks, probably a familiar linux system management conundrum


I've just installed LinuxMint12 on the only partition of an old 40 gig PATA hard disk that MSDOS scandisk recently told me had a bad sector (just the one, and it had it marked as X = "BAD").
Will LM12 have run "e4fsck -c" or "badblocks" on my drive at repartition/reformat/install time and therefore also have it marked as "BAD", do you think ? The installation was slow, but not glacially so, so expect the answer to be "No".
If you think it's "No", logistically helpful suggestions please as to how I'm going to run
e4fsck -c -a /dev/sd1
or whatever, after installing e4fsck, when /dev/sd1 (I think that's what it's called) is the site of my ONLY Linux installation, and you're really only supposed to run the fsck command with the device unmounted.

Should I be looking for the standard way to force an fsck on the next reboot, like Windows XP (sort of) lets you do, or write a custom startup (sorry, boot) script that would request an "fsck -a -c" ?

Could I, should I, have tried to do this from the "Live" installation CD prior to installation?
"Obviously" I needed to get the disk partitioned as Ext4, before it could be checked and have the bad block x-marked by linux, and my way to do that was to do the installation from the CD.
Since the installation, for once, seemed to be working properly I didn't want to stop it ....
Could the Live CD still be the way forward now ? It does allow one to play about a bit before one performs the Install, though I suspect (hope actually) that the installation CD might data-protect an existing installation, and not give its installing user any system management rights over any installed device, except to destroy it completely by repartitioning it - I think I have seen this done (by me) - but the first time, when in doubt, and perhaps unnecessarily, I had MSDOS "fdisk" and "format" from an EBD do the dirty work for me.
I do have an unused 16 GB USB keyring data storage device - would it be possible to Install or dump onto that and then work from there ?
I don't even know if LinuxMint12 can "see" it, especially as it's probably been formatted FAT32 or NTFS.
Install/dump onto DVD+RW ?
 
Click here to see the post LQ members have rated as the most helpful post in this thread.
Old 02-26-2012, 08:51 PM   #2
GlennsPref
Senior Member
 
Registered: Apr 2004
Location: Brisbane, Australia
Posts: 3,366
Blog Entries: 33

Rep: Reputation: 216Reputation: 216Reputation: 216
Hi, the live distro is probably tour best bet , easiest anyway.

Normally during installatin of a distro, when partitioning the drive/s and

formatting the partitions there is an option to "check for bad blocks".

You may use a live distro like "parted magic".

be careful.

GNU/Linux kernel is able to read many formatsincluding ntfs and the many fat types.

you may have to enable ntfs read/write in the kernel, or use ntfs-3g package.

Glenn

edit, I think bad block records are kept in the mbr of the drive concerned. So a new OS should not see it as a free sector.

Last edited by GlennsPref; 02-26-2012 at 08:53 PM. Reason: free sectors, bad blocks
 
Old 02-26-2012, 09:08 PM   #3
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 14,848

Rep: Reputation: 1823Reputation: 1823Reputation: 1823Reputation: 1823Reputation: 1823Reputation: 1823Reputation: 1823Reputation: 1823Reputation: 1823Reputation: 1823Reputation: 1823
Use the liveCD, or choose the "recovery" option on the boot menu. That will place you in a mode (as root) that makes fsck "safer".
 
2 members found this post helpful.
Old 02-27-2012, 06:43 AM   #4
John Yate
LQ Newbie
 
Registered: Feb 2012
Location: Cheshire East, England
Posts: 3

Original Poster
Rep: Reputation: Disabled
About fixing disks, probably a familiar system management conundrum

Very much doubt if the still-tiny installation has hit/tried to use the bad block yet.

Mmmm... Far from being a "safer" option, it turns out e4fsck REQUIRES read/write access to the specified device normally only conferred by root status.

But thanks for the good advice about making a verified backup - have to learn how to do that, but there's a fair amount about that in the literature. That may/may not also require root status, but I bet the Restore would ! Bitterly LOL here, because I don't really believe I have a mechanism for activating ANY of the WinXP Automated System Recovery USB disk backup file/file-list diskette pairs I have religiously created in the recent past since I got the USB device that's just fallen off the table still powered up.

As for running the fscking repair, unlike Fedora, the LinuxMint12 installation process doesn't have a step asking you to set a root password, not to mention store it safely. And one can't do a su/sudo from the distro Live session - really too much authorisation to ask for!

Sams' Fedora 2 book says there's a Gnome setup dialog you can run that includes setting the root password, and I'm hoping to run it on the installed system, assuming LinuxMint Gnome also has it, in which case I might not be completely scuppered yet.
Gratefully, JohnY
 
Old 02-27-2012, 08:41 AM   #5
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,576
Blog Entries: 31

Rep: Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195
If you have only just installed Mint then is there any data on the drive that you need to preserve?

If so you can probably back it up to your 16 GB USB device if it's still working by (this assumes the USB file system is mounted at /media/mnt so adjust accordingly)
Code:
dd if=/dev/sda1 conv=notrunc,noerror | gzip > /media/mnt/sda1.gz
On most (all?) GNU/Linux systems you can force fsck at boot by creating file /etc/forcefsck.
 
1 members found this post helpful.
Old 02-27-2012, 04:59 PM   #6
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 14,848

Rep: Reputation: 1823Reputation: 1823Reputation: 1823Reputation: 1823Reputation: 1823Reputation: 1823Reputation: 1823Reputation: 1823Reputation: 1823Reputation: 1823Reputation: 1823
I think you are worrying unnecessarily. If the badblock has been "fixed" (even by MSDOS) the hardware will be avoiding that block. And Mint should be aware of smart data and let you know if you hit a bad block - new or old.

If you have a recovery -type boot option that will put you in root without need for a password. And the liveCD should be "sudo" aware without password - I'll test it later if I can find a disk.
 
Old 02-27-2012, 08:15 PM   #7
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 7,183

Rep: Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212
Y'know... disk drives are cheap now. Big ones. Fast ones. Bad-assed ones.

Therefore: splurge. Buy a new one.
 
Old 02-27-2012, 08:46 PM   #8
jlinkels
Senior Member
 
Registered: Oct 2003
Location: Bonaire
Distribution: Debian Wheezy/Jessie/Sid, Linux Mint DE
Posts: 4,493

Rep: Reputation: 635Reputation: 635Reputation: 635Reputation: 635Reputation: 635Reputation: 635
Maybe you have a good reason for using a suspect disk. I have to warn you, these ancient disks can give you soft errors, which make programs fails mystically and even at random. Don't ask me how this is possible with all that error checking etc. I know from experience.

Be prepared for that. Your machine might become half stable at a quite unsuitable moment.

jlinkels
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Installing Linux on Laptop with Windows System Recovery Disks carlosemanglano Linux - Laptop and Netbook 7 10-22-2011 08:52 AM
LXer: Fixing NetBackup Media Management Issues Through Mental Exhaustion LXer Syndicated Linux News 0 06-01-2009 05:21 AM
tried to remove linux and system cant detect hard disks? twinkie General 4 01-22-2006 01:55 PM
linux boot disks on win2000 system?? headturner Linux - General 10 01-14-2003 11:40 PM


All times are GMT -5. The time now is 06:48 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration