Linux - SoftwareThis 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.
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.
Here is what I want to do. I'd love to be able to backup my RAID array to my exernal HD. I am currently using rsnapshot to backup important files and directories to my external drive that I constantly work with on a regular basis. However, rsnapshot is not meant for "backing up" an entire system should the worst happen.
I've looked into Clonezilla, but that requires a live CD to run. My sever is in a production environment and its not possible to take it offline for that period of time daily to do the clone. I'm looking for a program that I don't have to run from a live CD that will "clone" or copy my current disk image to my external drive. That way, should something horrible happen, I could install a new RAID array and then copy the image from my external drive over to the new array.
I would think that with a current disk image clone AND rsnapshot keeping up other important files up to date, it would take a fire or hurricane to do me in.
Distribution: Debian /Jessie/Stretch/Sid, Linux Mint DE
Posts: 5,195
Rep:
I use rsync.
It makes a complete copy of my hard disk ex /proc and /sys directory. When my hard disk crashes, I install a new disk, run a live CD, copy the files back, make the new drive bootable, and that is it.
Have I done it often? Making the back-up yes restoring, no. But I often started with an empty system, did an rsync from the original to the new system and followed the sequence as outlined. And that was succesful.
rsync is one fine tool for backups, but it just does not take care of the parition table and filesystem infos.
Might be nice if there would be a tool that would extract thouse data...
Distribution: Solaris 9 & 10, Mac OS X, Ubuntu Server
Posts: 1,197
Rep:
Those are easy to extract with a few lines of shell script, and they don't change very often. I typically have a periodic script that copies those to a backup file in /etc and also print them out and keep them in a paper file along with backup tapes and recovery CD's.
Yeah, that is what I really CAN'T use rsnapshot for. I can do like jlinkles suggested and have rsnapshot backup up everything (sans /proc & /sys) but I still need the ability to copy the MBR (I guess dd would be fine for that) and then partition info, etc...
I don't know enough about how those things work to be able to figure out what exactly I need.
Those are easy to extract with a few lines of shell script, and they don't change very often. I typically have a periodic script that copies those to a backup file in /etc and also print them out and keep them in a paper file along with backup tapes and recovery CD's.
Hm can you provide some of these scripts?
The mbr should be good with
Code:
dd if=/dev/hda of=/root/mbr.hda bs=512 count=1
but how do you get the partition table and the filesystem infos? Would it be enough to get the superblock of an ext3 for example?
Distribution: Debian /Jessie/Stretch/Sid, Linux Mint DE
Posts: 5,195
Rep:
WAIT!
When you copy the first 512 bytes you don't just copy the MBR but the partition table also. I believe the MBR is the first 416 bytes or so, but look that up in Wiki.
Copying the partition table is only allowed when the disk are identical.
Creating partitions is done with fdisk in batch mode, followed by a mkfs which also runs in batch mode.
Distribution: Solaris 9 & 10, Mac OS X, Ubuntu Server
Posts: 1,197
Rep:
Sounds like jlinkels is getting at it. Unfortunately, my scripts have been in Solaris. So it would take me some time to figure out specific details for linux.
WAIT!
When you copy the first 512 bytes you don't just copy the MBR but the partition table also. I believe the MBR is the first 416 bytes or so, but look that up in Wiki.
jlinkels
Absolute right. I assumed rebuilding the same disk. But while thinking about data reocvery that is sure not a think to depend on.
Just for the records the partition table start at 446 and ends on 510 followed by the magic bytes 55AA.
So I would just save all of the 512 bytes and when using a new disk for recover would put the mbr back with this
But while reading up on the mbr part of wikipedia there some other stuff to consider. Specially the disk signature (byte 440 - 443). But that only would matter if you still have the old disk somewhere in the system.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.