HOWTO: Backup and Restore your partition table

From Sabayon Wiki
Jump to: navigation, search
i18n: en tr

Okay, so senario is that you wish to use the installer to install Gentoo...sounds simple right? Ever hear the ol' saying of "its not if you're going to lose data, but when?" Well...using the installer may just increase your chance of losing your paritition table and just stopping...so what's a n00b to do? Well just follow this and all your fears will be free!

So first off, we're going to boot up the dvd and plug in a removable hard drive (if you can and have enough ram, use the toram option to free up your cd/dvd writer for data storage). Open up Konqi and mount the removable hard drive by right clicking and selecting "Mount". Now double click on that and remember the location of that drive (something like /media/sd1 or something like that).

Now, depending on how many partitions you have, this could take a bit, but its a tried and true way of going about it. Mount all of your other partitions of the other hard drives and hope to god their not NTFS (NTFS partition table back up is still very experimental!).

Now open up a root terminal with the password "root" and type:


sfdisk -d /dev/hda > /media/sda1/hda-backup


Where /dev/hda is your mounted partition that you wish to back up and /media/sda1 is where your removable disk is, this can change. So for the rest of your partitions, just change /dev/hda to whichever parititions you have left to back up and make sure to give them unique names like "hdb-backup" etc, etc.

Now lets say you lost your parititions...before you start going all "oh the horror" on yourself...pat yourself on the back since you backed it up! So all you have to do is reboot, and remount your removalbe disk or cd/dvd wherever you saved your backup, and type:


cat hda-backup | sfdisk /dev/hda


From the above, I think you can get where this is going

Now, installed on the disk is also whole imageing programs that you can compress a 1gig partition down to 400megs! It sure does take awhile, but compressed backups are always nice to have in case we just loose a single partition or what. Again, NTFS is still experimental...so if you don't have something like Norton Ghost, be wary.... If you have norton ghost, go ahead and use the for your windows drive and burn it to disk, but us OSS enthusit, on to PARTIMAGE (which is so convientaly installed already for us Very Happy ) Now, go to a root terminal and type in partimage and you'll be greeted by a nice old looking text screen with all your paritions listed. Select the one you want to back up and make sure Save partition into a new image file is selected. Now if you're going to backup to a remote server, now is the time to type in the information. Now click next and make sure the parititon isn't mounted (you can do it by command line or going back to Storage Media and right clicking "Unmount". Now you have the option of which compression you would like (gzip works just fine but bzip2 for the uberspace enthusist) and most of the settings are okay by me, but if you would like to tweak, now is the time. Then click continue and burn that image to disk or wait for it to upload.

So to restore an image, use Norton Ghost for your Windows if you did that, or just boot back up partimage in the livedvd/cd, and select the "restore" option instead. Make sure you mounted any media or connected to the server that you have the image on. Tell it where the image is and then restore it.

And there you have it...no more complaining about losing partition tables or partitions information, you have the power to backup and save it all...the rest is up to you...."and knowing if half the battle!"

Christopher