LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices

Reply
 
Search this Thread
Old 12-07-2006, 11:58 PM   #1
yangontha
LQ Newbie
 
Registered: May 2006
Distribution: Fedora
Posts: 9

Rep: Reputation: 0
Recover Linux Hard Disk


I have installed Linux Fedora 5 on old IBM Notebook. It is working correctly, until one day the notebook can't start up.
I took out the hard disk with the intention of attaching to some working PC to get the data back from the Hard disk.

I tried to use the mini enclosure where the hard disk can put and attach with USB to a desktop. The desktop recognizes the hard disk. But it does not show as I expect like directories, such as /home/user1 ...
(I have used the mount command..)

Does it mean that the hard disk is also corrupted or is it my method of retrieval is wrong? Is there any other way to retrieve the data back from the 2.5inch hard disk?
 
Old 12-08-2006, 06:39 AM   #2
Lenard
Senior Member
 
Registered: Dec 2005
Location: Indiana
Distribution: RHEL/CentOS/SL 5 i386 and x86_64 pata for IDE in use
Posts: 4,790

Rep: Reputation: 56
Taking a wild stab in the dark, maybe you have multiple partitions on the hard drive and only mounted one of them (the first one). Remove the drive from the system after un-mounting the partition wait for a few seconds then re-attach the hard drive to the system. Now have a look at the messages file as root, for example;

$ sudo tail /var/log/messages
Dec 8 07:29:31 Aspire5000 kernel: scsi 1:0:0:0: Direct-Access TOSHIBA MK1031GAS 0811 PQ: 0 ANSI: 0
Dec 8 07:29:31 Aspire5000 kernel: SCSI device sda: 195371568 512-byte hdwr sectors (100030 MB)
Dec 8 07:29:31 Aspire5000 kernel: sda: test WP failed, assume Write Enabled
Dec 8 07:29:31 Aspire5000 kernel: sda: assuming drive cache: write through
Dec 8 07:29:31 Aspire5000 kernel: SCSI device sda: 195371568 512-byte hdwr sectors (100030 MB)
Dec 8 07:29:31 Aspire5000 kernel: sda: test WP failed, assume Write Enabled
Dec 8 07:29:31 Aspire5000 kernel: sda: assuming drive cache: write through
Dec 8 07:29:31 Aspire5000 kernel: sda: sda1 sda2 sda3
Dec 8 07:29:31 Aspire5000 kernel: sd 1:0:0:0: Attached scsi disk sda
Dec 8 07:29:31 Aspire5000 kernel: sd 1:0:0:0: Attached scsi generic sg0 type 0

Yep, three partitions in this case. So each each partition may need mounting, lets check;

$ fdisk -l

Disk /dev/hda: 60.0 GB, 60011642880 bytes
255 heads, 63 sectors/track, 7296 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/hda1 * 1 13 104391 83 Linux
/dev/hda2 14 7088 56829937+ 83 Linux
/dev/hda3 7089 7296 1670760 82 Linux swap / Solaris

Disk /dev/sda: 100.0 GB, 100030242816 bytes
255 heads, 63 sectors/track, 12161 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/sda1 * 1 13 104391 83 Linux
/dev/sda2 14 11945 95843790 83 Linux
/dev/sda3 11946 12161 1735020 82 Linux swap / Solaris

Hmmm.... partition 3 (sda3) is a swap partition no reason to mount it. Checking the first partition (mounting and list the contents);

$ sudo mount -t auto /dev/sda1 /media/usb1
[lenard@Aspire5000 ~]$ ls-al /media/usb1
bash: ls-al: command not found
[lenard@Aspire5000 ~]$ ls -al /media/usb1
total 9484
drwxr-xr-x 4 root root 1024 Dec 5 19:52 .
drwxr-xr-x 7 root root 4096 Oct 10 18:06 ..
-rw-r--r-- 1 root root 42093 Nov 21 13:56 config-2.6.19
drwxr-xr-x 2 root root 1024 Dec 5 20:01 grub
-rw------- 1 root root 1296359 Nov 30 07:24 initrd-2.6.19.img
-rw------- 1 root root 2908789 Dec 5 19:53 initrd-2.6.19lmc.img
drwx------ 2 root root 12288 Dec 3 04:35 lost+found
-rw-r--r-- 1 root root 23108 Oct 27 14:38 message
-rw-r--r-- 1 root root 21282 Oct 27 14:38 message.ja
lrwxrwxrwx 1 root root 20 Dec 5 19:52 System.map -> System.map-2.6.19lmc
-rw-r--r-- 1 root root 1034599 Nov 30 07:24 System.map-2.6.19
-rw-r--r-- 1 root root 1009496 Dec 5 19:52 System.map-2.6.19lmc
lrwxrwxrwx 1 root root 17 Dec 5 19:52 vmlinuz -> vmlinuz-2.6.19lmc
-rw-r--r-- 1 root root 1699569 Nov 30 07:24 vmlinuz-2.6.19
-rw-r--r-- 1 root root 1601164 Dec 5 19:52 vmlinuz-2.6.19lmc

