LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 12-22-2009, 06:24 PM   #1
cccc
Senior Member
 
Registered: Sep 2003
Distribution: Debian Squeeze / Wheezy
Posts: 1,623

Rep: Reputation: 51
Backup partition table


Hi

Howto backup and restore partition table under linux?
 
Old 12-22-2009, 07:15 PM   #2
allend
LQ 5k Club
 
Registered: Oct 2003
Location: Melbourne
Distribution: Slackware64-15.0
Posts: 6,350

Rep: Reputation: 2739Reputation: 2739Reputation: 2739Reputation: 2739Reputation: 2739Reputation: 2739Reputation: 2739Reputation: 2739Reputation: 2739Reputation: 2739Reputation: 2739
Use the 'dd' command.
http://www.linuxquestions.org/questi...command-362506

To be on the safe side, I suggest that you copy the entire first track of your drive, so that you also keep all the bootloader code.

If you install lilo, a copy of the Master Boot Record is kept in the /boot directory.
 
Old 12-22-2009, 07:25 PM   #3
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,099

Rep: Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117
I always worry when this question arises. WHY are you asking ?.
Backups are always good - using them isn't necessarily a good idea.

If you plan on modifying partition(s) - especially resizing, restoring a backup is probably the last thing you should do if you mess up.
dd is useless for logical partitions. I use "sfdisk -d ...", but I am very careful about what I subsequently do with it.
 
Old 12-22-2009, 07:25 PM   #4
cccc
Senior Member
 
Registered: Sep 2003
Distribution: Debian Squeeze / Wheezy
Posts: 1,623

Original Poster
Rep: Reputation: 51
Quote:
Originally Posted by allend View Post
Use the 'dd' command.
http://www.linuxquestions.org/questi...command-362506

To be on the safe side, I suggest that you copy the entire first track of your drive, so that you also keep all the bootloader code.

If you install lilo, a copy of the Master Boot Record is kept in the /boot directory.
You posted a wrong link!

Anyway:

BACKUP MBR + Partition Table:
Code:
# dd if=/dev/sda of=/save/mbr.bin bs=512 count=1
RESTORE Partition Table:
Code:
# dd if=/save/mbr.bin of=/dev/sda bs=1 count=64 skip=446 seek=446
 
Old 12-22-2009, 07:37 PM   #5
cccc
Senior Member
 
Registered: Sep 2003
Distribution: Debian Squeeze / Wheezy
Posts: 1,623

Original Poster
Rep: Reputation: 51
Quote:
Originally Posted by syg00 View Post
I always worry when this question arises. WHY are you asking ?.
Backups are always good - using them isn't necessarily a good idea.

If you plan on modifying partition(s) - especially resizing, restoring a backup is probably the last thing you should do if you mess up.
dd is useless for logical partitions. I use "sfdisk -d ...", but I am very careful about what I subsequently do with it.
I have a notebook with dual boot -> Vista and Debian.
If I setup 2 different systems on the same machine, after setup, normally I never try to change or resize partitions.
What I'm normally doing are security or OS updates.
Last time I had a virus and my Partition Table was distroyed.
It was really bad think, that I didn't done MBR and PT backup before.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
"No partition table or unknown signature on partition table" 10.1 install madcow007 Slackware 4 02-09-2009 11:04 AM
openSolaris hosed the partition table. Why? Changing primary to secondary partition? JZL240I-U Solaris / OpenSolaris 9 10-16-2008 10:48 AM
backup partition table twantrd *BSD 1 08-20-2005 07:01 PM
Slack 10: S-ATA = "No partition table or unknown signature on partition table"? dissolved soul Slackware - Installation 11 08-05-2004 02:12 PM
Why can't I restore a partition table backup containing a reiser partition? oldweasel Linux - Software 2 05-23-2004 12:11 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 01:48 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration