Latest LQ Deal: Linux Power User Bundle
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 09-01-2008, 12:32 PM   #1
Registered: Feb 2007
Posts: 385

Rep: Reputation: 30
backup whole disk.

I have a 20G disk with bootable window 95 and there are 2-3 logical partition on the disk c:,d:,e: et.

I want to use the disk for something else and transfer all the data to
a bigger disk. However, There are a lot of tools/software that I may need to boot my computer with this disk in the future.

Is there an easy way to tool on linux to backup the whole thing?
Will I be able to restore it on a bigger drive?

I was looking in to the dd if=/dev/hda command. If I use that, will I be able to restore hda1,hda2 with dd, or do I need to create those partitions before restore it?

Last edited by ufmale; 09-01-2008 at 06:49 PM.
Old 09-01-2008, 12:34 PM   #2
Registered: Sep 2007
Location: Folsom, California
Distribution: Debian 4.0 (Etch), Debian 5.0 (Lenny), Ubuntu 8.04
Posts: 302

Rep: Reputation: 32
To my knowledge you have to create the partitions and then dd each partition. Perhaps someone with more experience will be able to tell you for sure.
Old 09-01-2008, 12:54 PM   #3
Senior Member
Registered: Nov 2006
Distribution: Debian Squeeze SMP AMD64
Posts: 3,318

Rep: Reputation: 126Reputation: 126
Here's a pretty comprehensive thread on the use of "dd":

If you use the dd command, check it several times before you actually hit the enter key.

Another way is to boot from Knoppix (or similar) and use "cp -axu /from /to" where "/from" and "/to" are drives you've mounted on knoppix. Then, install grub, of course.

The preferred way is probably using dd. There is lots of discussion in the dd thread, and lots of information.


Oops. As b0uncer pointed out, you have windows stuff, so you'll need to use dd.

Last edited by Quakeboy02; 09-01-2008 at 01:13 PM.
Old 09-01-2008, 01:07 PM   #4
LQ Guru
Registered: Aug 2003
Distribution: CentOS, OS X
Posts: 5,131

Rep: Reputation: Disabled
If you want your Windows software to work after the copy operation, you need to use something like dd that makes one to one copy of the data; simply copying files may well result in the files being there but software not working (for example if Windows registry happens to be missing or wrecked). I'd guess what you want to do is dd the whole disk to another physical disk and if the new disk is bigger than the old (dd won't enlarge the image; if you copy 20GB to a 40GB disk, you'll seemingly be missing 20GB after that), after that resize the partition(s) to fill the disk. Don't get rid of the data in the old disk before you've made sure the new one works..
Old 09-01-2008, 06:51 PM   #5
Registered: Feb 2007
Posts: 385

Original Poster
Rep: Reputation: 30
It looks like I still do not get a solution.

What is other software I can use then? Is there a free software run on Windows if no tool available on Linux?

I did some searching on the Internet. I think the tool is called disk cloning. but i am still finding the one i can use.

Last edited by ufmale; 09-01-2008 at 06:58 PM.
Old 09-01-2008, 07:39 PM   #6
Senior Member
Registered: Nov 2006
Distribution: Debian Squeeze SMP AMD64
Posts: 3,318

Rep: Reputation: 126Reputation: 126
Why can't you use "dd"?
Old 09-01-2008, 08:15 PM   #7
Registered: Mar 2008
Location: Virginia
Distribution: RHEL 4/5, Fedora 6-9, SuSE 10.1-11, Open Solaris 10.8, WinXP,2003,Vista
Posts: 59

Rep: Reputation: 15
The software you seek is Clonezilla.
Old 09-01-2008, 08:50 PM   #8
LQ Guru
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 671Reputation: 671Reputation: 671Reputation: 671Reputation: 671Reputation: 671
You could use dd to create a byte-by-byte image of the drive. On the new larger drive, partition it with the sizes you want. Then mount each partition from the image and simply copy all of the files over. Suppose that you use an external drive (don't use the fat32 filesystem) to save the image, and it is mounted on /media/disk/.

All of these commands are run as root.
dd if=/dev/sda bs=512 of=/media/disk/sda_backup.img
Next save the partition information in a file. ( Although it can be obtained from the image, it's still a good idea. )
fdisk -u /dev/sda >/media/disk/sda_partition_table.
You will need the starting offsets for each partition to be able to mount a partition on a disk image file, later, when you are ready to mount the partitions.

jschiwal@qosmio:~> sudo mkdir /mnt/part3
jschiwal@qosmio:~> sudo /sbin/fdisk -lu /dev/sda

Disk /dev/sda: 200.0 GB, 200049647616 bytes
255 heads, 63 sectors/track, 24321 cylinders, total 390721968 sectors
Units = sectors of 1 * 512 = 512 bytes
Disk identifier: 0xd1b42421

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1            2048     3074047     1536000    7  HPFS/NTFS
Partition 1 does not end on cylinder boundary.
/dev/sda2   *     3084480   150577244    73746382+   7  HPFS/NTFS
/dev/sda3       150577245   372659804   111041280    f  W95 Ext'd (LBA)
/dev/sda4       372666368   390721535     9027584   17  Hidden HPFS/NTFS
/dev/sda5       150577371   154786274     2104452   82  Linux swap / Solaris
/dev/sda6       154786338   216347354    30780508+  83  Linux
/dev/sda7       216347418   372659804    78156193+  83  Linux
jschiwal@qosmio:~> sudo /sbin/losetup -fs /dev/sda -o $((512*372666368))
jschiwal@qosmio:~> sudo mount -t ntfs /dev/loop0 /mnt/part3/
jschiwal@qosmio:~> sudo ls /mnt/part3/ | head -n 5
If you do it as root, you don't need to run sudo. I need to really feel some pain before using "su -".


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
backup a failing disk to a larger disk gfem Linux - General 8 07-13-2007 07:19 PM
fitting 39 Gb disk image onto 39 Gb backup disk ivlad2002 Linux - Laptop and Netbook 6 03-29-2007 04:45 PM
Disk backup? rookworm Linux - Newbie 3 11-13-2005 05:38 PM
disk to disk backup for debian/Mempis on bootable cd-- advice loninappleton Linux - Software 3 05-27-2005 01:00 AM
can I backup a root disk and boot from the new backup disk linuxbkp Linux - Enterprise 3 10-15-2004 06:42 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 03:12 AM.

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