Help answer threads with 0 replies.
Go Back > Forums > Linux Forums > Linux - Hardware
User Name
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?


  Search this Thread
Old 05-01-2004, 11:42 AM   #1
LQ Newbie
Registered: May 2004
Posts: 2

Rep: Reputation: 0
Exteral USB hard drive with multiple partitions

Hi there,
my laptop died and I'm trying to get the content from the hard drive. There is a Win98 and
a Linux partition on it with a Lilo booter. I have a new laptop on which I use Knoppix (I couldn't install Suse, but that's another problem) and an external box to connect my old hard drive through a USB connection. I can mount the external hard drive, but I only get access to the Win98 partition, which I don't care about. I tried manually mounting it as a ext2, ext3 or reiserfs file system, but it doesn't work (wrong fs).

Any help is appreciated,

Old 05-01-2004, 01:59 PM   #2
LQ Guru
Registered: Jan 2002
Posts: 6,042

Rep: Reputation: Disabled
I think your partition table or partitions are corrupted. If you can get another 2.5 inch hard drive that is a similar brand and model. Then use dd to make an image of it. Keep the orginal in a safe place and do not connect it to another computer. Next try to run fsck on the partitions and see if you can mount them. If you can not then I'm sorry that your partitions are corrupted. To get your partitions back use gpart to guess the partitions and use parted to make the partitions what gpart found.

The reason why I said to get another hard drive is to have your original intact to get back to. If you do not and fsck or repartitioning does not work, you can get in a very deep hole and you will come out of it.

I hope just an fsck is all you need.
Old 05-01-2004, 03:47 PM   #3
Registered: Mar 2002
Location: Studio City, CA
Distribution: Debian (Sarge-Sid)
Posts: 76

Rep: Reputation: 15
I'd add my voice to Electro - if you need that data, don't fsck the only copy in the world.

I'm not sure how far you've gotten, but I'd start with parted (the GNU partition editor) to see if it can see the Linux partition. I'm sure parted is available for your distro (whatever it is). Whatever you do, DO NOT change anything. Install it and do something like:
lmm@saopaolo:~$ su
saopaolo:/home/lmm# df
Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/hda3             23783500  13760800  10022700  58% /
tmpfs                   258128         0    258128   0% /dev/shm
/dev/hdb1             82250252  62575016  19675236  77% /newhome
/dev/hda4             10327720   4386040   5941680  43% /mnt/myD
/dev/hda1              4184740   3170648   1014092  76% /mnt/myC
saopaolo:/home/lmm# parted /dev/hda
GNU Parted 1.6.9
Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation,
This program is free software, covered by the GNU General Public License.

This program is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.  See the GNU General Public License for more details.

Using /dev/hda
Error: The partition table on /dev/hda is inconsistent.  There are many reasons
why this might be the case.  However, the most likely reason is that Linux
detected the BIOS geometry for /dev/hda incorrectly.  GNU Parted suspects the
real geometry should be 4865/255/63 (not 77545/16/63).  You should check with
your BIOS first, as this may not be correct.  You can inform Linux by adding
the parameter hda=4865,255,63 to the command line.  See the LILO or GRUB
documentation for more information.  If you think Parted's suggested geometry
is correct, you may select Ignore to continue (and fix Linux later).
Otherwise, select Cancel (and fix Linux and/or the BIOS now).
Ignore/Cancel? i
Information: The operating system thinks the geometry on /dev/hda is
4865/255/63.  Therefore, cylinder 1024 ends at 8032.499M.
(parted) help
  check MINOR                   do a simple check on the filesystem
  cp [FROM-DEVICE] FROM-MINOR TO-MINOR      copy filesystem to another
  help [COMMAND]                prints general help, or help on COMMAND
  mklabel LABEL-TYPE            create a new disklabel (partition table)
  mkfs MINOR FS-TYPE            make a filesystem FS-TYPE on partititon MINOR
  mkpart PART-TYPE [FS-TYPE] START END      make a partition
  mkpartfs PART-TYPE FS-TYPE START END      make a partition with a filesystem
  move MINOR START END          move partition MINOR
  name MINOR NAME               name partition MINOR NAME
  print [MINOR]                 display the partition table, or a partition
  quit                          exit program
  rescue START END              rescue a lost partition near START and END
  resize MINOR START END        resize filesystem on partition MINOR
  rm MINOR                      delete partition MINOR
  select DEVICE                 choose the device to edit
  set MINOR FLAG STATE          change a flag on partition MINOR
