LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 06-21-2012, 03:47 PM   #1
netraider
LQ Newbie
 
Registered: Jun 2012
Posts: 12

Rep: Reputation: 0
Need correct syntax for creating HDD clone with dd command


I have been struggling to create an image of my HDD with dd. Can anyone help me remember the correct syntax please? Thanks in advance.
 
Old 06-21-2012, 04:23 PM   #2
ukiuki
Senior Member
 
Registered: May 2010
Location: Planet Earth
Distribution: Debian
Posts: 1,030

Rep: Reputation: 385Reputation: 385Reputation: 385Reputation: 385
Here you can find all you need: http://www.linuxquestions.org/questi...ommand-362506/

Regards
 
1 members found this post helpful.
Old 06-22-2012, 06:57 AM   #3
H_TeXMeX_H
LQ Guru
 
Registered: Oct 2005
Location: $RANDOM
Distribution: slackware64
Posts: 12,928
Blog Entries: 2

Rep: Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301
I recommend using:
http://clonezilla.org/

HOWTO:
http://www.tuxradar.com/content/how-...ves-clonezilla

You can do it with dd, but it's not as easy or reliable. dd can do a lot, but maybe it shouldn't be used for everything.
 
1 members found this post helpful.
Old 06-22-2012, 02:19 PM   #4
netraider
LQ Newbie
 
Registered: Jun 2012
Posts: 12

Original Poster
Rep: Reputation: 0
@ukiuki & @H_TeXMeX_H, thank you very much. Your insight has been most useful.
 
Old 06-22-2012, 02:44 PM   #5
netraider
LQ Newbie
 
Registered: Jun 2012
Posts: 12

Original Poster
Rep: Reputation: 0
@ukiuki, thanks again. There was some very useful information gathered from the link you posted. However, my problem still remains. I afraid to say it, but I still need help. I am somewhat a newbie and some of the information contained on that page was somewhat cryptic to me at best. I would like it if someone could post an example using the dd command to clone a HDD and save it to a nfs.

Here are the details of my nfs:

hostname (- the domain name) : nas1
target directory on nas where I would like to save the image: /linuxbkps
location to mount nfs to linux filesystem (which I am cloning): /mnt/linuxbkps

Also, how would I mount the nfs. I have not had any luck with that either. I need an example using my real details. I have tried the man pages and forums. I am not understanding it at all.

Thanks
 
Old 06-22-2012, 04:01 PM   #6
david63025
Member
 
Registered: Apr 2009
Location: Missouri USA
Distribution: Slackware64-15.0
Posts: 33

Rep: Reputation: 24
If you don't have NFS setup yet, then you'll need to do that first. I recommend <http://nfs.sourceforge.net/nfs-howto/> to setup the server and client sides. It also covers mounting a remote directory.
Try 'man dd' for a the dd syntax or the link above covers what you need.

David
 
1 members found this post helpful.
Old 06-22-2012, 04:09 PM   #7
ukiuki
Senior Member
 
Registered: May 2010
Location: Planet Earth
Distribution: Debian
Posts: 1,030

Rep: Reputation: 385Reputation: 385Reputation: 385Reputation: 385
If DD seen to be too difficult then it is easier to use Clonezilla, if all you need is to clone a hard drive or partition, that is the tool! Unless you really want to learn DD, if so, please tell us what are your hdd(s) settings, open terminal and as root do:
Code:
fdisk -l
Also tell us from where to where you want to clone.

Regards
 
1 members found this post helpful.
Old 06-22-2012, 04:35 PM   #8
netraider
LQ Newbie
 
Registered: Jun 2012
Posts: 12

Original Poster
Rep: Reputation: 0
@ukiuki, thanks for taking the time to help. I understand that Clonezilla is an easy alternative, however, I do like to do things the hard way. With that said, yes, I would very much like to learn DD. I have a never ending thirst for knowledge and I am eternally greatful for any help that will allow me to achieve it.

Here is are the settings of my hdd:

Disk /dev/sda: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders, total 976773168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x000b3a73

Device Boot Start End Blocks Id System
/dev/sda1 63 3903794 1951866 82 Linux swap
/dev/sda2 * 3903795 5863724 979965 83 Linux
/dev/sda3 5863725 976773167 485454721+ 83 Linux

I want to clone the entire disk with all partitions; MBR (everything on disk & intact). I wish to save it to my NAS. I created the NFS share /linuxbkps on the / directory of the NAS and was instructed to use /raid0/data/linuxbkps as the mount point. I have made several attempts and failed at connecting the NFS, but I will read through the information that David has just furnished me and give it another go. In the mean time, if I could just learn dd. I will be somewhat fulfilled.

This is how I attempted the process: (sorry, I do not yet know how to enter syntax in a code box within this forum, but I will learn.)

# dd if=/dev/sda of=/nas1.domain/linux.dd_bs512 bs=512

