[SOLVED] Creating a full system backup larger than 4GB (eg to USB)?
Linux - NewbieThis 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!
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.
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.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Creating a full system backup larger than 4GB (eg to USB)?
Hi all, new to the forums, but been a Linux user since 2009. I use Mint 17.
Having tinkered and fiddled to create my 'perfect' Linux environment, I'd like to back it up to a bootable device, to include all my tweeks (hardware, themes, software apps etc). I've successfully done this in the past to DVD with Remastersys, and I'm aware of Clonezilla, but they seem tied to the 4GB iso size limit.
Now that my 'perfect' system is around 8GB, is there any way to create a bootable backup that can handle that size, such as to a large capacity USB memory device? I have a big external drive to simply copy the whole system over file-by-file, but it would be nice to have a re-installation disk/device. (I've Googled much without any promising solution.)
Distribution: Mainly Devuan, antiX, & Void, with Tiny Core, Fatdog, & BSD thrown in.
Posts: 5,505
Rep:
You can use dd, it will do a block by block backup of your disk to a file on your other disk, you will need to run this from a 'live' system. (You may have to be the root user.) Be very careful about your if & of designations.
dd is the way to go for this, I agree. You will make a bit-by-bit copy of your disk, and put it into a file on the destination disk. You restore the file to a disk, which will be bootable, again using dd. Read the manual for dd carefully. As fatmac said, you can't do the backup while you're booted into the system, you'll need to boot from another drive, and run dd from there, with both the drive to be backed up and the destination drive connected.
One may consider using dd and then pipe it to a compression. May select more advanced compression types and options to force better compression. dd doesn't always work however. Your perfect system may have some unique references to this drive and may have to edit to generic.
I assume they are only tied to the 4 gig limit on fat usb maybe? Try different format on usb.
You can use other tools too that only copy file by file. Remember that clonezilla basically uses common programs that you can use.
Distribution: Void, Linux From Scratch, Slackware64
Posts: 3,153
Rep:
word of warning when using dd to backup a drive first its sloooooow as it does a bit for bit copy, second on restore which is even slower the disk you are restoring to will be made into an EXACT copy so if you try to restore to a larger disk, ie if you are moving drives. the disk will get truncated so you would then need to expand the drive back out to its formaer size with the possibilty of lost data, which is always a ( small ) risk when resizing a disk, there are better ways of doing a backup than dd, though it does have its uses, I do use dd to back up my raspberry pi card cos i'm lazy at times!
i use dd on my 32 gb fedora live-usb (because i have yum installed everything i'd like) and it takes about 3 hours on this cheap (1.6 ghz atom/1 gb ram) pc.
Code:
dd if=/dev/zero of=tmp.zero; rm tmp.zero
dd if=/dev/sdb bs=2048 | bzip2 > fc-20.iso.bz2 # to create the image
bunzip2 -c fc-20.iso.bz2 | sudo dd of=/dev/sdb bs=2048 # to restore the image
mind you IF the usb thumb drive is STILL the factory default ( Microsoft long name) Fat32 format
4 gig IS THE MAX!!!! file size you can put on it ( well 4 gig minus 1 bit)
reformat it to a LINUX!!!! format
ext4 is a good choice
Distribution: Debian Sid AMD64, Raspbian Wheezy, various VMs
Posts: 7,680
Rep:
I saw remastersys mentioned in the original post but no mention since. I've only played with it briefly but I understand it to be, roughly, a tool which could create a live distro or, more germane to this topic, an installer which would re-create an existing system. The problem with dd as a backup is that UUIDs change and, in some cases, some other things do -- so a customised installer sounds a better fit, to me.
So, my question, since remastersys is dead what is the replacement and does it allow for installer images of any size or does it limit them to DVD and, as a corollary, are the images isohybrid?
Thanks for the suggestions folks, all good valid suggestions.
However, when I looked more at Clonezilla and dd, a bit-for-bit copy didn't seem to be quite what I was after. (piping compression in dd looks interesting but a little complex - I'll have a go another time.) My OS drive is 250GB, and I wanted to ISO just the filesystem (since trimmed to 7GB) to a 16GB USB pen drive - more than big enough for the filesystem, but not for cloning a whole drive of largely empty space.
So I went back to remastersys which, despite being obsolete, did the job fine. I trimmed my apps to get the total filesystem to 7GB, and remastersys created an ISO of 2.7GB - a compression ratio of around 2.5:1 which easily fits on a DVD. (I then realised with that compression ratio there had been no need to trim my apps! Doh!) The resultant DVD boots just fine, with all my lovely themes and preferences intact.
ISO creation time about 20 minutes. Write to DVD about 5 minutes (always using a slow x8 speed - faster speeds risk more DVD errors in my experience.)
But I did some learning, so a big thank you to you all.
I guess I mark this as solved.
Last edited by tellyman69; 06-13-2015 at 07:41 AM.
Reason: afterthought
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.