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.
This is a somewhat hybrid system - Tweaked Debian Based (4.0 I think) Studio64 and I have installed and got running LLAMP and Webmin on top. I have 2 identical (250GB) disks one or which is the system and I'd like to mirror to the other it in such a way that if the original breaks (or , more likely, I break it!), I can boot off the other and restore myself to the last backup. I tried:
dd if=sdb of=sda
a number (4+) of times. Mostly it runs for ages (6+ hrs) then hangs the system. Once it completed and the system booted off sda but no 'products'- (LLAMP, KDE) would start. (various errors indicating wrong device).
The question(s):
Is this the right approach for what I am trying to do - make the system safe by providing an alternate system? Ideally, Id like this to just run automatically every 3-5 days.
Why does this hang most of the time (and indeed, why are the results different when, as near as I can tell, the starting conditions are the same? Maybe this is a clue:
Using dd to make a copy of a mounted filesystem isn't a great idea. In any case, if you like to use dd, you should see AwesomeMachine's 'Learn The DD Command Revised' here on LQ. Have you considered the use of rsync to do your backup? You would have to copy the MBR independently, but that rarely, if ever changes.
--- rod.
If Human Error is not something you are too concerned about I'd advise using RAID. There are a few ways to RAID and it is possible to convert partitions to RAID, this gives an active back-up. It does have the issue that RAIDs do back-up human error so from that side of things it is not a back-up and also it is possible to cause other issues during the process of making a RAID but I am just tossing it out as an alternative option to look at. Else wise I'd do as theNbomr has said and consider rsync as it will only back-up files that have changed since the last rsync.
Last edited by r3sistance; 06-24-2011 at 11:05 AM.
Many thanks for the replies. Re the dd command - is the problem in using this on mounted file systems around open files? I've looked into rsync but as I said - I am very new at Linux (and unix)and rsync looked a bit complicated to start with. I come from a VMS world and while much here looks familiar, the language is alien (!) and underlying ideas are quite different. I'll look into rsync again ... I'll need to figure out the simple command to copy the entire disk... the fact that it copies only changes after that is a big boost. Any chance of pointing me at some instruction for copying the MBR?
Good forum! I might just get a handle on this yet!
VMS as in VAX ?. Whoa - I thought I was old school ...
Misty memories of a PDP 11/45 connected to a CDC 6400 swirl past ...
Sorry, back to the current century/universe.
dd is a block level tool - it has no knowledge (or interest) in filesystems. Read that as "your data". Madness to use it on a running system.
And by default it works at the sector level (512 bytes) - hence it takes forever, and updates get lost. Similar comments apply to any generic tool on running system(s) BTW - rsync included.
Do full system backups from a quiesced system - liveCDs work well.
As for backing up the MBR, I have never seen a benefit, and lots of potential cock-ups. Easier to re-install. That liveCD comes to the rescue again.
You can use tar command to take full system backup. Refer http://ubuntuforums.org/showthread.php?t=35087. After full system backup, to restore just install basic linux. Copy the backup to the local file system and restore.
@satya_s2k: this is the third post of you with a link to this "learn-linux" site.
Maybe the site is useful in your opinion, as far as I see there is nothing on this site with has to do anything with the theme of this thread, the same thing is true for the other two posts of you. Moreover the site seems quite new and there is nothing useful at all.
We don't want spammers here, if you insert a link, please take a useful link which points us to a site which has something to do with the theme of the thread.
I'd use a different block size for the dd command.
I'd also dd to a file instead. Dunno why but I would.
I clone a lot of old systems with dd to some ftp file. I compress the image. There is some about that may be best for your systems. Some may support max compression but the middle 5 is a good place to start.
Distribution: Ubuntu 11.4,DD-WRT micro plus ssh,lfs-6.6,Fedora 15,Fedora 16
Posts: 3,233
Rep:
dd SHOULD work, provided the drives are the same size, but running it on the drive that contains the active OS is troublesome at best because the contents are always changing, it's like trying to shoot a moving target.
the best way to clone a drive with your OS like this, i'm surprised nobody else seems to have mentioned such, is to boot the drive off a live cd or thumb drive, THEN perform the dd operation.
Ok. I think for the immediate issue, there are a number of cloning options. Live CD and dd sounds good. I guess I'd get the same effect with clonezilla. I can then attempt an upgrade which, it it all goes horribly wrong, I can get out of! After that an regular, automatic and reliable backup mechanism is what is needed. Sounds like rsync and a bit of study is in order. Thanks to all for the pointers. I really wanted to be a dumb user in all of this but it just doesn't work that way does it? I suppose that is what windoze is for.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.