SEARCH

Enter your search query in the box above ^, or use the forum search tool.

You are not logged in.

#1 2012-10-23 17:26:40

beadmaze
#! Junkie
Registered: 2009-10-10
Posts: 325

[SOLVED] how to fix MBR?

well, ehm...

here's what i did:
i'm using my main machine with linux mint 13 maya (LVM-encrypted = 3 partitions - linux/extended/swap).
today i installed the latest #! testing (20121015-32bit-i686) from a live USB-drive to another USB-stick on my machine.
somewhere at the end it asked me to write Grub into the MBR as there seems to be no other OS - i thought, well, ok then, there's no other OS on this USB-stick that i'm installing to.
hmm, what a bad idea.

#! is running fine from this stick, i'm actually writing from within while it's doing it's cb-welcome-procedure.

BUT: my LM 13 maya installation does not boot anymore...
EDIT3: what Grub on my HDD tells me
it tells me that:

Grub Loading
Welcome to Grub!

error: no such device: a30d76a6-fb81-...
Entering rescue mode
grub rescue >  

i can't even access the HDD from #! as it is encrypted with LVM.
it's very important for me to get this original MBR restored or at least access to my internal HDD to be able to copy my files...

any hints tips or guesses?
what can i do?

EDIT: ytpo

EDIT2: here's the output of sudo fdisk -l

Disk /dev/sda: 250.1 GB, 250059350016 bytes
255 heads, 63 sectors/track, 30401 cylinders, total 488397168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x000e7f9f

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *        2048   482633727   241315840   83  Linux
/dev/sda2       482635774   488396799     2880513    5  Extended
/dev/sda5       482635776   488396799     2880512   82  Linux swap / Solaris

Disk /dev/sdb: 16.1 GB, 16064184320 bytes
255 heads, 63 sectors/track, 1953 cylinders, total 31375360 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x000ed08c

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1   *        2048    31375359    15686656   83  Linux

EDIT4: just realized this is the wrong thread as i'm using waldorf #! testing...
however, i found this link:
https://help.ubuntu.com/community/Grub2 … a_snapshot
where it tells me that my system is unbootable and:

You'll have to boot from a install medium and remove all snapshots that are in the same VG as your boot partition by hand.

well, ehm... if i'd be able to access my internal HDD (which i'm not atm) where do i find this snapshots?

Last edited by beadmaze (2012-10-24 19:28:52)


We are a nice, friendly community here and I hope we stay that way.

Offline

Help fund CrunchBang, donate to the project!

#2 2012-10-24 02:10:40

emiliolcc
Member
From: Rosario, Argentina
Registered: 2012-10-08
Posts: 32
Website

Re: [SOLVED] how to fix MBR?

Hi! You should try to get a live CD of any linux-based OS and re install grub (let me know if you need instructions, try Googling it first tongue). I had a similar issue a couple of years ago and pulled it off that way!

EMILIO!

Offline

#3 2012-10-24 02:36:15

gurtid
#! Junkie
From: NEW ZEALAND
Registered: 2011-04-07
Posts: 370

Re: [SOLVED] how to fix MBR?


all your Base are belong to us

Offline

#4 2012-10-24 10:28:47

beadmaze
#! Junkie
Registered: 2009-10-10
Posts: 325

Re: [SOLVED] how to fix MBR?

thanks emiliolcc, i'm able to use this machine with my installation of #! on that USB-stick, the problem is that i cannot access the encrypted partition to rescue my data.

@gurtid: yes, that's it, i guess. thanks a lot for this finding!
not sure actually if should start crossposting now... neutral


let me explain a bit more detailed (have been very nervous yesterday, so my initial posting might be a bit confusing):

- installed on this machine (no dual-boot, just 1 OS): Linux mint 13 maya with LVM = encrypted /home-partition
- LVM was chosen while installing mint13, not added afterwards
it actually has 3 partitions on sda:

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *        2048   482633727   241315840   83  Linux
/dev/sda2       482635774   488396799     2880513    5  Extended
/dev/sda5       482635776   488396799     2880512   82  Linux swap / Solaris

and everything worked as it should smile

- booted it from #!-live USB (created via dd) and installed #! onto another USB-stick
- at the end of this installation it asked whether to write/not write Grub into the MBR as there seemed to be no other OS on this device - i choosed

yes

i have two different USB-sticks with installed OSs on them to work with:
1. #! waldorf (20121015-32bit-i686)
2. Linux Mint Debian Edition

- i can't access my HDD from the #!-stick
- i'm able to access my HDD from the LMDE-stick, but i cannot access the encrypted /home-partition

how can i fix this?


We are a nice, friendly community here and I hope we stay that way.

Offline

#5 2012-10-24 10:40:07

el_koraco
#!/loony/bun
From: inside Ed
Registered: 2011-07-25
Posts: 4,654

Offline

#6 2012-10-24 10:44:13

xaos52
The Good Doctor
From: Planet of the @s
Registered: 2011-06-24
Posts: 4,493

Re: [SOLVED] how to fix MBR?

You need another OS with both LVM and Encryption installed and enabled.

I have no experience at all with encryption, but I do use LVM.

For LVM I think it is sufficient to have, in the rescue system
(1) LVM installed
(2) Rebuild the initrd file, so that LVM detection is available at boot.

I suspect the same applies to encryption.
You need the encryption 'tool' installed and available at boot.
User 'kbmonkey' published some posts recently on encryption. Perhaps those can help.

Another possibility is  to
(1) install the debootstrap package
(2) run it to a target directory of your choice
     See

for explanation.
(3) chroot into the target dir
(4) install lvm and encryption tools
(5) you should be able to mount your encrypted partition now.
(6) chroot into the mounted partition, and re-install GRUB to the MBR

Good Luck! Let us know how itwent or if you need more detail.

Offline

#7 2012-10-24 10:52:19

el_koraco
#!/loony/bun
From: inside Ed
Registered: 2011-07-25
Posts: 4,654

Re: [SOLVED] how to fix MBR?

He just needs to boot gmrl or Parted Magic and he should have access to everything.

Offline

#8 2012-10-24 13:31:34

xaos52
The Good Doctor
From: Planet of the @s
Registered: 2011-06-24
Posts: 4,493

Re: [SOLVED] how to fix MBR?

Right. smile

For a moment there I doubted that grml had it built in. Will have to run a 'memcheck' soon.

Offline

#9 2012-10-24 15:14:16

beadmaze
#! Junkie
Registered: 2009-10-10
Posts: 325

Re: [SOLVED] how to fix MBR?

ehm, pretty weird develpement here actually...

i was using #! from the USB-stick (installed onto USB) the whole day and fuzzled around with things, trying to download gmrl and putting it onto another USB-stick...
as i tried to reboot i suddenly saw linux mint 13 in Grub, next to the #! i was using the whole day...
so i thought: well then, c'mon ...
and i'm in it.
not really sure what happens when i rebooting again without the #!-stick on board, so i'm doing a complete backup now as i'm a happy camper, actually.

will mark this as solved when rebooting works flawlessly.

THANKS A BUNCH xaos & el_k and of course gurtid!!!
you saved my a**
smile)


We are a nice, friendly community here and I hope we stay that way.

Offline

#10 2012-10-24 19:26:39

beadmaze
#! Junkie
Registered: 2009-10-10
Posts: 325

Re: [SOLVED] how to fix MBR?

Ok, ok. it's solved! here's the full story:
i don't know why, but the HDD-installed linux mint appeared in Grub when i restarted #! on the USB-stick, so i could choose to boot into it.
Rebooting without #! still lead to

error: no such device: a30d76a6-fb81-...
Entering rescue mode
grub rescue >  

so when i was in LM13 i did what is explained here:
http://crunchbanglinux.org/forums/topic … br-grub-2/
especially the part which hhh contributes:

grub-install /dev/sda

and voila! i'm back in business!
everything seems to be alright.
wink

thanks once again for assistance!
it's always good to have #!crunchbang somewhere...
#yeah


We are a nice, friendly community here and I hope we stay that way.

Offline

#11 2012-10-24 20:06:10

GuruX
#! Die Hard
Registered: 2009-01-18
Posts: 527

Re: [SOLVED] how to fix MBR?

I have had this problem lots of times. I never chroot to fix it. I boot something (CB) on a usb stick. Then mount my HDD to /mnt. Then sudo grub-install --root-directory=/mnt/ /dev/sdX
Has worked this far for me.

Offline

#12 2013-02-04 22:34:14

poutinator
New Member
Registered: 2012-11-12
Posts: 4

Re: [SOLVED] how to fix MBR?

I had pretty much the same problem but it looked strange to me as the linux partition was installed in an extended one.

Here is the ouput of fdisk -l :

Disk /dev/sda: 320.1 GB, 320072933376 bytes
255 heads, 63 sectors/track, 38913 cylinders, total 625142448 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0xab170b12
tio
   Device Boot      Start         End      Blocks   Id  System
/dev/sda1            2048     3074047     1536000    7  HPFS/NTFS/exFAT
/dev/sda2         3074048   242195939   119560946    7  HPFS/NTFS/exFAT
/dev/sda3       448518735   625137344    88309305   83  Linux
/dev/sda4       242196478   448518143   103160833    5  Extended #this
/dev/sda5       242196480   448518143   103160832   83  Linux      #and this are the one i want to mount

Maybe i was naive and tried to mount the /dev/sed4 partition (from the file manager, and then was asked for a passphrase i never had to provide).
However, trying to mount the /dev/sda5 partition (with interesting things in) worked well.
Now i'm backing up all the data, i'll let you guy know if the grub-update thing works well.
(i do not think it will do so as some symlinks are broken ....)

Edit : Ok the older system boots well (even if it looked a bit unusual).
So in some cases it's not mandatory to mount partition in "inclusion order".

Last edited by poutinator (2013-02-04 22:45:54)

Offline

Board footer

Powered by FluxBB

Copyright © 2012 CrunchBang Linux.
Proudly powered by Debian. Hosted by Linode.
Debian is a registered trademark of Software in the Public Interest, Inc.

Debian Logo