Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux? |
| Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
 |
GNU/Linux Basic Guide
This 255-page guide will provide you with the keys to understand the philosophy of free software, teach you how to use and handle it, and give you the tools required to move easily in the world of GNU/Linux. Many users and administrators will be taking their first steps with this GNU/Linux Basic guide and it will show you how to approach and solve the problems you encounter.
Click Here to receive this Complete Guide absolutely free. |
|
 |
09-01-2009, 04:12 PM
|
#1
|
|
LQ Newbie
Registered: Mar 2009
Posts: 17
Rep:
|
How can I backup/restore different partitions individually?
I have both Ubuntu and Vista on my machine, not counting the extra media partitions, and I would like to know if there is a way to backup all of the partitions to a USB hard drive so I can restore a single partition or all of them easily.
For example, I want to be able to restore only Windows if it crashes or only Ubuntu if I make it crash or only /home without overwriting the working partitions.
What would be a safe, simple and efficient way to get this done every week? I'll take care of the cron job, but I need advice on the method.
|
|
|
|
09-01-2009, 04:52 PM
|
#2
|
|
LQ Newbie
Registered: Jan 2006
Posts: 9
Rep:
|
I would try using fdisk on the hard drive that your linux is installed. If you can see the Vista partitions then you could try to use the dd command from a partition to a file on your usb drive. e.g., dd if=/dev/sda of=/mnt/usbdrive/partition_name
Be very careful with fdisk. You can always use the letter q as a command followed by enter t9o exit without changing anyting
Quote:
Originally Posted by n1c0_ds
I have both Ubuntu and Vista on my machine, not counting the extra media partitions, and I would like to know if there is a way to backup all of the partitions to a USB hard drive so I can restore a single partition or all of them easily.
For example, I want to be able to restore only Windows if it crashes or only Ubuntu if I make it crash or only /home without overwriting the working partitions.
What would be a safe, simple and efficient way to get this done every week? I'll take care of the cron job, but I need advice on the method.
|
|
|
|
|
09-01-2009, 06:37 PM
|
#3
|
|
Member
Registered: Jun 2009
Location: Penang, Malaysia
Distribution: Mandriva, CentOS, Ubuntu
Posts: 456
Rep:
|
You probably don't wanna do it in a cron job. Especially for a mounted partition.
Try out clonezilla live. It works great as an image backup tool. Runs off a livecd.
|
|
|
|
09-01-2009, 10:46 PM
|
#4
|
|
LQ Newbie
Registered: Mar 2009
Posts: 17
Original Poster
Rep:
|
After fixing some errors with my partitions (overlapping), I used dd if=/dev/sda of=/dev/sdc1. sdc1 is a 250gb, fat32 partition on my external hard drive.
Over 2 hours and still writing, can't wait to see what will happen.
I'll try clonezilla too, next time.
|
|
|
|
09-02-2009, 08:34 AM
|
#5
|
|
Member
Registered: Jun 2009
Location: Penang, Malaysia
Distribution: Mandriva, CentOS, Ubuntu
Posts: 456
Rep:
|
I don't think dd will work this way. dd is just a straight raw byte by byte copy. It will probably screw-up the sdc1 partition.
Last edited by ongte; 09-02-2009 at 08:40 AM.
|
|
|
|
09-02-2009, 08:58 AM
|
#6
|
|
LQ Newbie
Registered: Mar 2009
Posts: 17
Original Poster
Rep:
|
Quote:
Originally Posted by ongte
I don't think dd will work this way. dd is just a straight raw byte by byte copy. It will probably screw-up the sdc1 partition.
|
It indeed did!
Since the thing absolutely needs a complete, raw hard disk to work, and that I can't provide.
After 12 hours, I had 204gb copied only! Not good if you don't have 12 hours free to keep your laptop open.
|
|
|
|
09-02-2009, 09:08 AM
|
#7
|
|
Member
Registered: Jun 2009
Location: Penang, Malaysia
Distribution: Mandriva, CentOS, Ubuntu
Posts: 456
Rep:
|
There's a good clone of Ghost called G4L you might try out. 
For quick backup of partitions, try partimage.
|
|
|
|
09-02-2009, 09:05 PM
|
#8
|
|
LQ Newbie
Registered: Mar 2009
Posts: 17
Original Poster
Rep:
|
In the end, I still ended up using the DD command. While it might not be the fastest method, it still is remarkably simple and efficient.
It took me 12 hours to get my whole hard drive backed up to an external HDD.
Once you're done, I had to use GParted to remake the swap partition as it had been destroyed during the transfer and showed up as an unknown partition. (I was using my computer the whole time)
|
|
|
|
09-03-2009, 06:33 AM
|
#9
|
|
LQ Newbie
Registered: Jan 2006
Posts: 9
Rep:
|
I would not trust the partitions containing your active system nor active applications after using dd!
Using dd on a mounted partition that contains files that change rapidly can result in different parts of a single file being copied while the file is changing.
I do not understand the way Vista partitions a disk so you are going to get that from some one else.
I do know that with a Linux system one can copy the boot sector and in that way maintain a partition table of the hard disk.
As for it taking 12 hours, You did say you were using a USB connection.
Quote:
Originally Posted by n1c0_ds
In the end, I still ended up using the DD command. While it might not be the fastest method, it still is remarkably simple and efficient.
It took me 12 hours to get my whole hard drive backed up to an external HDD.
Once you're done, I had to use GParted to remake the swap partition as it had been destroyed during the transfer and showed up as an unknown partition. (I was using my computer the whole time)
|
|
|
|
|
09-07-2009, 09:12 AM
|
#10
|
|
LQ Newbie
Registered: Mar 2009
Posts: 17
Original Poster
Rep:
|
Well, I tried Norton Ghost yesterday. Big disappointment. So I went back to the dd command and this time added conv=sync,noerror and it worked like a charm. The external hard drive is now bootable (I even booted it by accident and didn't notice until I saw the blinking light).
I wrote a complete guide (pictures!) on how to use the command here:
http://blog.nicolasbouliane.com/?p=1115
|
|
|
|
09-07-2009, 09:36 AM
|
#11
|
|
Moderator
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733
|
IMHO, making regular image backups is too fragile. An initial clone, and full file backup after a new install would be ok. You can use rsync or tar to create incremental backups.
If you use dd to create a temporary zero-filled file, and then delete it, partitions will be more compressible. Use the results of `df' to determine the size of the zeroed file to create. Restoring, you would pipe the output of zcat (or bzcat) to the dd command when restoring.
If you do compress the images, you won't be able to mount the images.
If you create a disk image, you can use losetup to create loop devices, and then mount partitions on the image. I'd recommend running "fdisk -lu" to create a listing of your partition table. Print it out. It may come in handy in the future to either restore a damaged MBR or to get the offsets to use with losetup.
|
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -5. The time now is 01:14 AM.
|
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|