I know I have probably got it all wrong.

Last edited by netraider; 06-22-2012 at 04:41 PM. Reason: correction
 
Old 06-22-2012, 04:42 PM   #9
netraider
LQ Newbie
 
Registered: Jun 2012
Posts: 12

Original Poster
Rep: Reputation: 0
@david62035 thanks for the info. I will read up on it.
 
Old 06-22-2012, 04:48 PM   #10
ukiuki
Senior Member
 
Registered: May 2010
Location: Planet Earth
Distribution: Debian
Posts: 1,030

Rep: Reputation: 385Reputation: 385Reputation: 385Reputation: 385
Let me understand one thing, do you have only one hard drive? If yes, well you can't clone the entire hdd, if you don't have another hdd where to send all the data. When you issue dd if=/dev/sda you are saying to dd to copy/clone the whole drive, so 500GB and you'll need another 500BG at least to send all that data to. Now if you are trying to send it to somewhere in the network, again you still need over there 500GB space where it can fit, i do not know if dd will work that way. The syntax looks correct, dd if=/(from) of=/(to).

Regards
 
Old 06-22-2012, 05:09 PM   #11
netraider
LQ Newbie
 
Registered: Jun 2012
Posts: 12

Original Poster
Rep: Reputation: 0
@ukiuki, you are correct. I have only one physical hdd in my Linux box. The other drive is contained within my NAS. The NAS houses 5 1TB hdd's configured in a RAID 5 which has reduced my overall capacity to a total of 2788.9 GB with some data already contained on the stripe, of course. I am hoping that it is in fact possible to save to the NAS. I have heard that is was, but was given no specific information as to how to do it. I have not found a proper example that would help me either.

Should this be sufficient as far as capacity? Where do you suggest that I look to gather more information on the possibility of saving the image over the network using dd? And if I were able to mount an NFS share to the filesystem, would it suffice as a local backup drive?

I had hoped to mount the NFS share to /mnt/linuxbkps and from that point, instruct dd to create the image of /dev/sda and push it to /mnt/linuxbkps , which would in theory, save it to the NAS.

Last edited by netraider; 06-22-2012 at 05:11 PM. Reason: clarification
 
Old 06-22-2012, 08:44 PM   #12
ukiuki
Senior Member
 
Registered: May 2010
Location: Planet Earth
Distribution: Debian
Posts: 1,030

Rep: Reputation: 385Reputation: 385Reputation: 385Reputation: 385
Try this: http://www.pantz.org/software/dd/dri...hsshanddd.html
Also search for dd over network.

Regards
 
1 members found this post helpful.
Old 06-22-2012, 10:38 PM   #13
allend
LQ 5k Club
 
Registered: Oct 2003
Location: Melbourne
Distribution: Slackware64-15.0
Posts: 6,367

Rep: Reputation: 2747Reputation: 2747Reputation: 2747Reputation: 2747Reputation: 2747Reputation: 2747Reputation: 2747Reputation: 2747Reputation: 2747Reputation: 2747Reputation: 2747
I would not recommend the use of ssh in a home situation as it will be very slow.

This should a relatively straightforward task.
1. Boot the system from a CD with a Linux system that has NFS support.
2. Configure networking. (Check that your network interface is detected with 'ifconfig'. If you have an external DHCP server, enter 'dhcpcd' to get the network address and gateway assigned. Otherwise follow procedures for setting up a static IP address)
3. Mount the remote NFS share on a local mount point /mnt/tmp (you may need to create this with 'mkdir /mnt/tmp') with 'mount nas1:/linuxbkps /mnt/tmp'
4. Create the image with 'dd if=/dev/sda of=/mnt/tmp/<image name> bs=4096'. Depending on your setup, a larger block size may give better performance.
 
2 members found this post helpful.
Old 06-25-2012, 11:05 AM   #14
netraider
LQ Newbie
 
Registered: Jun 2012
Posts: 12

Original Poster
Rep: Reputation: 0
@ukiuki and @allend, thank you both very much, your answers have been most helpful. I have gained the knowledge that I was seeking. I can now happily mark this thread as solved. Thanks again.

I have up'ed your reps.

Last edited by netraider; 06-25-2012 at 11:32 AM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] backup command: 'dump' and 'pax' => correct syntax usage dragonetti Linux - Newbie 3 10-10-2011 02:17 AM
[SOLVED] Best way to correct Hard drive clone gone wrong boguspersin Ubuntu 6 07-02-2011 09:22 PM
Correct syntax for cu jowa45 Slackware 10 11-01-2007 09:26 AM
So what is the Correct way to clone a HD in a LAB setting? knichel Linux - Software 2 09-14-2006 05:47 AM
what is the correct syntax shanenin Linux - Software 2 10-19-2003 12:31 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 11:34 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration