LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu
User Name
Password
Ubuntu This forum is for the discussion of Ubuntu Linux.

Notices

Reply
 
LinkBack Search this Thread
Old 02-05-2010, 07:58 AM   #1
karnaf
Member
 
Registered: Dec 2005
Distribution: Ubuntu 10.10, Ubuntu 11.04, Ubuntu 11.11 - all with Gnome 2
Posts: 42

Rep: Reputation: 15
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
Checking dmesg, I get
Code:
[58002.130168] ata6: EH complete
[58002.130199] sd 5:0:0:0: [sdd] 234441648 512-byte hardware sectors (120034 MB)
[58002.130212] sd 5:0:0:0: [sdd] Write Protect is off
[58002.130215] sd 5:0:0:0: [sdd] Mode Sense: 00 3a 00 00
[58002.130235] sd 5:0:0:0: [sdd] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
[58002.130255] sd 5:0:0:0: [sdd] 234441648 512-byte hardware sectors (120034 MB)
[58002.130267] sd 5:0:0:0: [sdd] Write Protect is off
[58002.130269] sd 5:0:0:0: [sdd] Mode Sense: 00 3a 00 00
[58002.130288] sd 5:0:0:0: [sdd] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
[58002.130297] EXT3-fs: can't read group descriptor 0
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
helpppppppp :-)

Thanks!
karnaf
 
Old 02-05-2010, 08:04 AM   #2
tredegar
Guru
 
Registered: May 2003
Location: London, UK
Distribution: Ubuntu 10.04, mostly
Posts: 5,995

Rep: Reputation: 354Reputation: 354Reputation: 354Reputation: 354
Quote:
e2fsck: Device or resource busy while trying to open /dev/sdd1
Filesystem mounted or opened exclusively by another program?
Perhaps you are trying to run fsck on a partition that is mounted ?

This is a very bad idea. First unmount the partition, then run fsck on it.
 
Old 02-05-2010, 11:58 AM   #3
karnaf
Member
 
Registered: Dec 2005
Distribution: Ubuntu 10.10, Ubuntu 11.04, Ubuntu 11.11 - all with Gnome 2
Posts: 42

Original Poster
Rep: Reputation: 15
Nope, not mounted. Checked that first.

Thanks
 
Old 02-05-2010, 12:16 PM   #4
tredegar
Guru
 
Registered: May 2003
Location: London, UK
Distribution: Ubuntu 10.04, mostly
Posts: 5,995

Rep: Reputation: 354Reputation: 354Reputation: 354Reputation: 354
Quote:
Nope, not mounted. Checked that first.
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)

lsof /dev/sdd1
umount /dev/sdd1
e2fsck -f -v -b 32768 /dev/sdd1

?
 
Old 02-05-2010, 01:14 PM   #5
karnaf
Member
 
Registered: Dec 2005
Distribution: Ubuntu 10.10, Ubuntu 11.04, Ubuntu 11.11 - all with Gnome 2
Posts: 42

Original Poster
Rep: Reputation: 15
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?
 
Old 02-05-2010, 01:55 PM   #6
tredegar
Guru
 
Registered: May 2003
Location: London, UK
Distribution: Ubuntu 10.04, mostly
Posts: 5,995

Rep: Reputation: 354Reputation: 354Reputation: 354Reputation: 354
Quote:
Yes, I'm sure :-)
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.
 
Old 02-05-2010, 03:09 PM   #7
karnaf
Member
 
Registered: Dec 2005
Distribution: Ubuntu 10.10, Ubuntu 11.04, Ubuntu 11.11 - all with Gnome 2
Posts: 42

Original Poster
Rep: Reputation: 15
I didn't think you were. Always good to recheck.

Thanks for taking the time to try and help. I haven't thought of the fscking from a remote machine / live CD. I'll try that.

karnaf
 
Old 02-05-2010, 04:05 PM   #8
karnaf
Member
 
Registered: Dec 2005
Distribution: Ubuntu 10.10, Ubuntu 11.04, Ubuntu 11.11 - all with Gnome 2
Posts: 42

Original Poster
Rep: Reputation: 15
It did it! thanks!!!

Rebooted from a live CD, ran the e2fsck and it works!

Thanks a lot!
Where do I send the check? :-)

karnaf
 
Old 02-05-2010, 04:45 PM   #9
tredegar
Guru
 
Registered: May 2003
Location: London, UK
Distribution: Ubuntu 10.04, mostly
Posts: 5,995

Rep: Reputation: 354Reputation: 354Reputation: 354Reputation: 354
Pleased it worked
Quote:
Where do I send the check? :-)
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
 
Old 02-06-2010, 06:14 AM   #10
karnaf
Member
 
Registered: Dec 2005
Distribution: Ubuntu 10.10, Ubuntu 11.04, Ubuntu 11.11 - all with Gnome 2
Posts: 42

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by tredegar View Post
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)

Thanks again for all the help!
karnaf
 
Old 02-06-2010, 07:30 AM   #11
tredegar
Guru
 
Registered: May 2003
Location: London, UK
Distribution: Ubuntu 10.04, mostly
Posts: 5,995

Rep: Reputation: 354Reputation: 354Reputation: 354Reputation: 354
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 ?
 
Old 02-06-2010, 12:07 PM   #12
karnaf
Member
 
Registered: Dec 2005
Distribution: Ubuntu 10.10, Ubuntu 11.04, Ubuntu 11.11 - all with Gnome 2
Posts: 42

Original Poster
Rep: Reputation: 15
Looks pretty good to me... (except for that 6 bad bad bad blocks)
Code:
sudo e2fsck -f -v -c /dev/sdd1
e2fsck 1.40.8 (13-Mar-2008)
Checking for bad blocks (read-only test): done
/dev/sdd1: Updating bad block inode.
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information

/dev/sdd1: ***** FILE SYSTEM WAS MODIFIED *****

    1361 inodes used (0.02%)
     191 non-contiguous inodes (14.0%)
         # of inodes with ind/dind/tind blocks: 1201/888/0
13607800 blocks used (46.44%)
       6 bad blocks
       1 large file

    1255 regular files
      97 directories
       0 character device files
       0 block device files
       0 fifos
       0 links
       0 symbolic links (0 fast symbolic links)
       0 sockets
--------
    1352 files

Last edited by karnaf; 02-06-2010 at 12:09 PM.
 
Old 02-06-2010, 12:27 PM   #13
jschiwal
Moderator
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 14,972

Rep: Reputation: 528Reputation: 528Reputation: 528Reputation: 528Reputation: 528Reputation: 528
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.
 
Old 02-08-2010, 12:49 AM   #14
serutan
LQ Newbie
 
Registered: Oct 2007
Posts: 11

Rep: Reputation: 0
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.
 
  


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
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Corrupted USB flash drive needs fixing (Fedora/Linpus) redmittens Linux - Hardware 7 02-14-2010 01:06 PM
RAID1 - fixing a corrupted file system sheepshearer Linux - General 2 01-23-2009 11:17 AM
fixing a corrupted xinitrc file Castanea_d. Linux - Newbie 2 05-30-2007 09:17 AM
Init.d services take a long time loading after fixing a corrupted hosts file ishaypeled Fedora 2 01-29-2007 08:20 AM
Corrupted my ReiserFS by fixing it...HELP! pAn1k Linux - Software 7 09-13-2004 01:40 AM


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

Main Menu
 
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
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration