Link to home
Start Free TrialLog in
Avatar of bos_
bos_

asked on

Need help mounting HD in usb enclosure...recovering data from failed partition--treading very lightly don't want to lose data.

Dealing with leased dedicated Linux RH4 server with RAID 1 drives, no direct access to server.

The partition failed... at the time tech support was able to access the drives but could not get system to boot.   The provider removed the two (RAID 1) drives from the server and commissioned a new box and added a USB enclosure, stating that the drive old drive could be mounted and enclosure and all files then backedup.  However, the ISP refuesed to mount the drive.  

Here is what I know:

# ls -al sd*
brw-rw----  1 root disk 8,  0 Nov  1 10:30 sda
brw-rw----  1 root disk 8,  1 Nov  1 10:30 sda1
brw-rw----  1 root disk 8,  2 Nov  1 10:30 sda2
brw-rw----  1 root disk 8,  3 Nov  1 10:30 sda3
brw-rw----  1 root disk 8, 16 Nov  3 03:53 sdb

# cd /dev
# mkdir /mnt/olddrive
# mount /dev/sdb3 /mnt/olddrive
mount: special device /dev/sdb3 does not exist
# mount /dev/sdb /mnt/olddrive
mount: you must specify the filesystem type

Another request was made for IPS to mount drive between running last and next mount attempts.  Support responded:  
     "The dedicated server hard drives are formatted in ext3 format by default.  The second disk would be listed as sdb.  The information provided to mount the second disk was an example and may not be the exact information.  We suggest researching online using a search engine or forum how to properly mount and access the second hard drive. "
      Great support, eah?

Next I tried:

# mount -r -t ext3 /dev/sdb /mnt/olddrive
mount: wrong fs type, bad option, bad superblock on /dev/sdb,
       or too many mounted file systems

I want to tread very lightly as there is data on these drives that does not exist elsewhere.

Does any one have any suggestions?
Avatar of TCB1
TCB1
Flag of United States of America image

Try downloading Ubuntu 8.10 live CD and boot to it with the usb hard drive attached. Perhaps then all needed drive will be mounted so you can copy the data.
Avatar of bos_
bos_

ASKER

Is rather not attempt to install another OS.  The new RH4/RAID1 box is stable.  This question is really how to mount the 'sdb' drive using RH4 Linux.   I appreciate the Ubantu suggestions but given I only have SSH to the box and switching to Ubantu sounds like something of a step backwards.
Sorry, I didn't mean install ubuntu. Just boot to the CD to the live environment. It may automatically mount your needed drives. It will not alter anything on your system.
Avatar of bos_

ASKER

The complication is that I have no direct access to the server load and execute a CD.  Unless there is a utility that would run under RH E4, I think I'm still looking for someone who has experience with the the mount command illustrated above.
I see. Look at the fstab file (etc/fstab) and see if it has an entry for sda. If it's there, then just a simple "mount sda" or "mount sda1" (whatever the drive is) should work.

I'll be the first to admit however, that I'm not an expert on the mount command.
I've put in a request that other experts look at your question.
Avatar of bos_

ASKER

Thank you TCB1!

Here is contents of /etc/fstab:

# This file is edited by fstab-sync - see 'man fstab-sync' for details
LABEL=/                 /                       ext3          defaults                   1 1
LABEL=/boot         /boot               ext3          defaults                   1 2
none                       /dev/pts           devpts     gid=5,mode=620  0 0
none                       /dev/shm        tmpfs       defaults                   0 0
none                       /proc                proc         defaults                   0 0
none                       /sys                  sysfs       defaults                   0 0
/dev/sda2               swap               swap       defaults                   0 0
The server should have 2 internal hard drives mirrored with RAID 1
PLUS a USB enclosure which contains the HD we are trying to mount (previously in another server)
I don't see sdb print.
The information that I received from the help / support folks has been less than helpful through out this process... Is there some way to check that the USB enclosure is there, had power and that the drive in it should be sdb?

What can we try that would not put drive, eclosure or data at risk?
So the system is running with the RAID 1 mounted? By looking at the list, all I see is the swap partition mounted. So I don't think the RAID 1 drives are mounted or the USB. But knowing that sda2 (The 2nd Partition on drive sda) is a swap partition, it makes me think that the RAID 1 could be sda1 (The 1st partition on drive sda).

I'm not sure where the USB fits in. Try running "mount" it will list all the current mounted drives and post it here.
Avatar of bos_

ASKER

#mount
/dev/sda3 on / type ext3 (rw)
none on /proc type proc (rw)
none on /sys type sysfs (rw)
none on /dev/pts type devpts (rw,gid=5,mode=620)
usbfs on /proc/bus/usb type usbfs (rw)
/dev/sda1 on /boot type ext3 (rw)
none on /dev/shm type tmpfs (rw)
none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
sunrpc on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw)
Ok, so lets review what we know. (Or at least what I think is correct)

sda is the RAID 1 disk(s)
sda1 is /boot
sda2 is swap
sda3 is /

The only thing I see that is usb is the usbfs on /proc/bus/usb
So try to navigate to /proc/bus/usb and do a "ls -la" and post it. I'm guessing that this is the mounted usb drive. Then if that's the case, figureout what it is you need to copy from sda1 or sda3.
Avatar of bos_

ASKER

# cd /proc/bus/usb
# ls -al
total 0
drwxr-xr-x  7 root root 0 Nov  1 10:30 .
dr-xr-xr-x  5 root root 0 Nov  1 10:30 ..
dr-xr-xr-x  2 root root 0 Nov  1 10:30 001
dr-xr-xr-x  2 root root 0 Nov  1 10:30 002
dr-xr-xr-x  2 root root 0 Nov  1 10:30 003
dr-xr-xr-x  2 root root 0 Nov  1 10:30 004
dr-xr-xr-x  2 root root 0 Nov  1 10:30 005
-r--r--r--  1 root root 0 Nov  3 03:53 devices

[usb]# ls -al
total 0
drwxr-xr-x  7 root root 0 Nov  1 10:30 .
dr-xr-xr-x  5 root root 0 Nov  1 10:30 ..
dr-xr-xr-x  2 root root 0 Nov  1 10:30 001
dr-xr-xr-x  2 root root 0 Nov  1 10:30 002
dr-xr-xr-x  2 root root 0 Nov  1 10:30 003
dr-xr-xr-x  2 root root 0 Nov  1 10:30 004
dr-xr-xr-x  2 root root 0 Nov  1 10:30 005
-r--r--r--  1 root root 0 Nov  3 03:53 devices

[usb]# cd 001
[001]# ls -al
total 0
dr-xr-xr-x  2 root root  0 Nov  1 10:30 .
drwxr-xr-x  7 root root  0 Nov  1 10:30 ..
-rw-r--r--  1 root root 43 Nov  1 10:30 001
-rw-r--r--  1 root root 50 Nov  3 03:53 007
[001]# cd 007
bash: cd: 007: Not a directory
[001]# cd 001
bash: cd: 001: Not a directory
[001]#
Hmm, not quite what I hoped to see. I know when I plug some usb device in Ubuntu, its mount point is usually under /media. I'm not sure if RedHat follows the same convention.

For example, my usb flash drive is sdb1 on /media/PC_Doctor (PC_Doctor is the volume name)
So it's possible that the drive will be sdb1, since that is the logical next device name after sda, but just needs to be mounted at a preferred mount point because it's external? (/media/<something here>)
I'm not sure. I don't have extensive experience with linux.

Do you know anything about the usb drive, like what type of file system it is? (vfat,ext3,etc...)

Try this:

# mount -r -t ext3 /dev/sdb1 /mnt/olddrive--same as your example but with a 1 for the partition of sdb
or
# mount -r -t vfat /dev/sdb1 /mnt/olddrive

I assume that /mnt/olddrive is a valid mount point/directory.

Also, once you find the usb drive and get it mounted, how and what do you plan on copying to it? The whole RAID 1 drive?

Hope some of the above helps. I'm beginning to run out of suggestions. I'm sure things would be easier for you if you had physical access to the machine.
Oh--you probably are aware of this, but you must run the mount command with Administrator privileges.

Example:

#sudo mount -r -t ext3 /dev/sdb1 /mnt/olddrive
Avatar of bos_

ASKER

# cd /dev
# mount -r -t ext3 /dev/sdb1 /mnt/olddrive
mount: special device /dev/sdb1 does not exist

I don't have any additional information about the USB enclosure, but I will try to find out.

/mnt/old drive is mount point that I was given by the ISP's tech support; however, they've made more than their share of bad assumptions so far.

Once the data is available, I plan to tar and scp to a local machine.

As to privileges, I'm doing all as root.



Ok, try looking at the /etc/mtab file and post it. Maybe we can get some clues from it. Maybe the usb drive is formatted ext2?
You need to take the -r out of the mount command, as that makes it readonly.
Avatar of bos_

ASKER

/etc/mtab
/dev/sda3 / ext3 rw 0 0
none /proc proc rw 0 0
none /sys sysfs rw 0 0
none /dev/pts devpts rw,gid=5,mode=620 0 0
usbfs /proc/bus/usb usbfs rw 0 0
/dev/sda1 /boot ext3 rw 0 0
none /dev/shm tmpfs rw 0 0
none /proc/sys/fs/binfmt_misc binfmt_misc rw 0 0
sunrpc /var/lib/nfs/rpc_pipefs rpc_pipefs rw 0 0

Avatar of bos_

ASKER

