LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This 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


Reply
  Search this Thread
Old 03-01-2005, 09:32 PM   #1
sgzlit
LQ Newbie
 
Registered: Mar 2005
Posts: 13

Rep: Reputation: 0
How to backup & restore the MBR in linux?


I am searching a way to backup and restore the MBR of the disk in linux.
who has some good ideas to do it?
you are appreciatedto share your experience!

thx a lot
 
Old 03-01-2005, 09:35 PM   #2
Matir
LQ Guru
 
Registered: Nov 2004
Location: San Jose, CA
Distribution: Debian, Arch
Posts: 8,507

Rep: Reputation: 128Reputation: 128
For a pure backup:
Code:
dd if=/dev/hda of=BACKUPMBR bs=512 count=1
Obviously, replace /dev/hda with the appropriate device for your system.
 
Old 03-01-2005, 09:39 PM   #3
BajaNick
Senior Member
 
Registered: Jul 2003
Location: So. Cal.
Distribution: Slack 11
Posts: 1,737

Rep: Reputation: 46
Matir, Could you break down that line and tell us what each of those commands do? Thanks.
 
Old 03-01-2005, 09:57 PM   #4
Matir
LQ Guru
 
Registered: Nov 2004
Location: San Jose, CA
Distribution: Debian, Arch
Posts: 8,507

Rep: Reputation: 128Reputation: 128
Hehe, sure.
[code]dd if=/dev/hda of=BACKUPMBR bs=512 count=1[/count]
  • dd: program to perform bit-by-bit copying.
  • if: input file (or device) to read from
  • of: output file (or device) to write to
  • bs: block size, in bytes
  • count: number of blocks to read/write
This will copy the first 512 bytes of the /dev/hda (which is the Master Boot Record) to the file "BACKUPMBR".

Hope this helps.
 
Old 03-01-2005, 11:09 PM   #5
BajaNick
Senior Member
 
Registered: Jul 2003
Location: So. Cal.
Distribution: Slack 11
Posts: 1,737

Rep: Reputation: 46
Cool, Thanks.
 
Old 03-01-2005, 11:25 PM   #6
amosf
Senior Member
 
Registered: Jun 2004
Location: Australia
Distribution: Mandriva/Slack - KDE
Posts: 1,672

Rep: Reputation: 46
If you do a man dd you get lots of this cool info...
 
Old 03-02-2005, 09:33 AM   #7
Matir
LQ Guru
 
Registered: Nov 2004
Location: San Jose, CA
Distribution: Debian, Arch
Posts: 8,507

Rep: Reputation: 128Reputation: 128
You can do almost anything with dd! It even makes pancakes (ok, not really).

dd if=/dev/hda of=BACKUPMBR bs=512 count=1 means to copy 1 block of 512 bytes from /dev/hda to BACKUPMBR.

Hope that helps. The formatting was fun anyway.
 
Old 03-02-2005, 09:07 PM   #8
BajaNick
Senior Member
 
Registered: Jul 2003
Location: So. Cal.
Distribution: Slack 11
Posts: 1,737

Rep: Reputation: 46
Quote:
Originally posted by amosf
If you do a man dd you get lots of this cool info...
I did that right after the last post.
 
  


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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Backup & Restore Groups and Users jorasmi Slackware 2 03-28-2005 02:24 AM
MBR software or tools for backup/restore Rubedogg Linux - Newbie 1 12-08-2004 02:58 PM
Backup & Restore chaitu_iiit Linux - Software 2 10-30-2004 12:10 AM
Backup & Restore plan using tar markcasazza Linux - Newbie 1 04-14-2004 01:11 PM
Use of Dump & Restore Pkg For Backup byfaithalone Linux - Newbie 4 10-04-2003 09:04 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 03:29 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