Solved

How to create image of hard drive using dd directly to cd or dvd

Posted on 2006-07-16
8
444 Views
Last Modified: 2013-12-16
I am wanting to make a complete backup image using dd of my hard drive, however, since it is the only hard drive in my system, i can't write the image to itself.  I do, however, have a dvd burner on this system.  Is it possible to use dd to image the entire hard drive directly to a series of either cds or dvds (i know it would be a stack of them, but i think it's my only option).  Also, what compression options are available that might help reduce the size of the output?  Are there other utilities that would do the same, but in a better way than dd?

Thanks for your help!!

ps:  This is on Slackware Linux
0
Comment
Question by:sah18
8 Comments
 
LVL 22

Accepted Solution

by:
pjedmond earned 300 total points
ID: 17117972
First, in order to carry out the backup, you need to mount the drive read only.....which is a problem if you are running from it!...Therefore, you need a live CD:

http://www.frozentech.com/content/livecd.php

Knoppix (or any of the other data recovery ones) will do the job nicely. Provided you can run the Live CD and burn to an optical media, or save to an external network system, or drive, then you can carry out the backup.

To make an exact copy using dd:

dd if=/dev/hda1 of=/mnt/externaldrive

A number of other ways of doing this to a remote server (over ssh), or a remote share are detailed here:

http://www.okmoore.com/imagedrive.html

(   (()
(`-' _\
 ''  ''

0
 
LVL 9

Author Comment

by:sah18
ID: 17118043
Thanks very much for your help.  Just a couple more questions... The command you gave will work to burn directly to a cd?  Also, don't I need something to tell it to breakup the image into pieces only as large as the media I'm writing to (or will this happen automatically)?  I do actually have two optical drives on this system -- a cd-rw drive and a dvd+rw drive, so I would be able to boot to a live cd first, then burn the image to the second drive.
0
 
LVL 22

Expert Comment

by:pjedmond
ID: 17118122
>The command you gave will work to burn directly to a cd?

No - You need to use something like cdroast or cdtools to burn to the CD (once you've broken the image into suitable bits).

>Also, don't I need something to tell it to breakup the image into pieces only as large as the media I'm writing to (or will this happen automatically)?

You probably want to use tar to compress the file and use the k option to force it to break the file into specified sized bits.

man tar

for more details

>I do actually have two optical drives on this system -- a cd-rw drive and a dvd+rw drive, so I would be able to boot to a live cd first, then burn the image to the second drive.

Yes you could, but you'd need some space somewhere to store the image/break it up/create the burn image. Either on the network, or on a second drive installed especially for this.

(   (()
(`-' _\
 ''  ''
0
 
LVL 9

Author Comment

by:sah18
ID: 17118132
So, you're saying it's not possible to image directly to a cd or dvd on linux?  You can do this in windows, that why I was hoping linux could do it as well.
0
How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

 
LVL 24

Assisted Solution

by:slyong
slyong earned 100 total points
ID: 17118174
> Are there other utilities that would do the same, but in a better way than dd?
Try Mondo Rescue.. http://www.mondorescue.org/.  It can do back up to CD/DVD too.

Novell also has a script to help you to write to a DVD-R/W: http://www.novell.com/coolsolutions/tools/15505.html simpler but not doing as much as Mondo Rescue
0
 
LVL 39

Assisted Solution

by:noci
noci earned 100 total points
ID: 17118221
dd will only write directly to a dvd-ram, all other need some filesystem that is cd/dvd aware.
but you can use a tool like growisofs, (commandline) or k3b (graphic version)
to burn data to a dvd-rw.
0
 
LVL 22

Expert Comment

by:pjedmond
ID: 17118235
>So, you're saying it's not possible to image directly to a cd or dvd on linux?  You can do this in windows

AFAIK you can only do that in windows if you have enough space on the operating system drive to create the image prior to burning it to the CD. The same applies to Linux. If you'd like to do the copying 1 file at a time, then memory is probably sufficient to hold each file before it is burnt. Indeed you could do the same with an iso image if you had sufficient memory available, but very few systems have over 4GB of memory in order to enable them to do DVDs on the fly!

Even Mondo requires 800MB of disc space free for preparing the image for burning to CD. For 'streaming to tape, you don't need this because the stream of data is passed continuously to the tape.

(   (()
(`-' _\
 ''  ''
0
 
LVL 9

Author Comment

by:sah18
ID: 17118428
thanks to all for your suggestions!  they've been helpful!
0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

If you have a server on collocation with the super-fast CPU, that doesn't mean that you get it running at full power. Here is a preamble. When doing inventory of Linux servers, that I'm administering, I've found that some of them are running on l…
SSH (Secure Shell) - Tips and Tricks As you all know SSH(Secure Shell) is a network protocol, which we use to access/transfer files securely between two networked devices. SSH was actually designed as a replacement for insecure protocols that sen…
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…
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.

708 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now