Without the -r
[dev]# mount -t ext3 /dev/sdb1 /mnt/olddrive
mount: special device /dev/sdb1 does not exist

Try replacing ext3 with ext2. I didn't see anything in mtab that helps. I'll try and figure out what usbfs is.
Avatar of bos_

ASKER

[root]# cd dev
[dev]# mount -r -t ext2 /dev/sdb1 /mnt/olddrive
mount: special device /dev/sdb1 does not exist

[dev]# mount -t ext2 /dev/sdb1 /mnt/olddrive
mount: special device /dev/sdb1 does not exist
 
You probably have it but I attached a text file with the man mount.



man-mount.txt
Try /dev/sdc1 instead of sdb1. I'm thinking that because raid 1 is two physical drives, the system may be using sdb1 for the second drive?
Avatar of bos_

ASKER

#mount -r -t ext2 /dev/sdc1 /mnt/olddrive
mount: special device /dev/sdc1 does not exist
#mount -t ext2 /dev/sdc1 /mnt/olddrive
mount: special device /dev/sdc1 does not exist
ASKER CERTIFIED SOLUTION
Avatar of TCB1
TCB1
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of rindi
It looks like there are no partitions on sdb. Have you considered getting the disk sent to you by your ISP and then trying to get to the data at your location?
Perhaps the usb drive needs to be unplugged and plugged back in because I don't think the system sees the drive. Usually usb drives are mounted automatically in my experience. The usbfs in mtab the way I understand it is nothing more than the way the system mounts the usb controllers. Also, I don't understand why they will not mount it for you. It shouldn't be this difficult.
This seems to be an Red Hat enterprise server, and although I'm not sure, I believe such server OS's usually don't come with support for USB drives out of the box. You'd probably have to install separate modules etc., and that can be a problem with hosted servers. For that reason it would probably save you a lot of hassles if you have physical access to the disk and try getting at the data using a live CD or your own installation which has all the necessary support.
You received a reasonable error message from attempting to mount /dev/sdb as you posted in your original question. There is a device at /dev/sdb - can you try running fdisk /dev/sdb to see whether it has a partition table? It may be that the partitions are not exported to Linux for some reason - as per http:#22940696 the kernel may not have the right modules. On the other hand, there may no longer be a usable partition table on the disk. When you run fdisk, you will see what the situation is.
First step is to check what the system said about the HDDs at boot/when the usb drive was connected... "dmesg" is a good command to start with;-). It'll reveal what the kernel think sdb really is.
As rindi points out, there seem to be no partitions on sdb... "fdisk -l /dev/sdb" would reveal more (or confirm)...

As you say rindi, RHEL just might lack the needed usb storage thingies... Which might be visible in dmesg too ... dmesg will barf a lot of info, so pipe it through "less", and search for sda/sdb respectively (search is invoked by hitting "/" and typing whatever you are looking for... end with <Enter>;-).

Lets start there and see what can be found.
Cheers
-- Glenn
Avatar of bos_

ASKER

THANK YOU ALL for you continued assistance in sorting this out.   I one of the managers at the ISP advocating for managers up the line to approve shipping one of the disks to me, but I'm not holding my breath.
I wasn't sure about piping through less, so I attached the whole dmesg here.
I also ran fdisk as suggested...

[root/]# /sbin/fdisk -l /dev/sdb
Disk /dev/sdb: 120.0 GB, 120034123776 bytes
255 heads, 63 sectors/track, 14593 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
   Device Boot      Start         End      Blocks   Id  System

dmesg-GDdev3-08nov13.txt
Avatar of bos_

ASKER

The original failure of the old server was caused by a partition problem.  Unfortunately the ISP plays their cards very close and what they did or didn't do is almost totally unknown.  

At the time of the partition failure, the ISP had full access to the RAID drives but they were not able to get the old server to boot.   I was told the only solution available was to put the drive in a USB enclosure in a new server, only they didn't tell me their service would be limited.

I'm hoping one someone is able to make sense out of the dmesg and the fdisk results in my prior post.

Thank you!

fdisk shows no partition table. Not good...
dmesg shows no FAT or ext3 system found on /dev/sdb.
I suspect it may have had a partition table once. If you have a record of how it was, you may be able to recreate it.
Exactly... Makes me wonder how _the other_ mirror looks. Was that a HPT R1 mirror as on this server?
Even if one would be able to recreate a reasonable simile of the original partition table... I wouldn't expect much to be on that disk... at least have very little hopes...:/

Good thing is that the usbsotrage thingies seem to be there, and be working OK, for whatever that is worth:).

Could you have the ISP change so that the other HDD is put in the cradle?

-- Glenn
Avatar of bos_

ASKER

Do you think the ISP would have any records regarding the configuration that could be helpful?  If so, is there something specific I should as for?  
I also have another server with the same ISP which likely has an identical configuration.   Might it be reasonable to check the partition table there and use that informaiton to build a partition table on the sdb drive?
So...
I decided I'd try to explore the other server to see if I could find any info about what would have been in the partition table.

OTHER SERVER INFO

I ran mtab
dev/sda3 / ext3 rw 0 0
none /proc proc rw 0 0
none /sys sysfs rw 0 0
none /dev/pts devpts rw,gid=5,mode=620 0 0
usbfs /proc/bus/usb usbfs rw 0 0
/dev/sda1 /boot ext3 rw 0 0
none /dev/shm tmpfs rw 0 0
none /proc/sys/fs/binfmt_misc binfmt_misc rw 0

I then ran
[root etc]# /sbin/fdisk /dev/sda1
Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
Building a new DOS disklabel. Changes will remain in memory only,
until you decide to write them. After that, of course, the previous
content won't be recoverable.
Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)
Command (m for help): m

-----

THEN I tried sda3

[root etc]# /sbin/fdisk /dev/sda3
Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
Building a new DOS disklabel. Changes will remain in memory only,
until you decide to write them. After that, of course, the previous
content won't be recoverable.

The number of cylinders for this disk is set to 14319.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
   (e.g., DOS FDISK, OS/2 FDISK)
Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)
 
-----
Are there any other paths to explore ... other than guessing at the contents of the partition table, or getting the physical drive and trying to mount it using another Linux box and a Ubantu CD?
If we guess at the contents of the partition table I would assume that there is a good chance we would corrupt the data if we are wrong... is that true?
What is the best course of action at this point?
Ok, you can only use the other servers partitioning as a template if it is _identical_ to the old one. That means down to the disk geometry (more or less). So it might not be worth exploring...

Now about fdisk... You would list the partition table by specifying the "-l" option (as i exemplified above). Fdisk does not work on a single partition, it works on the disk itself. Since you specify a partition number, the fdisk command can't make head nor tails of what it reads... The form of the disk device filehandle names is something like XdYZ where X is "h" for IDE type devices and "s" for SCSI devices (also for "emulated" things like USB mass storage devices), Y is "a" for the first device found of that "type", "b" for the second, "c" for the third and so on, and finally Y if present denominates the partition number (more or less straight from the partition table). So the plain sda would be your first SCSI disk, sdb the second, sda1 the first partition on sda and so on. To confise matetrs, some HW raid controller drivers will have naming schemes that divert substantially from the above (HPs S.M.A.R.T come to mind... cciss ... ).
Anyway, you should use
fdisk -l /dev/sda
to list the partition table of the fisrt SCSI disk.

Cheers
-- Glenn
Something that may also be an issue is that the old server may have used LVM, and those modules may be missing on the new server to which they attached the USB disk. Or, the old server used a raid controller where the disks can't be read on other hardware, and therefore they wouldn't be read in a USB case. This isn't very common, particularly with hardware raid 1, but there are some such controllers. So it may be necessary to connect the disk to the original or a similar raid controller.

Anyway, don't ISP's that do server hosting normally make backups? I think you should be able to sue them in any case, whether you can recover your data or not...
Very true rindi... Akthough the ability to sue for damages ... varies wildly from country to country. If in the US.... then by all means, call in the lawyers:-). But first try make them switch drives in the USB box...:-).

Cheers
-- Glenn
Avatar of bos_

ASKER

Sorry guys, I've been traveling.

An argument against deleting this thread:
I have found other suggested approaches for mounting to be confusing and misleading.  This thread provides clarity and suggested alternatives that are valuable.  
I am still searching for a way to mount this drive and recover this data. The problem at the moment is not the advise in this thread but rather the policies of the hosting company--which will not provide physical access to the drive and maintains policies which prevent them from providing meaningful / qualified technical assistance or recovery services.  
While this problem is as yet unsolved.  I believe the advise provided here would be valuable to any who may have a similar problem.  

I while has been helpful and I have referred back to in numerous times in my continued attempts to resolve the problem.  
It may take legal action to get access to the drives and if that happens, I will then be able to move forward with some of the approaches suggested above.
THANK YOU ALL!
bos_,
You can prevent this question being deleted by accepting (an) answer(s) and awarding points. If you have found the answers useful, I think that would be the Right Thing to do.
Avatar of bos_

ASKER

Bottom line--Even or especially with RAID 1, it is strongly advised that one document and make backup copies of their partition tables, before you have a problem!  This horror story began when we found out that the ISPs dedicated server / 'expert' technical support team won't do much of anything because of potential liability issues.  

While each expert who offered advise really deserves more points than are available on this one...I've decided the points giving 400 to TBS1 for early and ongoing effort and 50 each to Duncan and GNS for additional expert help.  To all others who chimed in, THANK YOU!