This partition looks like a /boot partition(which it is BTW). I already know the other partition (sda2) is the root partition and does have the standard directory structure and I will not bore you with doing the mount and directory listing.
 
Old 12-17-2006, 09:32 PM   #3
yangontha
LQ Newbie
 
Registered: May 2006
Distribution: Fedora
Posts: 9

Original Poster
Rep: Reputation: 0
Recover Linux Hard Disk

Hi,

[First of all, apologies for replying late. I got difficulties in log in and post.]

You are right in telling me that there are more partitions.

I looked at /var/log/messages as you mentioned and found that


Vendor: IBM Model: DARA-206000 Rev: AR2I
Type : Direct-Access ANSI SCSI revision: 02
SCSI device sda: 11733120 512-byte hdwr sectors (6007 MB)
Sda: Write Protect is off
Sda: assuming drive cache: write through
SCSI device sda: 11733120 512-byte hdwr sectors (6007 MB)
Sda: Write Protect is off
Sda: assuming drive cache: write through
Sda: sda1 sda2
Sd 3:0:0:0: Attached scsi disk sda
Sd 3:0:0:0: Attached scsi generic sg0 type 0


$ mount t auto /dev/sda1 /mnt/minidrive

$ ls

config-2.6.11-1.1369_FC4
grub
initrd-2.6.11-1.1369_FC4.img
lost+found
System.map-2.6.11-1.1369_FC4
vmlinuz-2.6.11-1.1369_FC4

$ umount /mnt/minidrive

$ mount t auto /dev/sda2 /mnt/minidrive

hsf:unable to find HFS+ superblock
mount: you must specify the file system type
 
Old 12-18-2006, 05:15 AM   #4
Lenard
Senior Member
 
Registered: Dec 2005
Location: Indiana
Distribution: RHEL/CentOS/SL 5 i386 and x86_64 pata for IDE in use
Posts: 4,790

Rep: Reputation: 56
What filesystem is on the second partition?? With the drive attached and no partitions mounted check;

fdisk -l

If you know that the second partition is ext2/3 then change the partition type to 83 after making a raw backup of the partition using dd, example below;

dd if=/dev/dsa2 of=part2.img bs=32K

Use something like parted to delete and recreate the partition, make sure you use the exact same start and ending points. Also let parted first check the partition.
 
Old 12-19-2006, 03:42 AM   #5
yangontha
LQ Newbie
 
Registered: May 2006
Distribution: Fedora
Posts: 9

Original Poster
Rep: Reputation: 0
Hi,

I checked the partition with fdisk -l and the result is:-

Disk /dev/sda: 6007 MB, 6007357440 bytes
15 heads, 63 sectors/track, 12416 cylinders
Units = cylinders of 945 * 512 = 483840 bytes

Device Boot Start End Blocks Id System
/dev/sda1 * 1 217 102501 83 Linux
/dev/sda2 218 12416 5764027+ 8e Linux LVM


I am not very sure about the second part of your message regarding the raw backup using dd.
Please tell me again what to do with the above data.

Sorry for asking details.

with best regards,
 
Old 12-19-2006, 04:56 AM   #6
Lenard
Senior Member
 
Registered: Dec 2005
Location: Indiana
Distribution: RHEL/CentOS/SL 5 i386 and x86_64 pata for IDE in use
Posts: 4,790

Rep: Reputation: 56
The dd command can make an image of the data of the second partition (sda2) to someplace on another hard drive. Since the partition is LVM then use the proper tools to mount and hopefully read the partition;

http://www.linuxjournal.com/article/8874
 
  


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
How to recover data from hard disk dongyan_liu Linux - Newbie 1 12-01-2005 05:56 PM
Recover files from formatted hard disk bankfishin Linux - General 2 10-22-2004 04:39 PM
Recover Hard Disk that was used for Linux pureheartedsoul Linux - Newbie 3 08-23-2004 11:57 AM
how do i recover my Hard Disk and MBR? Pisces107 Linux - General 5 12-25-2003 11:12 PM
How to recover Windows XP hard disk on HP pavilion madangsweh Linux - Software 10 07-21-2003 12:41 AM


All times are GMT -5. The time now is 10:26 AM.

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 Google+: linuxquestions
Open Source Consulting | Domain Registration