Mailinglist Archive: opensuse (1956 mails)
| < Previous | Next > |
Re: [opensuse] RE: Damaged Master Boot Record
- From: Jerry Feldman <gaf@xxxxxxx>
- Date: Sat, 4 Aug 2007 08:01:38 -0400
- Message-id: <20070804080138.062f254f@xxxxxxxxxxx>
On Sat, 04 Aug 2007 11:52:34 +1000
Registration Account <alpha096@xxxxxxxxxx> wrote:
> What I need are 2 things.
>
> 1. How do I dismount all the drives to run fsck at Xterm?
>
> 2. How do I use fdisk to re-write MBR from xterm?
>
>
> The second one might be difficult as there is plently
> of info on re-creating a LiLO MBR but not GRUB on the
> internet
The best way is to boot a rescue or disk or live CD, but...
Another way is to shutdown to single user mode. This should unmount all
but the root file system. You can always do a umount -a.
Make sure root is mounted read-only. (If I recall, in SuSE when
shutting down to single-user, it mounts read-only, but Fedora did not.
So, what I do is try to write to root, and if it fails I'm read-only.
The command to mount root readonly is:
mount -o remount,ro /
At this point you can run fsck.
I generally run fsck on a single partition at a time in this mode, but
you can also run multiples.
Probably the simplest way to fix the MBR is to go to YaST/System/Boot
Loader. Stepping through this, should cause the MBR to be rebuilt.
Another way is to use the grub(8) command. Check the grub info page:
info grub
There is a section "3.2 Installing GRUB natively"
This will also rewrite the MBR.
--
Jerry Feldman <gaf@xxxxxxx>
Boston Linux and Unix user group
http://www.blu.org PGP key id:C5061EA9
PGP Key fingerprint:053C 73EC 3AC1 5C44 3E14 9245 FB00 3ED5 C506 1EA9
Registration Account <alpha096@xxxxxxxxxx> wrote:
> What I need are 2 things.
>
> 1. How do I dismount all the drives to run fsck at Xterm?
>
> 2. How do I use fdisk to re-write MBR from xterm?
>
>
> The second one might be difficult as there is plently
> of info on re-creating a LiLO MBR but not GRUB on the
> internet
The best way is to boot a rescue or disk or live CD, but...
Another way is to shutdown to single user mode. This should unmount all
but the root file system. You can always do a umount -a.
Make sure root is mounted read-only. (If I recall, in SuSE when
shutting down to single-user, it mounts read-only, but Fedora did not.
So, what I do is try to write to root, and if it fails I'm read-only.
The command to mount root readonly is:
mount -o remount,ro /
At this point you can run fsck.
I generally run fsck on a single partition at a time in this mode, but
you can also run multiples.
Probably the simplest way to fix the MBR is to go to YaST/System/Boot
Loader. Stepping through this, should cause the MBR to be rebuilt.
Another way is to use the grub(8) command. Check the grub info page:
info grub
There is a section "3.2 Installing GRUB natively"
This will also rewrite the MBR.
--
Jerry Feldman <gaf@xxxxxxx>
Boston Linux and Unix user group
http://www.blu.org PGP key id:C5061EA9
PGP Key fingerprint:053C 73EC 3AC1 5C44 3E14 9245 FB00 3ED5 C506 1EA9
| < Previous | Next > |