(parted) print
Disk geometry for /dev/hda: 0.000-38166.679 megabytes
Disk label type: msdos
Minor    Start       End     Type      Filesystem  Flags
1          0.031   4094.692  primary   fat32       boot
2       4094.692   4839.895  primary   linux-swap
3       4839.895  28066.684  primary   reiserfs
4      28066.685  38162.219  primary   fat32       lba
If you can see it, you could try to copy the partition to your new drive (you'll need an empty partition of at least the same size, of course). If you have to resize a partition on your new drive to make room, MAKE A BACKUP before you start.

And let that be a lesson to all of us: BACKUP BACKUP BACKUP!!!

Another alternative to buying another drive, if parted can't see it, your data is worth $89 and it's either ext2 or ext3, I'd recommend Stellar's Linux disk recovery tools. I have not tried the Linux version, but the NTFS/FAT version was absolutely amazing at recovering my otherwise dead, 5 yr old 10G drive. There is a free demo that will tell you whether or not there's any hope of recovery. Sadly, you need a WinDoze (9X/ME/NT/2000/XP) box to run it on.

Good luck, and please let us know how it turns out.

Last edited by Abject; 05-01-2004 at 03:58 PM.
Old 05-01-2004, 06:39 PM   #4
LQ Newbie
Registered: Mar 2004
Location: Cheshire, UK
Posts: 12

Rep: Reputation: 0

I can recommand you Rescue CD that helped me very much!
Good luck !
Old 05-01-2004, 10:39 PM   #5
Registered: Apr 2002
Location: Albuquerque, NM USA
Distribution: Slackware, Ubuntu, Debian, Maemo
Posts: 464

Rep: Reputation: 30
If you don't want to deal with the extra hard drive issue, and have lots of space on an existing one, you can copy the file system to a "container file" and do a loop back mount on it instead. It goes something like this:

cp /dev/sda2 laptop-image
losetup /dev/loop1 laptop-image
mount /dev/loop1 /mnt/rescue-partition

This example takes a usb drive that shows up as /dev/sda, and has the second partition (2) as the one you want and copies it to a file called "laptop-image". Then you use losetup to associate the file with a loopback device called "loop1". At this point you can do an fsck on it if you like by doing "fsck /dev/loop1", or attempt to mount it as shown above.
Old 05-02-2004, 02:50 PM   #6
LQ Newbie
Registered: May 2004
Posts: 2

Original Poster
Rep: Reputation: 0
Thank you all, problem solved.

Thanks, I did not need to do anything complicated after all. I booted up again to try to run fsck, but I noticed /dev/sda2 and /dev/sda3 where also in /etc/fstab and those turned out to be the swap and my sought after Linux partition. I'm not sure if I had missed them before
or if they only now appeared since I booted up with the USB hard drive already connected.

Thanks a lot anyway for the quick replies. And I will sure back up from now on.



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
Installing grub to external USB hard drive for later use as internal hard drive dhave Linux From Scratch 2 12-10-2005 08:48 AM
[SOLVED] Making multiple partitions on USB memory stick ctkroeker Linux - Hardware 1 06-16-2005 12:20 AM
USB drive using different partitions (usb key thumb drive) Arodef Linux - Hardware 0 08-04-2004 06:36 PM
hard drive partitions bm1 Linux - Hardware 3 11-26-2003 04:32 PM
Hard Drive / Partitions Starburn Linux - Hardware 2 10-29-2003 09:59 AM > Forums > Linux Forums > Linux - Hardware

All times are GMT -5. The time now is 09:07 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration