Download your favorite Linux distribution at LQ ISO.
Go Back > Forums > Linux Forums > Linux - Software
User Name
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.


  Search this Thread
Old 12-20-2012, 02:37 PM   #1
Registered: Jan 2008
Posts: 35

Rep: Reputation: 2
Help! Upgraded remote server from Squeeze to Wheezy, grub install fails

Hi all, I have a remote server hosted by Hetzner over in Germany (I am in US), so I don't have console access. It has software RAID1 over two 3TB SATA drives. It came with Debian Squeeze by default, and I have to upgrade it to Wheezy, so I just went through that process with apt-get. Everything went well until it came time to install grub. It gave me four choices on where to install, namely something like (from memory):


It said if I didn't know which partition the machine was set to boot off, then it was probably safe to install on all of them, so I just checked all. It segfaulted and failed to install. So I unchecked the md entries, just so that the dist-upgrade could finish, and it succeeded... but I don't think that was right.

The apt-get dist-upgrade finished. Currently I am still running in the original kernel, not rebooted yet.

I know that with the big 3TB disks, it uses GPT rather than MBR - I became aware of this when Hetzner had to replace one of the RAID drives and I had to copy the partitions over to the new one, but I don't know what this means in terms of installing grub.

Apparently /boot is on /dev/md1, / is on /dev/md2 and /home is on /dev/md3.

I guess to summarize: Could anyone just lead me through the steps I need to do here in order to get a successful remote grub install on a GPT RAID1 system? When I finally come to reboot, I'd like the server to actually come up again...

Thanks very much,

Old 12-20-2012, 05:41 PM   #2
Registered: Jan 2008
Posts: 35

Original Poster
Rep: Reputation: 2
Update: I eventually found this page:

It talks specifically about installing Grub2 on RAID1 - namely, it seems like it's ok to do the grub-install on each of /dev/sda and /dev/sdb.

Then, separately I found that for GPT, you need to have a small partition that is not used for anything else, but is simply marked as "bios_grub". Using parted, I was able to confirm that this already exists on my system:

kitten:~# parted
GNU Parted 2.3
Using /dev/sda
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) p                                                                
Model: ATA ST33000650NS (scsi)
Disk /dev/sda: 3001GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt

Number  Start   End     Size    File system  Name  Flags
 5      1049kB  2097kB  1049kB                     bios_grub
 1      2097kB  34.4GB  34.4GB                     raid
 2      34.4GB  34.9GB  537MB                      raid
 3      34.9GB  1134GB  1100GB                     raid
 4      1134GB  3001GB  1866GB                     raid

So that was the other piece of the puzzle, which was already there so I didn't need to set bios_grub explicitly. One thing to be careful of here, apparently, is not to set bios_grub on your boot partition - it has to be a small, unused partition (can be anywhere, doesn't have to be at the beginning). The funny thing is that just today there was an update for grub2 which gave me an error on my other (main) server, which has Adaptec RAID. I just installed Wheezy on this machine. I didn't have any spare space (I had taken it all up with /boot, swap and root). So I had to create this bios_grub partition, what to do? Well, I did the following:

1. Use swapoff to disable swap partition, and comment it out of /etc/fstab
2. Use parted to delete the swap partition
3. Create a new small partition (I gave it 100MB)
4. Use parted to set bios_grub to "on" on the new partition (e.g. if the new partition number is 4, then you would put 'set 4 bios_grub on' in parted command line - make sure you have the partition number right!)
5. Create new swap partition with remaining space
6. mkswap on new swap partition
7. Add uuid of new swap partition back to /etc/fstab

Then I was able to do grub-install without error. Phew!

I got the info on how to use parted to enable bios_grub from here:

I don't know why this has to be so complicated, lots of people use RAID and GPT is common now with larger drives. I really had to hunt around to find this stuff. I'm just noting it down here in case it might be useful to anyone else (and also as a note to my future self).

1 members found this post helpful.


grub, raid1, upgrade

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
LXer: I upgraded from Debian Squeeze to Wheezy today LXer Syndicated Linux News 0 07-01-2012 04:40 AM
Grub will not install - Wheezy + RAID1- HELP PLEASE!!! debian newbie Linux - Server 1 02-25-2012 05:33 AM
[SOLVED] Upgraded from squeeze to wheezy. Hard disk list is backwards. misterpat Debian 4 02-12-2012 07:24 PM
[SOLVED] Upgraded to Wheezy; Now what with the repositories? feeblebrain Debian 7 08-09-2011 09:27 AM
[SOLVED] New Squeeze install fails to boot (not even to grub) jrdioko Debian 8 06-05-2011 12:50 PM > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 11:24 AM.

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