[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

dd to NFS or CIFS

Posted on 2009-04-06
9
Medium Priority
?
856 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 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
Nothing ever in the clear!

This technical paper will help you implement VMware’s VM encryption as well as implement Veeam encryption which together will achieve the nothing ever in the clear goal. If a bad guy steals VMs, backups or traffic they get nothing.

 
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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Using libpcap/Jpcap to capture and send packets on Solaris version (10/11) Library used: 1.      Libpcap (http://www.tcpdump.org) Version 1.2 2.      Jpcap(http://netresearch.ics.uci.edu/kfujii/Jpcap/doc/index.html) Version 0.6 Prerequisite: 1.      GCC …
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 several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
Suggested Courses

656 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