LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
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 08-24-2012, 12:19 AM   #1
imayneed
Member
 
Registered: Jul 2012
Distribution: Arch, Kubuntu
Posts: 76

Rep: Reputation: Disabled
How to fix mbr in linux or gparted, etc. (for a mbr partitioned disk)


I am used to using gpt disks, therefore I was using gptsync to fix mbr.

I do not know if gptsync can fix mbr in mbr disks, which I think not.

I am wondering if there is any command that I can use like gptsync to fix mbr of mbr disks.

Code:
sudo gptsync /dev/sdX
has always solved my problems on gpt disks.
But I don't know what can solve my problems in mbr disks.

And gptsync works if there is any grub or not in the drive.
That is the kind of solution I am looking for, even if there is no grub, can mbr be updated?
In gpt disks, whenever I have a problem, I can easily delete the first 200 MB Protective Partition and run gptsync, and everything would be fine.
Is there any solution like this for MBR disks?

Thanks.

Last edited by imayneed; 08-24-2012 at 12:34 AM.
 
Old 08-26-2012, 09:37 AM   #2
schneidz
LQ Guru
 
Registered: May 2005
Location: boston, usa
Distribution: fedora-35
Posts: 5,313

Rep: Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918
there is grub-install. if you got a backup of the partition table this mite work:
Code:
dd if=mbr.bak of=/dev/sdb bs=512 count=1
 
Old 08-26-2012, 09:50 AM   #3
smallpond
Senior Member
 
Registered: Feb 2011
Location: Massachusetts, USA
Distribution: Fedora
Posts: 4,148

Rep: Reputation: 1264Reputation: 1264Reputation: 1264Reputation: 1264Reputation: 1264Reputation: 1264Reputation: 1264Reputation: 1264Reputation: 1264
Surely this can't be a common problem. What the heck are you doing that you need to recreate the mbr that often?

Anyway, the disk label can be written with parted. If you need a boot loader as well, then use grub-install.

gptsync creates a disk label (mbr partition table) from a gpt. If you don't have a gpt, and your mbr is corrupted, parted can find your partitions with "rescue" mode.
 
  


Reply



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
Using Linux's fdisk to erase or fix a MBR? Comatose51 Linux - Software 29 03-24-2014 05:31 PM
How to fix MBR Renu Shah Linux - Newbie 8 07-12-2012 04:04 PM
Gparted Error/HD Fix Ritzbitts Linux - General 7 01-01-2012 01:46 AM
can Knoppix fix the MBR for a Linux partition? joshknape Linux - Newbie 2 03-06-2006 11:38 PM
by tring to fix the MBR i damage the MBR that was help... AKAKAK Fedora 4 03-21-2005 08:18 AM

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

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