Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then 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.
Location: Montpellier, France, Europe, World, Solar System
Distribution: Debian Sarge, Fedora core 5 (i386 and x86_64)
Posts: 262
Rep:
How to clear wrong ext2/3 filesystem descriptor ?
Hello,
I have a problem automounting an external USB harddrive. In fact I (almost certainly...) know how I created the problem but have no idea how to solve it.
When I first partitionned the hard drive, I made only one partition on the entire disk (/dev/sdd1). When I created the filesystem with mke2fs, I accidentaly tried to create it on the entire disk (/dev/sdd) rather than on the partition (/dev/sdd1). There was a warning that this would cause problem but I pressed 'yes' too fast.
I then normally created my filesystem on the partition. Now my disk works without problem and I can use my partition to read/writte data. The only thing that puzzle me off is that I always get an error in gnome when I plug the disk and it gets automounted. The error box states: "Cannot Mount Volume: Unable to mount volume" (which is a really informative error message by the way....). Meanwhile, my ext3 partition is automounted without any problem. Same thing if I unmount/remount the partition manually as root from a terminal.
In fact gnome (or whatever hal/automount program in the background). Is trying to mount both the partition and the entire disk as ext3 filesystem, the later leading to an error. Here is the output of my /var/log/messages.
Code:
Jun 21 11:56:46 home kernel: usb 2-2.1: new high speed USB device using ehci_hcd and address 4
Jun 21 11:56:46 home kernel: usb 2-2.1: configuration #1 chosen from 1 choice
Jun 21 11:56:46 home kernel: scsi3 : SCSI emulation for USB Mass Storage devices
Jun 21 11:56:51 home kernel: Vendor: Maxtor Model: 6Y160P0 Rev: YAR4
Jun 21 11:56:51 home kernel: Type: Direct-Access ANSI SCSI revision: 02
Jun 21 11:56:51 home kernel: SCSI device sdd: 320173056 512-byte hdwr sectors (163929 MB)
Jun 21 11:56:51 home kernel: sdd: Write Protect is off
Jun 21 11:56:51 home kernel: sdd: assuming drive cache: write through
Jun 21 11:56:51 home kernel: SCSI device sdd: 320173056 512-byte hdwr sectors (163929 MB)
Jun 21 11:56:51 home kernel: sdd: Write Protect is off
Jun 21 11:56:51 home kernel: sdd: assuming drive cache: write through
Jun 21 11:56:51 home kernel: sdd: sdd1
Jun 21 11:56:51 home kernel: sd 3:0:0:0: Attached scsi disk sdd
Jun 21 11:56:51 home kernel: sd 3:0:0:0: Attached scsi generic sg3 type 0
Jun 21 11:56:51 home kernel: EXT2-fs error (device sdd): ext2_check_descriptors: Block bitmap for group 880 not in group (block 0)!
Jun 21 11:56:51 home kernel: EXT2-fs: group descriptors corrupted!
Jun 21 11:56:52 home kernel: kjournald starting. Commit interval 5 seconds
Jun 21 11:56:52 home kernel: EXT3 FS on sdd1, internal journal
Jun 21 11:56:52 home kernel: EXT3-fs: mounted filesystem with ordered data mode.
So my question is: how do I "clear" this bogus filesystem descriptor on the entire disk so that gnome does not try to automount it without whiping out the entire disk and start everything other ?
Location: Montpellier, France, Europe, World, Solar System
Distribution: Debian Sarge, Fedora core 5 (i386 and x86_64)
Posts: 262
Original Poster
Rep:
Ok now it's worse....
e2fsck never completed (or at least not fast enough...). I got out of it and now my usb disk is not recognized anymore. When I turn the disk on, the activity led flashes for ages (arround 2 or 3 minutes). This is what I get in my log:
Code:
Jun 21 15:59:49 home kernel: usb 2-2.4: new high speed USB device using ehci_hcd and address 5
Jun 21 15:59:49 home kernel: usb 2-2.4: configuration #1 chosen from 1 choice
Jun 21 15:59:49 home kernel: scsi4 : SCSI emulation for USB Mass Storage devicesJun 21 15:59:54 home kernel: Vendor: Maxtor Model: 6Y160P0 Rev: YAR4
Jun 21 15:59:54 home kernel: Type: Direct-Access ANSI SCSI revision: 02
Jun 21 15:59:54 home kernel: SCSI device sdc: 320173056 512-byte hdwr sectors (163929 MB)
Jun 21 15:59:54 home kernel: sdc: Write Protect is off
Jun 21 15:59:54 home kernel: sdc: assuming drive cache: write through
Jun 21 15:59:54 home kernel: SCSI device sdc: 320173056 512-byte hdwr sectors (163929 MB)
Jun 21 15:59:54 home kernel: sdc: Write Protect is off
Jun 21 15:59:54 home kernel: sdc: assuming drive cache: write through
Jun 21 15:59:58 home udevd-event[3227]: wait_for_sysfs: waiting for '/sys/devices/pci0000:00/0000:00:02.1/usb2/2-2/2-2.4/2-2.4:1.0/host4/target4:0:0/4:0:0:0/bus' failed
Jun 21 16:00:02 home kernel: sdc:<6>sd 4:0:0:0: SCSI error: return code = 0x8000002
Jun 21 16:00:02 home kernel: sdc: Current: sense key: Medium Error
Jun 21 16:00:02 home kernel: Additional sense: Unrecovered read error
Jun 21 16:00:02 home kernel: end_request: I/O error, dev sdc, sector 0
Jun 21 16:00:02 home kernel: Buffer I/O error on device sdc, logical block 0
Jun 21 16:00:10 home kernel: sd 4:0:0:0: SCSI error: return code = 0x8000002
Jun 21 16:00:10 home kernel: sdc: Current: sense key: Medium Error
Jun 21 16:00:10 home kernel: Additional sense: Unrecovered read error
Jun 21 16:00:10 home kernel: end_request: I/O error, dev sdc, sector 0
Jun 21 16:00:10 home kernel: Buffer I/O error on device sdc, logical block 0
Jun 21 16:00:18 home kernel: sd 4:0:0:0: SCSI error: return code = 0x8000002
Jun 21 16:00:18 home kernel: sdc: Current: sense key: Medium Error
Jun 21 16:00:18 home kernel: Additional sense: Unrecovered read error
Jun 21 16:00:18 home kernel: end_request: I/O error, dev sdc, sector 0
Jun 21 16:00:18 home kernel: Buffer I/O error on device sdc, logical block 0
Jun 21 16:00:18 home kernel: unable to read partition table
Jun 21 16:00:18 home kernel: sd 4:0:0:0: Attached scsi disk sdc
Jun 21 16:00:18 home kernel: sd 4:0:0:0: Attached scsi generic sg3 type 0
Jun 21 16:00:26 home kernel: sd 4:0:0:0: SCSI error: return code = 0x8000002
Jun 21 16:00:26 home kernel: sdc: Current: sense key: Medium Error
Jun 21 16:00:26 home kernel: Additional sense: Unrecovered read error
Jun 21 16:00:26 home kernel: end_request: I/O error, dev sdc, sector 0
Jun 21 16:00:26 home kernel: Buffer I/O error on device sdc, logical block 0
Jun 21 16:00:34 home kernel: sd 4:0:0:0: SCSI error: return code = 0x8000002
Jun 21 16:00:34 home kernel: sdc: Current: sense key: Medium Error
Jun 21 16:00:34 home kernel: Additional sense: Unrecovered read error
Jun 21 16:00:34 home kernel: end_request: I/O error, dev sdc, sector 0
...
The last 5 lines are repeated over and over until the activity led stops flashing. I get no device in /dev so I can't even access my disk with fdisk to repartition it.
Any help to get my disk back (even blank) gratelly appreciated...
Last edited by zeitounator; 06-21-2006 at 09:14 AM.
um, you do umount the disk before running these tools dont you? that is a standard tnhing to do when manipulating disk partitions in all *nix & *bsd OSs
Location: Montpellier, France, Europe, World, Solar System
Distribution: Debian Sarge, Fedora core 5 (i386 and x86_64)
Posts: 262
Original Poster
Rep:
Just to share the magic...
I saw an entry in /proc/partition concerning my disk. I was able to manually make a device node with mknod using the major and minor number given there (mknod nodeFile b <major> <minor>) but was still unable to perform any fdisk nor fsck with the same error message given in my log about an I/O error on sector 0. QTParted wasn't of any help either.
I also tried to zero the first sector of the drive with dd and still got I/O errors. With some T&E I was able to find out that the problem was situated on the first 8 block of the drive (dd bs=512 if=/dev/sdc of=testdump skip=x count=y - I incremented x by one starting from 0 until I got no error). Unfortunately, I had no other hard drive to copy the entire content and try to rescue.
I was about to give up when I heard somewhere in the cyberspace about a software called spinrite. I was able to get version 6, launched the installer program with wine which gave me the option to create a bootable iso image on my system disk. I burned that image to a cd, booted from there and launched an automatic repair of the drive. It came out that 2 sectors where dead and unrecovered (sector 0 and one other).
Once all scan and repair was finished (approximately 2h30 that I used to drive all my familly to the nearest beach, take a bath and come back...), I rebooted my machine. The device node was there in /dev/. I tried fdisk who decided to start warning me there was no partition on the drive. I created a linux partition on the entire disk and wrote the changes on the drive. As soon as the new partition table was re-read, my entire old filesystem was automagically mounted and appeared on my desktop with apparently all my data there !!!! And guess what, the original error is gone: the drive now mounts firing absolutely no error.
So I decided to have a beer. But I have the feeling I should also buy a new external hard drive soon.
Good night all.
Last edited by zeitounator; 06-25-2006 at 04:31 PM.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.