LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Hardware (https://www.linuxquestions.org/questions/linux-hardware-18/)
-   -   Mounting external EXT3 via USB on FC4 (https://www.linuxquestions.org/questions/linux-hardware-18/mounting-external-ext3-via-usb-on-fc4-429170/)

twentyfour 03-28-2006 12:39 AM

Mounting external EXT3 via USB on FC4
 
I've searched here and found some good information but nothing exactly like what I'm looking for. Consider this a "newbie" post. I've got a fair amount of experience with some things on Linux, but I've never had to do anything like this.

I was previously running a server under RH9 and it experienced (what I assume was) a hard drive "crash". I don't know the particulars as I'm not smart on drive post-mortem tools. It now refuses to boot with a kernel panic and some nasty EXT3 errors. I can possibly capture those errors if there is a need but I figured it would be just as easy to remount the drive in an external USB box and pull the vital data off. Truthfully, my question is not related to the crash directly -- I've resolved that the drive will not boot but would really like to get certain bits of data off the drive.

The RH9 drive was the only drive in the machine and hence had a swap partition and the other standard (don't know what else to call them... default?) partitions for a run-of-the-mill RH9 install.

I've got an FC4 box handy so I figured with the HAL (?) it would be easy enough to mount the old drive via USB and get into the partitions to grab the data.

The FC4 box is running kernel: 2.6.15-1.1833_FC4

Plugging in the USB box creates the following:

In fstab:

Code:

# This file is edited by fstab-sync - see 'man fstab-sync' for details
/dev/VolGroup00/LogVol00 /                      ext3    defaults        1 1
LABEL=/boot            /boot                  ext3    defaults        1 2
/dev/devpts            /dev/pts                devpts  gid=5,mode=620  0 0
/dev/shm                /dev/shm                tmpfs  defaults        0 0
/dev/proc              /proc                  proc    defaults        0 0
/dev/sys                /sys                    sysfs  defaults        0 0
/dev/VolGroup00/LogVol01 swap                    swap    defaults        0 0
/dev/fd0                /media/floppy          auto    pamconsole,exec,noauto,utf8,managed 0 0
/dev/hdd                /media/cdrom            auto    pamconsole,exec,noauto,managed 0 0
/dev/sda1              /media/usbdisk          ext3    pamconsole,exec,noauto,managed 0 0
/dev/sda2              /media/usbdisk1        ext3    pamconsole,exec,noauto,managed 0 0

and /var/log/messages shows:

Code:

Mar 27 20:39:42 dorkus kernel: usb 1-2: new high speed USB device using ehci_hcd and address 2
Mar 27 20:39:42 dorkus kernel: SCSI subsystem initialized
Mar 27 20:39:42 dorkus kernel: Initializing USB Mass Storage driver...
Mar 27 20:39:42 dorkus kernel: scsi0 : SCSI emulation for USB Mass Storage devices
Mar 27 20:39:42 dorkus kernel: usbcore: registered new driver usb-storage
Mar 27 20:39:42 dorkus kernel: USB Mass Storage support registered.
Mar 27 20:39:47 dorkus kernel:  Vendor: Maxtor 5  Model: 2049U4            Rev: DA62
Mar 27 20:39:47 dorkus kernel:  Type:  Direct-Access                      ANSI SCSI revision: 00
Mar 27 20:39:47 dorkus kernel: SCSI device sda: 39882527 512-byte hdwr sectors (20420 MB)
Mar 27 20:39:47 dorkus kernel: sda: assuming drive cache: write through
Mar 27 20:39:47 dorkus kernel: SCSI device sda: 39882527 512-byte hdwr sectors (20420 MB)
Mar 27 20:39:47 dorkus kernel: sda: assuming drive cache: write through
Mar 27 20:39:47 dorkus kernel:  sda: sda1 sda2 sda3
Mar 27 20:39:47 dorkus kernel: sd 0:0:0:0: Attached scsi disk sda
Mar 27 20:39:47 dorkus scsi.agent[4321]: disk at /devices/pci0000:00/0000:00:10.3/usb1/1-2/1-2:1.0/host0/target0:0:0/0:0:0:0
Mar 27 20:39:48 dorkus fstab-sync[4373]: added mount point /media/usbdisk for /dev/sda1
Mar 27 20:39:48 dorkus fstab-sync[4382]: added mount point /media/usbdisk1 for /dev/sda2

I would take it from this that FC4 has mounted two of the drive's partitions at /media/usbdisk and /media/usbdisk1? However these directories are empty. When I log on to the desktop, there is an icon for a USB drive and it is labeled "/boot(2)". When I click on it, it shows all my stuff from the boot directory of the RH9 drive (or at least some stuff). There is no icon for any other partition.

Question: What, if anything, else do I need to do to mount the remaining partitions of the RH9 drive? Does the fact that the FC4 box didn't automatically mount them mean that they are trashed and not accessible? What other tools could I use to get to the data?

o.k. so that was questions plural, not question.... ;-)

One more bit of data. When I mount the drive on a Windows box it of course can't do anything with the EXT3 partitions but it does show four partitions.

Any insight would be appreciated. Thanks.

Lenard 03-28-2006 08:05 PM

# fdisk -l /dev/sda

That is the letter "L" and not the number one in the comand above.

# mkdir /media/partitionX

# mount -t ext3 /dev/sdaX /media/partitionX -ro

Where X is the partition number you want to mount (ignore the swap partition).

michaelk 03-28-2006 09:14 PM

A default RH9 install creates 3 partitions. /boot / and swap. The posted log messages confirms the 3 partitions. RH and fedora uses volume labels and so now you have two partitions labeled /boot. The second one being the USB drive hence the /boot(2). The second / is not automatically mounted.

twentyfour 03-28-2006 11:11 PM

This can't be good.....
 
Thanks guys! I got this in my logs when I tried this:

Code:

Mar 28 20:51:29 dorkus kernel: EXT3-fs error (device sda2): ext3_check_descriptors: Block bitmap for group 128 not in group (block 1701062688)!
Mar 28 20:51:29 dorkus kernel: EXT3-fs: group descriptors corrupted !

Starting from the beginning, I saw this when I did fdisk:

Code:

Disk /dev/sda: 20.4 GB, 20419853824 bytes
240 heads, 63 sectors/track, 2637 cylinders
Units = cylinders of 15120 * 512 = 7741440 bytes

  Device Boot      Start        End      Blocks  Id  System
/dev/sda1  *          1          14      105808+  83  Linux
/dev/sda2              15        2551    19179720  83  Linux
/dev/sda3            2552        2637      650160  82  Linux swap / Solaris


The mount command gave me this:

Code:

# mount -t ext3 /dev/sda2 /media/partition2
mount: wrong fs type, bad option, bad superblock on /dev/sda2,
      missing codepage or other error
      In some cases useful info is found in syslog - try
      dmesg | tail  or so

Note that I had to do it without the -ro option, or at least I think that was the problem. I tried it just like Lenard said and got this:

Code:

# mount -t ext3 /dev/sda2 /media/partition2 -ro
mount: option requires an argument -- o
Usage: mount -V                : print version
      mount -h                : print this help
      mount                    : list mounted filesystems
      mount -l                : idem, including volume labels
So far the informational part. Next the mounting.
The command is `mount [-t fstype] something somewhere'.
Details found in /etc/fstab may be omitted.
      mount -a [-t|-O] ...    : mount all stuff from /etc/fstab
      mount device            : mount device at the known place
      mount directory          : mount known device here
      mount -t type dev dir    : ordinary mount command
Note that one does not really mount a device, one mounts
a filesystem (of the given type) found on the device.
One can also mount an already visible directory tree elsewhere:
      mount --bind olddir newdir
or move a subtree:
      mount --move olddir newdir
A device can be given by name, say /dev/hda1 or /dev/cdrom,
or by label, using  -L label  or by uuid, using  -U uuid .
Other options: [-nfFrsvw] [-o options] [-p passwdfd].
For many more details, say  man 8 mount .

Did I miss something or do I need to fix something more drastic?

Thanks again guys. I really appreciate it.

Lenard 03-29-2006 07:14 AM

No, it was a typo on my part sorry....

# mount -t ext3 /dev/sdaX /media/partitionX -r

or

# mount -t ext3 /dev/sdaX /media/partitionX -o ro


All times are GMT -5. The time now is 09:22 AM.