Can't mount dead laptop's hard drive as external USB drive

Asked by The Octagon

My IBM/Lenovo Thinkpad R50e laptop died a week ago (the power light comes on but it won't even load the BIOS), so I am trying to rescue the data on its hard drive by connecting it as an external drive to my desktop PC. I bought a USB external hard drive enclosure and have fitted the laptop's hard drive into that.

Both the desktop PC and the laptop are/were running Ubuntu Hardy 8.04. The laptop, when I bought it, came preloaded with Windows XP, but about a year ago, when I installed Ubuntu, the whole hard drive was reformatted using the default file system suggested by the installation program (presumably ext3?).

On plugging the USB connector from the hard drive enclosure into the desktop PC, its little green light comes on, indicating that it has powered on correctly. Ubuntu does not, however, automount it.

----- sudo lsusb -----
Bus 004 Device 001: ID 0000:0000
Bus 003 Device 001: ID 0000:0000
Bus 002 Device 003: ID 14cd:6600
Bus 002 Device 002: ID 045e:0025 Microsoft Corp. IntelliEye Mouse
Bus 002 Device 001: ID 0000:0000
Bus 001 Device 001: ID 0000:0000

----- dmesg | tail -----
[ 2717.546582] printk: 2 messages suppressed.
[ 2717.546587] Buffer I/O error on device sdc, logical block 0
[ 2717.789170] usb 2-1: reset full speed USB device using uhci_hcd and address 3
[ 2718.100982] usb 2-1: reset full speed USB device using uhci_hcd and address 3
[ 2718.484756] usb 2-1: reset full speed USB device using uhci_hcd and address 3
[ 2718.804573] usb 2-1: reset full speed USB device using uhci_hcd and address 3
[ 2719.116380] usb 2-1: reset full speed USB device using uhci_hcd and address 3
[ 2719.428422] usb 2-1: reset full speed USB device using uhci_hcd and address 3
[ 2719.571899] sd 2:0:0:0: [sdc] Result: hostbyte=DID_ERROR driverbyte=DRIVER_OK,SUGGEST_OK
[ 2719.571919] end_request: I/O error, dev sdc, sector 0

----- sudo fdisk -l -----
[This shows my desktop PC's two hard drives (sda is for Windows XP; sdb is for Ubuntu), but not the laptop's drive.]

Disk /dev/sda: 120.0 GB, 120034123776 bytes
255 heads, 63 sectors/track, 14593 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x2e312e30

   Device Boot Start End Blocks Id System
/dev/sda1 * 1 14592 117210208+ 7 HPFS/NTFS

Disk /dev/sdb: 82.3 GB, 82348277760 bytes
255 heads, 63 sectors/track, 10011 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x9a2b5940

   Device Boot Start End Blocks Id System
/dev/sdb1 * 1 9729 78148161 83 Linux
/dev/sdb2 9730 10011 2265165 5 Extended
/dev/sdb5 9730 10011 2265133+ 82 Linux swap / Solaris

Could anyone please suggest what the above reports indicate? Is the external hard drive simply not connecting properly, or has it been fried, or could it just be that it needs to be mounted manually, or are there any other diagnostic commands I need to run before it is possible to answer the above? I would be very grateful for any assistance that anyone could offer.

Question information

Language:
English Edit question
Status:
Answered
For:
Ubuntu Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
The Octagon (the-octagon) said :
#1

I have just found that if I unplug the USB connector and then plug it in again, I get a different message in dmesg, though the drive still isn't automounted.

dmesg | tail
[ 7189.023974] sd 3:0:0:0: [sdc] Assuming drive cache: write through
[ 7189.028997] sd 3:0:0:0: [sdc] 78140160 512-byte hardware sectors (40008 MB)
[ 7189.031992] sd 3:0:0:0: [sdc] Write Protect is off
[ 7189.032007] sd 3:0:0:0: [sdc] Mode Sense: 03 00 00 00
[ 7189.032011] sd 3:0:0:0: [sdc] Assuming drive cache: write through
[ 7189.032020] sdc:<6>usb 2-1: reset full speed USB device using uhci_hcd and address 4
[ 7189.505938] usb 2-1: reset full speed USB device using uhci_hcd and address 4
[ 7189.654478] sdc1 sdc2 < sdc5 >
[ 7189.748593] sd 3:0:0:0: [sdc] Attached SCSI disk
[ 7189.748673] sd 3:0:0:0: Attached scsi generic sg4 type 0

Revision history for this message
Christophe Painchaud (dash-ionblast) said :
#2

Hi

[ 7189.032020] sdc:<6>usb 2-1: reset full speed USB device using uhci_hcd and address 4
[ 7189.505938] usb 2-1: reset full speed USB device using uhci_hcd and address 4
[ 7189.654478] sdc1 sdc2 < sdc5 >
[ 7189.748593] sd 3:0:0:0: [sdc] Attached SCSI disk
[ 7189.748673] sd 3:0:0:0: Attached scsi generic sg4 type 0

It has detected successfully your drive and called it 'hdc'

so you can try to mount it with Gnome or KDE GUI, or do it it manually as root.

mount /dev/sdc2 /mnt/somewhere
and
mount /dev/sdc5 /mnt/somewhereelse

Revision history for this message
The Octagon (the-octagon) said :
#3

Thanks for your response, Christophe. OK, I have created three directories in /mnt, called ltpart1, ltpart2 and ltpart5. Then I attempt to mount sdc1, 2 and 5 to them:

leon@No37-desktop:/mnt$ sudo mount /dev/sdc1 /mnt/ltpart1
mount: you must specify the filesystem type
leon@No37-desktop:/mnt$ sudo mount /dev/sdc2 /mnt/ltpart2
mount: you must specify the filesystem type
leon@No37-desktop:/mnt$ sudo mount /dev/sdc5 /mnt/ltpart5
/dev/sdc5 looks like swapspace - not mounted
mount: you must specify the filesystem type

So let's forget sdc5, since it's swapspace. Now attempt to mount sdc1, assuming it is of file system type ext3:

leon@No37-desktop:/mnt$ sudo mount -t ext3 /dev/sdc1 /mnt/ltpart1
mount: wrong fs type, bad option, bad superblock on /dev/sdc1,
       missing codepage or helper program, or other error
       In some cases useful info is found in syslog - try
       dmesg | tail or so

And I get the same error when I attempt to mount sdc2 in the same way.

leon@No37-desktop:/mnt$ dmesg | tail
[ 738.174254] sd 3:0:0:0: [sdc] Assuming drive cache: write through
[ 738.174264] sdc:<6>usb 2-1: reset full speed USB device using uhci_hcd and address 4
[ 738.677738] usb 2-1: reset full speed USB device using uhci_hcd and address 4
[ 738.827721] sdc1 sdc2 < sdc5 >
[ 738.865032] sd 3:0:0:0: [sdc] Attached SCSI disk
[ 738.865106] sd 3:0:0:0: Attached scsi generic sg4 type 0
[ 1238.171346] VFS: Can't find ext3 filesystem on dev sdc1.
[ 1343.845073] attempt to access beyond end of device
[ 1343.845086] sdc2: rw=0, want=4, limit=2
[ 1343.845494] EXT3-fs: unable to read superblock

Now what? Is there any way for me to verify what file systems sdc1 and sdc2 are, before attempting to mount them?

Revision history for this message
The Octagon (the-octagon) said :
#4

Does this help?

leon@No37-desktop:/mnt$ sudo mkfs.ext3 -n /dev/sdc1
mke2fs 1.40.8 (13-Mar-2008)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
2342912 inodes, 9355846 blocks
467792 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=0
286 block groups
32768 blocks per group, 32768 fragments per group
8192 inodes per group
Superblock backups stored on blocks:
        32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
        4096000, 7962624

leon@No37-desktop:/mnt$ sudo mkfs.ext3 -n /dev/sdc2
mke2fs 1.40.8 (13-Mar-2008)
mkfs.ext3: inode_size (128) * inodes_count (0) too big for a
 filesystem with 0 blocks, specify higher inode_ratio (-i)
 or lower inode count (-N).

Revision history for this message
The Octagon (the-octagon) said :
#5

I have tried using e2fsck, as follows:

leon@No37-desktop:/mnt$ sudo e2fsck /dev/sdc1
e2fsck 1.40.8 (13-Mar-2008)
e2fsck: Attempt to read block from filesystem resulted in short read while trying to open /dev/sdc1
Could this be a zero-length partition?

So, based on the superblock information given in my previous update, I try using the -b option to specify the superblock:

leon@No37-desktop:/mnt$ sudo e2fsck -b 32768 /dev/sdc1
e2fsck 1.40.8 (13-Mar-2008)
e2fsck: Device or resource busy while trying to open /dev/sdc1
Filesystem mounted or opened exclusively by another program?

leon@No37-desktop:/mnt$ sudo e2fsck -b 98304 /dev/sdc1
e2fsck 1.40.8 (13-Mar-2008)
e2fsck: Device or resource busy while trying to open /dev/sdc1
Filesystem mounted or opened exclusively by another program?

leon@No37-desktop:/mnt$ sudo e2fsck -b 163840 /dev/sdc1
e2fsck 1.40.8 (13-Mar-2008)
e2fsck: Device or resource busy while trying to open /dev/sdc1
Filesystem mounted or opened exclusively by another program?

...and so on. I don't understand the "Device or resource busy..." message, as the device has not been mounted.

Revision history for this message
Pramod Dematagoda (pmdematagoda) said :
#6

Post the output of:-
cat /etc/mtab

Revision history for this message
The Octagon (the-octagon) said :
#7

Pramod Dematagoda said 27 minutes ago:
> Post the output of:-
> cat /etc/mtab

cat /etc/mtab
/dev/sdb1 / ext3 rw,errors=remount-ro 0 0
proc /proc proc rw,noexec,nosuid,nodev 0 0
/sys /sys sysfs rw,noexec,nosuid,nodev 0 0
varrun /var/run tmpfs rw,noexec,nosuid,nodev,mode=0755 0 0
varlock /var/lock tmpfs rw,noexec,nosuid,nodev,mode=1777 0 0
udev /dev tmpfs rw,mode=0755 0 0
devshm /dev/shm tmpfs rw 0 0
devpts /dev/pts devpts rw,gid=5,mode=620 0 0
lrm /lib/modules/2.6.24-19-386/volatile tmpfs rw 0 0
/dev/sda1 /media/windows fuseblk ro,noexec,nosuid,nodev,noatime,allow_other,default_permissions,blksize=4096 0 0
securityfs /sys/kernel/security securityfs rw 0 0
rpc_pipefs /var/lib/nfs/rpc_pipefs rpc_pipefs rw 0 0
nfsd /proc/fs/nfsd nfsd rw 0 0
binfmt_misc /proc/sys/fs/binfmt_misc binfmt_misc rw,noexec,nosuid,nodev 0 0

Revision history for this message
Pramod Dematagoda (pmdematagoda) said :
#8

Do:-
sudo umount /dev/sdc1
and see if that permits you to specify the new superblock.

Revision history for this message
The Octagon (the-octagon) said :
#9

Thanks, Pramod, but I think I tried that before. Here is my repeat attempt:

leon@No37-desktop:~$ umount /dev/sdc1
umount: /dev/sdc1 is not mounted (according to mtab)
leon@No37-desktop:~$ sudo e2fsck -b 32768 /dev/sdc1
[sudo] password for leon:
e2fsck 1.40.8 (13-Mar-2008)
e2fsck: Device or resource busy while trying to open /dev/sdc1
Filesystem mounted or opened exclusively by another program?

I am utterly baffled.

Revision history for this message
Pramod Dematagoda (pmdematagoda) said :
#10

Boot the system again, perhaps one of those processes could be an fsck process. After the boot, try doing the commands again.

Revision history for this message
Christophe Painchaud (dash-ionblast) said :
#11

leon@No37-desktop:/mnt$ sudo mkfs.ext3 -n /dev/sdc1

never do that again !!!! it is formatting your hard drive !!! I hope you didn't loose anything ....

Revision history for this message
The Octagon (the-octagon) said :
#12

Christophe Painchaud said 15 minutes ago:
>
> leon@No37-desktop:/mnt$ sudo mkfs.ext3 -n /dev/sdc1
>
> never do that again !!!! it is formatting your hard drive !!! I hope you didn't loose anything ....

I'm not that daft! From man mkfs.ext3:

-n causes mke2fs to not actually create a filesystem, but display
              what it would do if it were to create a filesystem. This can be
              used to determine the location of the backup superblocks for a
              particular filesystem, so long as the mke2fs parameters that
              were passed when the filesystem was originally created are used
              again. (With the -n option added, of course!)

Revision history for this message
The Octagon (the-octagon) said :
#13

Pramod Dematagoda said:
>
> Boot the system again, perhaps one of those processes could be an fsck process. After the boot, try doing the
> commands again.

I've tried that, but I still get the same "busy" message, even if the only things I do after booting are (1) plug in the device; and (2) run the e2fsck command.

Revision history for this message
Pramod Dematagoda (pmdematagoda) said :
#14

Hmm, this is very perplexing.

Can you just remove the USB drive, plug it back again and post the output of:-
dmesg | tail -25

Revision history for this message
The Octagon (the-octagon) said :
#15

OK, here goes (and thanks again for your help with this, Pramod):

leon@No37-desktop:~$ dmesg | tail -25
[ 3336.799063] sd 3:0:0:0: [sdc] Result: hostbyte=DID_ERROR driverbyte=DRIVER_OK,SUGGEST_OK
[ 3336.799081] end_request: I/O error, dev sdc, sector 67
[ 3336.799089] Buffer I/O error on device sdc1, logical block 1
[ 3392.271946] usb 2-1: USB disconnect, address 5
[ 3440.347615] usb 2-1: new full speed USB device using uhci_hcd and address 6
[ 3440.483447] usb 2-1: not running at top speed; connect to a high speed hub
[ 3440.513604] usb 2-1: configuration #1 chosen from 1 choice
[ 3440.555209] scsi4 : SCSI emulation for USB Mass Storage devices
[ 3440.557029] usb-storage: device found at 6
[ 3440.557037] usb-storage: waiting for device to settle before scanning
[ 3445.554383] usb-storage: device scan complete
[ 3445.557366] scsi 4:0:0:0: Direct-Access HTS42404 0M9AT00 PQ: 0 ANSI: 0
[ 3445.570316] sd 4:0:0:0: [sdc] 78140160 512-byte hardware sectors (40008 MB)
[ 3445.573318] sd 4:0:0:0: [sdc] Write Protect is off
[ 3445.573326] sd 4:0:0:0: [sdc] Mode Sense: 03 00 00 00
[ 3445.573330] sd 4:0:0:0: [sdc] Assuming drive cache: write through
[ 3445.578378] sd 4:0:0:0: [sdc] 78140160 512-byte hardware sectors (40008 MB)
[ 3445.581317] sd 4:0:0:0: [sdc] Write Protect is off
[ 3445.581329] sd 4:0:0:0: [sdc] Mode Sense: 03 00 00 00
[ 3445.581333] sd 4:0:0:0: [sdc] Assuming drive cache: write through
[ 3445.581342] sdc:<6>usb 2-1: reset full speed USB device using uhci_hcd and address 6
[ 3446.084229] usb 2-1: reset full speed USB device using uhci_hcd and address 6
[ 3446.234817] sdc1 sdc2 < sdc5 >
[ 3446.270979] sd 4:0:0:0: [sdc] Attached SCSI disk
[ 3446.271054] sd 4:0:0:0: Attached scsi generic sg4 type 0

Revision history for this message
The Octagon (the-octagon) said :
#16

I have discovered cfdisk, which has given me some information that I had not seen before:

sudo cfdisk /dev/sdc

                                            cfdisk (util-linux-ng 2.13.1)

                                                    Disk Drive: /dev/sdc
                                              Size: 40007761920 bytes, 40.0 GB
                                    Heads: 255 Sectors per Track: 63 Cylinders: 4864

      Name Flags Part Type FS Type [Label] Size (MB)
 ---------------------------------------------------------------------------------------------------------------------------
      sdc1 Boot Primary Linux 38321.58
      sdc5 Logical Linux swap / Solaris 1686.19

Then select the Print > Sectors option:

Partition Table for /dev/sdc

               First Last
 # Type Sector Sector Offset Length Filesystem Type (ID) Flag
-- ------- ----------- ----------- ------ ----------- -------------------- ----
 1 Primary 0 74846834 63 74846835 Linux (83) Boot
 2 Primary 74846835 78140159 0 3293325 Extended (05) None
 5 Logical 74846835 78140159 63 3293325 Linux swap / So (82) None

And the Print > Table option:

Partition Table for /dev/sdc

         ---Starting--- ----Ending---- Start Number of
 # Flags Head Sect Cyl ID Head Sect Cyl Sector Sectors
-- ----- ---- ---- ---- ---- ---- ---- ---- ----------- -----------
 1 0x80 1 1 0 0x83 254 63 1023 63 74846772
 2 0x00 254 63 1023 0x05 254 63 1023 74846835 3293325
 3 0x00 0 0 0 0x00 0 0 0 0 0
 4 0x00 0 0 0 0x00 0 0 0 0 0
 5 0x00 254 63 1023 0x82 254 63 1023 63 3293262

Revision history for this message
Pramod Dematagoda (pmdematagoda) said :
#17

From the information, it does seem like that the partitions are intact, but as shown here:-
[ 3336.799089] Buffer I/O error on device sdc1, logical block 1
there is an error in the first block.

While this may not necessarily help, run:-
sudo e2fsck -cf /dev/sdc1
and see if that command executes atleast.

The f option doesn't force the check, but it just forces it even if the file system is marked clean.

Revision history for this message
The Octagon (the-octagon) said :
#18

leon@No37-desktop:~$ sudo e2fsck -cf /dev/sdc1
e2fsck 1.40.8 (13-Mar-2008)
e2fsck: Superblock invalid, trying backup blocks...
e2fsck: Bad magic number in super-block while trying to open /dev/sdc1

The superblock could not be read or does not describe a correct ext2
filesystem. If the device is valid and it really contains an ext2
filesystem (and not swap or ufs or something else), then the superblock
is corrupt, and you might try running e2fsck with an alternate superblock:
    e2fsck -b 8193 <device&gt;

I have just noticed that, in the Partition Table section of the cfdisk dump above, sdc1 is listed as filesystem type "Linux (83)". If I use cfdisk on my desktop PC's main Linux partition sdb1, however, it lists the filesystem type as "Linux ext3". So perhaps sdc1 is not ext3 at all. (If so, what type of Linux partition is it?)

Revision history for this message
Pramod Dematagoda (pmdematagoda) said :
#19

When you were installing Ubuntu, how did you ask the installer to setup the partitions?

Revision history for this message
The Octagon (the-octagon) said :
#20

Pramod Dematagoda said:

> When you were installing Ubuntu, how did you ask the installer to setup the partitions?

I just accepted all of the defaults, so it must be either ext3 or ext2. I'm not sure that my previous question ("what type of Linux partition is it?") is so relevant -- I think perhaps the difference in the description as displayed by cfdisk might be due to different description styles used by the different installers that created my desktop PC and laptop partitions.

Revision history for this message
Pramod Dematagoda (pmdematagoda) said :
#21

If you were installing a relatively new version of Ubuntu then it should be ext3(not sure though if the first version of Ubuntu preferred ext3 as well), but the fact that you can't provide another superblock may mean that the hard drive has failed altogether and is on it's last steps.

Revision history for this message
Pramod Dematagoda (pmdematagoda) said :
#22

By the way, I am not sure if this may help, but TestDisk sounds a bit promising:-
http://www.cgsecurity.org/wiki/TestDisk

Revision history for this message
marcobra (Marco Braida) (marcobra) said :
#23

Testdisk is in the Ubuntu universe repositories...
so you need to enable the Universe repository first from menu System→Administration→Software Sources

Then open a terminal and type:

sudo apt-get update
sudo apt-get install testdisk

sudo testdisk

Hope this helps

Revision history for this message
hds sdse (hsdsee443) said :
#24

Maximum of the time you have to be able to use Ubuntu with its default drivers, however you can want unique 3d drivers for certain video playing cards to take complete benefit of them; those may be found at the ATi internet site or the apt. Learn more about it here https://laptopsgraph.com/how-to-remove-scratches-from-aluminum-laptop/

Can you help with this problem?

Provide an answer of your own, or ask The Octagon for more information if necessary.

To post a message you must log in.