dd to NFS or CIFS

Short story:

Have a Windows 2003 server with 3 RAID drives.  One is dying.  Have a spare, but it's done in hardware RAID and I think that is screwing up too.  I want to dd the drives so I have good images in case the drives completely go South.

The problem:  The only servers with enough storage to handle the drives are a Windows 2003 box with a SMB/CIFS share, and FreeBSD box with an NFS share.

How do I dd to a share?  I have tried creating a mount point and assigning it to the SMB share, but that didn't work.  

Note: The server's disks I am trying to rescue will not boot!  I am using a Linux boot CD to get to where I am.
 
LVL 1
dougp23Asked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
martin_2110Connect With a Mentor Commented:
If you have another server with sshd running on it say the nfs server you could skip the mounting and do a dd over ssh

dd if=/dev/hda | ssh username@nfsserver  "dd of=/directory_of_backups_on_ssh_server/backupfile.iso"
0
 
martin_2110Commented:
Make sure you check to see if your image is valid also.....
mkdir /mnt/a
mount -o loop ~/backupfile.iso /mnt/a
ls /mnt/a
0
 
dougp23Author Commented:
OK, looks like the dd is working, I can't tell.  After awhile the server that is running off the linux boot CD just gets non-responsive.  Looks like about 10GB copies over, the disks are (I think) 17GB.  So this might be right as I imagine not all of the disk space was used.

Martin, I can't grasp the logic of your script (it's my limited expertise, trust me).  I assume these commands should be run on the NFS box that is RECEIVING the image.  One problem:  the box is FreeBSD which doesn't support the o option in mount.  I'm checking right now for how or if this can be done in BSD.

Thanks.  
0
The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

 
martin_2110Commented:
<dougp23>OK, looks like the dd is working, I can't tell.  After awhile the server that is running off the linux boot CD just gets non-responsive.  Looks like about 10GB copies over, the disks are (I think) 17GB.  So this might be right as I imagine not all of the disk space was used.

<Martin> It should not become unresponsive. You may be correct about the disk problem. You may want to try changing the command by adding "conv=noerror,sync" to the command. for example:
dd if=/dev/hda conv=noerror,sync | ssh username@nfsserver  "dd of=/directory_of_backups_on_ssh_server/backupfile.iso"
This will carry on past any read errors, substituting zeros for the unreadable sectors.

<dougp23>  One problem:  the box is FreeBSD which doesn't support the o option in mount.
<Martin> I am not a bsd guy but this may help "http://www.freebsddiary.org/iso-mount.php

<Dougp23> I can't grasp the logic of your script
<martin> The first part "dd if=/dev/hda" does a dd to standard out. I then pipe it over ssh to a dd  command running on the other server
 "| ssh username@nfsserver  dd of=/directory_of_backups_on_ssh_server"
which takes the standard out from the other dd command as standard in.

<Dougp23> I assume these commands should be run on the NFS box that is RECEIVING the image.
<martin> The mount command should be run on the BSD nfsserver.
The ssh command should be run on the bad disk server.
0
 
martin_2110Commented:
You might also consider checking out ghost for linux also.
http://redkrieg.com/2007/03/19/ghost-4-linux-complete-guide-to-imaging/

I would also recommend you also do a file level backup to be on the safe side if you loose anything.

Becarful!! :)
0
 
larstrConnect With a Mentor Commented:
Why don't you convert this server to a virtual machine? (now that there are several freely available virtualization solutions)

The safest method would be to create a MOA cd so you could get a cold clone of the system. MOA is using VMware Converter and will give you 1 virtual disk file per logical drive. VMware converter also understands NTFS and this speeds up things (compared to using dd) if you have large blocks of unused disk space on your system.

Even if the system disk wont boot (either physical or in a vm) you could easily add the data disks to another working virtual machine.

Lars
0
 
dougp23Author Commented:
martin> I intend to be very careful!  

larstr>I might give this a shot.  My problem is that this server has 3 drives, in a hardware RAID 5 setup.  I believe one of the disks is shot, rendering the server unbootable.  I made the mistake of going into the RAID BIOS and saying "Remove the Logical Drive". That was bad, not as bad as saying "Initialize".  So I need to backup the disks before I try to recreate the array.  I am not sure if using MOA I could somehow - in software - recreate the array, and then copy those folders to a new machine.

It's late, I'll see how it all goes tomorrow.
0
 
larstrCommented:
You removed the RAID config from the RAID controller?!!

What RAID controller are you having in your system?

Lars
0
 
dougp23Author Commented:
Hey Lars.  It's MegaRAID BIOS.  I did something like "Clear Logical Drive Config".  According to the documentation, all the data is still intact until I initialize, which I don't plan to do for a LLLOOONNNNGGGG time!  Just finishing the last "dd" now.  Now I plan to go into the BIOS and recreate the array, mark drive 2 (using ordinal numbering) as bad, and see if I can rebuild it to my hotswap.

I'm open to all sorts of ideas of course!!

Doug
0
All Courses

From novice to tech pro — start learning today.