Solved

dd to NFS or CIFS

Posted on 2009-04-06
9
841 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
  • 2
9 Comments
 
LVL 7

Accepted Solution

by:
martin_2110 earned 400 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
Secure Your WordPress Site: 5 Essential Approaches

WordPress is the web's most popular CMS, but its dominance also makes it a target for attackers. Our eBook will show you how to:

Prevent costly exploits of core and plugin vulnerabilities
Repel automated attacks
Lock down your dashboard, secure your code, and protect your users

 
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 100 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

I. Introduction There's an interesting discussion going on now in an Experts Exchange Group — Attachments with no extension (http://www.experts-exchange.com/discussions/210281/Attachments-with-no-extension.html). This reminded me of questions tha…
Join Greg Farro and Ethan Banks from Packet Pushers (http://packetpushers.net/podcast/podcasts/pq-show-93-smart-network-monitoring-paessler-sponsored/) and Greg Ross from Paessler (https://www.paessler.com/prtg) for a discussion about smart network …
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.

688 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