Visit Jeremy's Blog.
Go Back > Forums > Linux Forums > Linux - Software
User Name
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.


  Search this Thread
Old 01-09-2012, 05:54 PM   #1
Registered: Dec 2007
Location: phobos, mars
Distribution: 64-bit linux mint 18.1
Posts: 221

Rep: Reputation: 15
help: best ways to create and restore pseudo-disk-image backups ???

I'm not familiar enough with how the various backup approaches work to know whether I have a serious problem or a trivial one.

I want to create a backup image of my 1TB ubuntu64 10.04 disk drive for at least two purposes:

#1: So I can restore the drive to its current state if the filesystem gets damaged.

#2: So I can create an identical installation on another hard disk drive. Specifically, I have a new 3TB drive, and I'd like to make a functionally identical copy of the ubuntu64 installation on my 1TB drive.

Here are possible catches and unknowns for me.

#A: The 1TB drive has an "msdos" style partitions, while the new 3TB drive has "gpt" style partitions. I'm not sure whether "gpt" style partitions are required because the drive is larger than 2.2TB, but if not, I'm quite happy to go ahead and re-partition the drive with "msdos" style partitions as long as I don't lose that extra 0.8TB.

#B: The 1TB drive has 512 byte physical sectors and the 3TB drive has 4TB physical sectors. Therefore, it is obviously not acceptable to create the clone installation on the 3TB drive via a sector-by-sector copy.

#C: I don't want to make backups of empty sectors like a complete image does. Whatever does this backup should only read, save and restore real file contents. The 1TB drive is only about 30% full.

#D: It would be nice if the software can handle slight partition differences on the backup and restore drives. For example, the 1TB drive that I want to backup has these partitions ( "/", "/backup", swap) while my new 3TB (restore) drive has these partitions ("/", "/boot", "/backup", swap). But if necessary I can make the new drive have the same partitions, except the "/" partition will be vastly larger, and since the physical sector sizes are different. All the other partitions may be slightly different size [just slightly] since the physical sectors are 512B and 4096B on the 1TB and 3TB drives respectively.

#E: Finally, here is an alternative that would be great if it works, but I'm guessing there's no practical way to accomplish. That would be to create the fresh new installation of ubuntu64 on the 3TB drive from the same DVD that I created the original installation on the 1TB drive... then somehow some application figure out all the files on the 1TB drive that either don't exist yet on the 3TB drive, or have different contents --- and copy them all over to the 3TB drive. I assume that would end up creating a functionally identical installation, including all the software updates that have happened in the past 20 months since I installed ubuntu64 10.04 on the 1TB drive.

I can't believe I've been programming for 30 years without ever taking time to figure out the variations and permutations of backup applications and techniques... but there you go. Bottom line: I want something that is brain-dead simple (no matter how long it takes to execute), not something complex and fancy, or something that runs "under the covers" where I'm not aware of what's happening or when. I want it to run only when I run it, and I don't want to learn any big complex applications. Period.

So, what best fits my wish list, in your not-so-humble opinions?
Old 01-09-2012, 06:51 PM   #2
Registered: Nov 2004
Location: Australia
Distribution: Fedora, Ubuntu
Posts: 55
Blog Entries: 2

Rep: Reputation: 17

I think you are right. The mismatched sector sizes will probably give you issues using dd or similar. Most likely when the file system structure refers to offsets in the image by sector and misses. Haven't tried it though so take that with a grain of salt.

GPT is required for the table to refer beyond 2.2T. I forget the exact details, but gpt requires a small partition for some gpt boot stuff to live in, so you should see a small extra partition created if you install from DVD. Without this partition, grub will whine about not being able to put its boot up stuff anywhere on such a large drive. From memory, that error was not too clearly worded and required some google work to track down the issue.

Your idea of reinstall and then copy the differences has some merit. The utility you are after for copying the differences is called rsync. If you have a lot of hard links (millions) you can soak up all your ram and fail, otherwise it works quite well after you've worked out which options you want. You probably want to install the 3tb, then boot from the 1tb to do the rsync to avoid writing open files. For this method you don't need similar partition sizes, but you do need to avoid syncing /etc/fstab and similar files or fix them up after. If you sync /boot you probably want to redo any grub stuff and this has bitten me on several occasions This is complicated by having to tell grub that you are configuring in an alternate root location, and I spend a some time each time round trying to figure out how to do that properly so I wont guess to hard here. You are probably looking at utilities like update-grub2, grub-install, grub-probe, grub-setup. If you don't sync /boot and you have done your apt-get up(date/grade)s properly you will end up with the apt database from the 1TB thinking /boot contains the latest kernels while actually having the stock ones from the dvd, so the grub pain is a necessary evil.

Old 01-09-2012, 07:31 PM   #3
LQ Veteran
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 15,812

Rep: Reputation: 2168Reputation: 2168Reputation: 2168Reputation: 2168Reputation: 2168Reputation: 2168Reputation: 2168Reputation: 2168Reputation: 2168Reputation: 2168Reputation: 2168
I have never liked "image" backups.
Basically you can't have what you want if you just want to sit back with your thumb in your ear.

I prefer filesystem level backups (as per rsync above) - it has several benefits; you know the source is readable, you can selectively restore, you can restore to a different {type,size} filesystem ...
I like fsarchiver as it checksums everything as well. Safer is better.
And yes, you need to fix the boot-loader - no big deal as it's well understood procedure.
Of course all this needs to be done from a liveCD - so no files are open.


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
Create Single Disk Image from 5 disk RAID 5 setup? slimjim Linux - Software 3 12-13-2011 05:34 AM
restore a hard disk from an image possibly automatically cccc Linux - Networking 1 06-18-2011 02:18 PM
Restore LVM disk from image, made by dd tolsty7 Linux - General 4 07-12-2010 02:00 AM
clonezilla clone disk to image, when restore from image to destination hdd problem. hocheetiong Linux - Newbie 3 05-06-2008 07:59 PM
restore hard disk from several splitted files by Partition Image powah Linux - Software 4 03-11-2008 10:03 PM > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 07:29 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