Linux advice?
Feb. 11th, 2009 09:41 amOkay, I have here on my desk an external hard drive big enough to copy my entire installation onto, rather than just backing up the data.
Questions, then:
1) Should I do this?
2) How do I do it?
3) Should I make it bootable, and if so, how?
4) What other questions should I be asking?
[En passant: it makes little buzzy-clicky noises, which are very quiet and discreet but none the less New Noises on the Desk, and I find myself very aware of them. That's probably a good thing. One should be aware of new toys, for at least a day or two. Hence all this how-can-I-use-it-best anxiety.]
Questions, then:
1) Should I do this?
2) How do I do it?
3) Should I make it bootable, and if so, how?
4) What other questions should I be asking?
[En passant: it makes little buzzy-clicky noises, which are very quiet and discreet but none the less New Noises on the Desk, and I find myself very aware of them. That's probably a good thing. One should be aware of new toys, for at least a day or two. Hence all this how-can-I-use-it-best anxiety.]
(no subject)
Date: 2009-02-11 10:20 am (UTC)Why not boot a live distribution from CD and then mount both your PC hard disk and your external hard disk and then copy (a) to (b) -- or (b) to (a) if you are recovering? I'm not a Linux expert: can you mount the source disk read-only? That would be a good idea to avoid changes in mid-flight.
(no subject)
Date: 2009-02-11 10:41 am (UTC)2) Can't give you Linux specifics, but ask Charlie Stross.
3) Ideally. What Kevin and I do (and we got this from Charlie) is make drive clones. So the backup drive is *exactly* like the live system, and in the event of a disaster we can just swap one for the other. Of course we mainly use laptops, and swapping drives is very easy with them. I'm not sure what you have.
4) How do I placate Murphy?
(no subject)
Date: 2009-02-11 11:55 am (UTC)2 and 3) You can copy one disk to the other as blocks rather than files using dd, so you get everything, though probably best to make a partition the same size as the disk you're copying from as any extra space would be lost otherwise. That should make the new disk as bootable as the old one, though I'm not 100% sure how the BIOS bootstrap, the disk's master boot record, and the partition's boot record all interact when you dd things: if it doesn't work first time use grub to make a multi-boot master boot record that does what you want.
On the question about mounting read only, yes, there's a ro parameter to the mount command, when using manually or in the /etc/fstab file. More generally, Unix always has a way of doing anything you should be doing. And several things you shouldn't.
(no subject)
Date: 2009-02-11 12:46 pm (UTC)If you put the copied installation into a partition it won't boot for lack of swap space, so you'd have to make a swap partition too, and tweak the copied installation to use it. More worsely, the two disks probably don't have the same name (e.g. /dev/sda2), so you'd have to tweak references to the disk name in the copy as well.
So by the time you've got the copy to be bootable, it won't be a copy, and wouldn't then work if you copied it back to the original. So not ideal as a backup really.
New plan: don't try to make it bootable, just make it a true backup copy.
E.g. boot from CD and use dd to block copy the old disk to the new one and put it in a drawer. When you need to restore, boot from CD and use dd to block copy it back. Don't do anything more complicated and then Nothing Can Go Wrong.
This will also copy and restore any Windows or DOS partitions and multi-boot support on the old disk as a side effect.
(no subject)
Date: 2009-02-11 01:01 pm (UTC)Hee. Of course I believe this...
Thank you. I shall devote a little skull-sweat to the syntax of dd, and pursue this option.
(no subject)
Date: 2009-02-11 08:25 pm (UTC)dd </olddisk | compress >/newdisk/filename.Z # tempting Providence
(no subject)
Date: 2009-02-11 08:44 pm (UTC)2) What specific Linux do you use? I think you should be able to find a tool that does this for you. I would investigate "gparted" which is useful for creating partitions and copying them. That may work for you. Take care. Backup everything first.http://gparted.sourceforge.net/
3) Well if it isnt bootable then that kind of destroys the point of copying everything over. Personally I try to keep the operating system separate from the data. If my computer dies I only restore the data - I would recreate the operating system from scratch - not backups.
4) Do you have a LiveCD - ie can you boot from a CD or DVD drive?
Your BIOS may or may not allow for booting off a USB device. Your external disk is USB, right?
(no subject)
Date: 2009-02-11 08:49 pm (UTC)