[Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

dd to NFS or CIFS

Posted on 2009-04-06
9
Medium Priority
?
864 Views
Last Modified: 2013-12-06
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.
 
0
Comment
Question by:dougp23
  • 4
  • 3
  • 2
9 Comments
 
LVL 7

Accepted Solution

by:
martin_2110 earned 1600 total points
ID: 24081129
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
 
LVL 7

Expert Comment

by:martin_2110
ID: 24081724
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
 
LVL 1

Author Comment

by:dougp23
ID: 24087830
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
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
LVL 7

Expert Comment

by:martin_2110
ID: 24091310
<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
 
LVL 7

Expert Comment

by:martin_2110
ID: 24091359
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
 
LVL 18

Assisted Solution

by:larstr
larstr earned 400 total points
ID: 24092585
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
 
LVL 1

Author Comment

by:dougp23
ID: 24093096
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
 
LVL 18

Expert Comment

by:larstr
ID: 24095020
You removed the RAID config from the RAID controller?!!

What RAID controller are you having in your system?

Lars
0
 
LVL 1

Author Comment

by:dougp23
ID: 24096318
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

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Java performance on Solaris - Managing CPUs There are various resource controls in operating system which directly/indirectly influence the performance of application. one of the most important resource controls is "CPU".   In a multithreaded…
The purpose of this article is to demonstrate how we can use conditional statements using Python.
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial
Suggested Courses
Course of the Month20 days, 10 hours left to enroll

867 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question