UbuntuThis forum is for the discussion of Ubuntu Linux.
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.
Distribution: Ubuntu 10.10, Ubuntu 11.04, Ubuntu 11.11 - all with Gnome 2
Posts: 42
Rep:
Fixing corrupted disk?
hi all,
After a reboot (why did I do that???) one of the hard drives on my machine refuses to mount with the following message:
Code:
mount: wrong fs type, bad option, bad superblock on /dev/sdd1,
missing codepage or helper program, or other error
In some cases useful info is found in syslog - try
dmesg | tail or so
trying to fix with e2fsck after reading a few howtos and such on the net:
Code:
root@karnaf:~# e2fsck -f -v /dev/sdd1
e2fsck 1.40.8 (13-Mar-2008)
e2fsck: Attempt to read block from filesystem resulted in short read while trying to open /dev/sdd1
Could this be a zero-length partition?
root@karnaf:~# e2fsck -f -v -b 32768 /dev/sdd1
e2fsck 1.40.8 (13-Mar-2008)
e2fsck: Device or resource busy while trying to open /dev/sdd1
Filesystem mounted or opened exclusively by another program?
Here's what I get when running dumpe2fs -o superblock=32768 /dev/sdd1 (running it without the alternative superblock returns "Couldn't find valid filesystem superblock.")
Code:
Filesystem volume name: <none>
Last mounted on: <not available>
Filesystem UUID: bf8497a0-7e9c-4d4e-83a7-3910cebe7fa6
Filesystem magic number: 0xEF53
Filesystem revision #: 1 (dynamic)
Filesystem features: has_journal ext_attr resize_inode dir_index filetype sparse_super large_file
Filesystem flags: signed_directory_hash
Default mount options: (none)
Filesystem state: not clean
Errors behavior: Continue
Filesystem OS type: Linux
Inode count: 7331840
Block count: 29304560
Reserved block count: 1465228
Free blocks: 29025467
Free inodes: 7331829
First block: 0
Block size: 4096
Fragment size: 4096
Reserved GDT blocks: 1017
Blocks per group: 32768
Fragments per group: 32768
Inodes per group: 8192
Inode blocks per group: 256
Filesystem created: Sat Jan 9 13:26:17 2010
Last mount time: n/a
Last write time: Sat Jan 9 13:26:44 2010
Mount count: 0
Maximum mount count: 31
Last checked: Sat Jan 9 13:26:17 2010
Check interval: 15552000 (6 months)
Next check after: Thu Jul 8 14:26:17 2010
Reserved blocks uid: 0 (user root)
Reserved blocks gid: 0 (group root)
First inode: 11
Inode size: 128
Journal inode: 8
Default directory hash: tea
Directory Hash Seed: 72168269-394f-4b89-a9b0-c969cbf2c5d0
Journal backup: inode blocks
Journal size: 128M
Group 0: (Blocks 0-32767)
Primary superblock at 0, Group descriptors at 1-7
Reserved GDT blocks at 8-1024
Block bitmap at 1025 (+1025), Inode bitmap at 1026 (+1026)
Inode table at 1027-1282 (+1027)
0 free blocks, 8181 free inodes, 2 directories
Free blocks:
Free inodes: 12-8192
Group 1: (Blocks 32768-65535)
Backup superblock at 32768, Group descriptors at 32769-32775
Reserved GDT blocks at 32776-33792
Block bitmap at 33793 (+1025), Inode bitmap at 33794 (+1026)
Inode table at 33795-34050 (+1027)
30162 free blocks, 8192 free inodes, 0 directories
Free blocks:
Free inodes: 8193-16384
Group 2: (Blocks 65536-98303)
Block bitmap at 65536 (+0), Inode bitmap at 65537 (+1)
Inode table at 65538-65793 (+2)
32510 free blocks, 8192 free inodes, 0 directories
Free blocks:
Free inodes: 16385-24576
Group 3: (Blocks 98304-131071)
Backup superblock at 98304, Group descriptors at 98305-98311
Reserved GDT blocks at 98312-99328
Block bitmap at 99329 (+1025), Inode bitmap at 99330 (+1026)
Inode table at 99331-99586 (+1027)
31485 free blocks, 8192 free inodes, 0 directories
Free blocks:
Free inodes: 24580-32768
.
.
.
.
.
Group 894: (Blocks 29294592-29304559)
Block bitmap at 29294592 (+0), Inode bitmap at 29294593 (+1)
Inode table at 29294594-29294849 (+2)
9710 free blocks, 8192 free inodes, 0 directories
Free blocks:
Free inodes: 7323649-7331840
If you are sure it is not mounted then maybe it is already "opened exclusively by another program"
Maybe check with lsof /dev/sdd1
What, exactly, happens if you try (as root)
Distribution: Ubuntu 10.10, Ubuntu 11.04, Ubuntu 11.11 - all with Gnome 2
Posts: 42
Original Poster
Rep:
Yes, I'm sure :-)
Code:
root@karnaf:~# lsof /dev/sdd1
root@karnaf:~# umount /dev/sdd1
umount: /dev/sdd1: not mounted
root@karnaf:~# e2fsck -f -v -b 32768 /dev/sdd1
e2fsck 1.40.8 (13-Mar-2008)
e2fsck: Device or resource busy while trying to open /dev/sdd1
Filesystem mounted or opened exclusively by another program?
Thank you for the confirmation. I wasn't being doubting, but have in the past wasted days because someone has answered "Yes" or "No" because they assumed something rather than double-checked it.
Now I am stuck
The only other thing I can think of is that the PC you are running the fsck on is broken (software-wise) somehow.
Can you fsck this disk in/from another linux PC ? Might not be too difficult if it is an external USB drive, and you have a live CD somewhere.
Or even boot from a live CD with your current hardware setup and fsck it from that.
Not necessary. Trying to help others here on LQ, less adept than you are, when you feel able, will be sufficient.
But you are not out of the woods yet. Remember when I said "the PC you are running the fsck on is broken". That point needs to be addressed before you get into further (maybe, much worse) trouble.
Time for a rescue/backup of your personal files and a clean install I think.
Off-topic: I remember reading 1984. I then thought it would not / could not happen. It has
Distribution: Ubuntu 10.10, Ubuntu 11.04, Ubuntu 11.11 - all with Gnome 2
Posts: 42
Original Poster
Rep:
Quote:
Originally Posted by tredegar
But you are not out of the woods yet. Remember when I said "the PC you are running the fsck on is broken". That point needs to be addressed before you get into further (maybe, much worse) trouble.
Time for a rescue/backup of your personal files and a clean install I think.
Is it a hardware thing or a software thing? Will replacing the faulty hard drive do or do I really need to reinstall my machine?
The problem was with mounting a specific hard drive out of four. That hard drive has a single partition and is used for data only (movies, music and such)
It's probably a software thing because e2fsck would not run properly from your installation, only from the live CD.
So maybe there is something wrong with your e2fsck (in which case, other things may be broken too).
What happens if you run e2fsck (not from a live CD) on the now clean, /dev/sdd1 ?
You might consider using fsck with two "-c" options. This will perform a non-destructive read/write bad blocks test and add bad blocks to a badblocks inode so they aren't used in the future. Then monitor the health of the drive in the future. If you keep getting more bad blocks, consider backing up and replacing the drive.
On a related note, if you were getting bad superblock errors on a full disk image file, how would you locate the superblocks? Since there's no "sdd1" or anything, just the image file.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.