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.
Ok, I have my linux installed and mostly how I like it. I would like to backup the entire thing so if say my hard drive dies, I can put in another drive, then boot to a backup and restore. What is the best way to do this? The thought of losing everything after putting so much work into it would be a nightmare..
hmmm that's a hard question to answer. Try making a hard drive image or somthing. I don't know what app you use, but I remember reading somthing a few years ago about making hardrive images. I forget what size they are but I think there's an app that lets you make several discs. You do realize that with today's huge hardrives it could take many cds or dvd to total back up a hardrive
The program that ur looking for is called Partimage
" Description: Partition Image is a Linux/UNIX utility which saves partitions in many formats (see below) to an image file. The image file can be compressed in the GZIP/BZIP2 formats to save disk space, and split into multiple files to be copied on removable floppies (ZIP for example), ... Partitions can be saved across the network since version 0.6.0.
"
You can also use the command line dd utillity. It comes with most distros. Check it out in the LQwiki. The LQwiki entry is a bit sparse, but I'll add to it when I'm more awake. You can pipe the results through gzip or whatever, make a multiple disc compressed archive, but I'd have to poke around in man pages to tell you how to do the multiple disc part.
Would this work if the two harddrives were unequal?
I mean, I'm planning on movng the entire content of a 30 gig drive, over to a 200 gig one, so I was just kinda wondering if that would pose a problem with the dd command.
If you used the dd command, you'd be left with a 30 gig partition on a 200 GB drive - I think. I've read of a "resize2fs" tool that could resize it upwards nondestructively (in theory! backup *first*!!!) (and this tool is destructive when resizing downwards) but I've never used it or seen it used.
Originally posted by crazyeddie740 If you used the dd command, you'd be left with a 30 gig partition on a 200 GB drive - I think. I've read of a "resize2fs" tool that could resize it upwards nondestructively (in theory! backup *first*!!!) (and this tool is destructive when resizing downwards) but I've never used it or seen it used.
Ah, I got the resizing covered, at least I THINK I do. I have a win98 partition there, which I run a program called "Partition Magic" from, I've used it one time earlier to resize my linux partitions and it worked mostly perfect.
So, the entire problem I have is, I want four partitions(one win98 partition, one ext2 and an extended partition containing one swap partition and another ext2) over to the 200 gig drive, with the bootrecord(I have BootMagic running on the MBR and lilo running on the root ext2 drive) and all, since the 30gig is to be used elsewhere. So basically, I want the 200 gig to be a mirror image of the 30 gig after the operation, then I'll just add/resize partitions as I see fit.
hmm....
I just got a "recomendation" from someone that I use "cp -a /dev/hda /dev/hdb"
Is this a good thing to do? If I have the proper bootdisks and such, that is.(Which I do have)
Well, I think that cp -a /dev/hda /dev/hdb should be just fine. The -a option preserves permissions as well as to do some other useful stuff for you. As far as needing boot disks is concerned...well this isnt voodoo magic. You are using the copy command. At the very worst your copy doesnt turn out well. My recommendation is to perform the copy and then (if you are comfortable with this) turn your computer off, unplug the power, and put the hdb drive in the hda ide slot. Effectively you have just replaced the hda with the hdb drive. Then try turning on your computer. If everything runs smoothly, you have successfully copied everything down to the MBR. (I hope.) As I havent done this myself, I cant guarantee.
I have always used a simple approach. I have a second HD and dump my root partition thus:-
cd /
tar -cvlzf /disk2/mydump.taz .
must be done as root.
I also copy these dumps to dvd from time to time.
To restore the system I boot up from a cd. There are several around to choose from.
I then remake a file system in my case:-
mkreiserfs /dev/hda2
then
mount -t reiserfs /dev/hda2 /mnt
mount -t reiserfs /dev/hdb1 /work
cd /mnt
tar -zxvf /work/mydump.taz
That should give the picture of how I do things here. I use RH 9.0 on reiserfs. I changed to reiserfs by dumping as described above changing the fs to reiser and then restoreing.
Hope this gives you some ideas
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.