LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Debian - Software Raid 1 and Grub issue (https://www.linuxquestions.org/questions/linux-newbie-8/debian-software-raid-1-and-grub-issue-4175425801/)

raksasas 09-05-2012 12:45 PM

Debian - Software Raid 1 and Grub issue
 
Hi there. Long time reader first time poster...

I have done basic installs of Fedora, Ubuntu, Linux Mint, and CentOS... But I am attempting something new. I am attempting to install Debian using the Software RAID (Raid 1). I have 2, 3 TB drives. I get through the initial setup of the , Hostname, Fully quilified domain name, root password, new user/password setup, and I get to the partioning and software raid configuration. I select manual set and create the paritions and software raid and assign EXT 4 and Swap. But when it gets to "Install the GRUB boot loader" part I get the following:

Quote:

Unable to install GRUB in /dev/sda
Executing 'grub-install /dev/sda' failed.

This is a fatal error.
I think I am messing up with the Prattioning and Software RAID setup. I create four prations on each drive.
Disk 1
1 GB - Physical volume for RAID
8.5 GB - Physical volume for RAID
50 GB - Physical volume for RAID
2.9 TB - Physical volume for RAID

Disk 2
1 GB - Physical volume for RAID
8.5 GB - Physical volume for RAID
50 GB - Physical volume for RAID
2.9 TB - Physical volume for RAID

I then create the following software Raid 1

1 GB - ext4 -/boot
8.5 GB - swap
50 GB - ext4 - /
2.9 TB ext4 - /home

With this setup I am getting the above error when GRUB is trying to install.
I read some where that the MBR doesn't like anything about 2 TB so I even made the /home just 2 TB just to see what may happen but I still get the same result.

Thanks for any help that you may be able to provide.

towheedm 09-06-2012 10:19 PM

For GRUB2 to work with RAID1, you must leave a 1MiB space between the MBR and the start of the first partition. This space is used for the core.img file. So, if your sector size is 512B, your first partition must start on sector 2048. This goes for both sda and sdb.

If the installation allows it, you must select both sda and sdb for the installation of GRUB2. It does not automatically install itself on both drives. If the installation does not allow it, then install GRUB2 on sda and after the installation of Squeeze is completed and you reboot, install GRUB2 on sdb:
Code:

grub-install /dev/sdb
Hope this helps.

raksasas 09-09-2012 03:39 PM

Question...

When doing the inital partitioning at the begining it is automaticly giving 1mb free the very front of the "1 GB - Physical volume for RAID" that I make. So am I neededing to create partitions like the following:

1mb - set to ???
1 GB - Physical volume for RAID
8.5 GB - Physical volume for RAID
50 GB - Physical volume for RAID
2.9 TB - Physical volume for RAID (aka. remaining space)

So it looks like: sda
1mb
1mb - set to ???
1 GB - Physical volume for RAID
8.5 GB - Physical volume for RAID
50 GB - Physical volume for RAID
2.9 TB - Physical volume for RAID (aka. remaining space)

Then do the same thing for sdb?

towheedm 09-09-2012 07:26 PM

Boot from the LiveCD and paste the output of:
Code:

fdisk -l /dev/sda /dev/sdb

suicidaleggroll 09-09-2012 08:07 PM

Quote:

Originally Posted by raksasas (Post 4773436)
I think I am messing up with the Prattioning and Software RAID setup. I create four prations on each drive.
Disk 1
1 GB - Physical volume for RAID
8.5 GB - Physical volume for RAID
50 GB - Physical volume for RAID
2.9 TB - Physical volume for RAID

Disk 2
1 GB - Physical volume for RAID
8.5 GB - Physical volume for RAID
50 GB - Physical volume for RAID
2.9 TB - Physical volume for RAID

I then create the following software Raid 1

1 GB - ext4 -/boot
8.5 GB - swap
50 GB - ext4 - /
2.9 TB ext4 - /home

So are you creating 4 RAID 1 arrays?

Personally, I make it a point to not install the OS on a RAID, at least not the same one that the rest of the partitions live on. The reason to split /home onto its own partition is to allow you to change the OS without affecting the contents of /home. However, if /home lives on the same RAID as /, that means that in order for you to use /home after the new OS install, you absolutely must set up the exact same RAID during the install of the new OS as you had before (IE: you must recover the existing RAID during the installation of the new OS). This is finicky to say the least, which is why I avoid it whenever possible.

raksasas 09-10-2012 09:57 AM

Here you go, towheedm.
Quote:

user@debian:~$ sudo fdisk -l /dev/sda /dev/sdb

WARNING: GPT (GUID Partition Table) detected on '/dev/sda'! The util fdisk doesn't support GPT. Use GNU Parted.


Disk /dev/sda: 3000.6 GB, 3000592982016 bytes
255 heads, 63 sectors/track, 364801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0x00000000

Device Boot Start End Blocks Id System
/dev/sda1 1 267350 2147483647+ ee GPT
Partition 1 does not start on physical sector boundary.

WARNING: GPT (GUID Partition Table) detected on '/dev/sdb'! The util fdisk doesn't support GPT. Use GNU Parted.


Disk /dev/sdb: 3000.6 GB, 3000592982016 bytes
255 heads, 63 sectors/track, 364801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0x00000000

Device Boot Start End Blocks Id System
/dev/sdb1 1 267350 2147483647+ ee GPT
Partition 1 does not start on physical sector boundary.

towheedm 09-10-2012 09:25 PM

Quote:

WARNING: GPT (GUID Partition Table) detected on '/dev/sda'! The util fdisk doesn't support GPT. Use GNU Parted.
As it says, you must use parted if you use GPT. Boot from the LiveCD and install it:
Code:

sudo apt-get install parted
And print the partition table:
Code:

sudo parted -l
Here's mine:
Code:

Model: ATA WDC WD800BB-75CA (scsi)
Disk /dev/sda: 80.0GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos

Number  Start  End    Size    Type    File system  Flags
 1      32.3kB  80.0GB  80.0GB  primary  ntfs        boot


Model: ATA ST3500418AS (scsi)
Disk /dev/sdb: 500GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos

Number  Start  End    Size    Type      File system    Flags
 1      1049kB  2000MB  1999MB  primary  ext4            boot, raid
 2      2001MB  500GB  498GB  extended
 5      2001MB  17.0GB  15.0GB  logical  ext4            raid
 6      17.0GB  37.0GB  20.0GB  logical  ext4            raid
12      314GB  400GB  85.9GB  logical  ext4
11      400GB  402GB  2146MB  logical                  raid
10      402GB  445GB  42.9GB  logical                  raid
 9      445GB  456GB  11.0GB  logical  ext4            raid
 8      456GB  499GB  42.9GB  logical
 7      499GB  500GB  1074MB  logical  linux-swap(v1)


Model: ATA ST3500418AS (scsi)
Disk /dev/sdc: 500GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos

Number  Start  End    Size    Type      File system    Flags
 1      1049kB  2000MB  1999MB  primary  ext4            boot, raid
 2      2001MB  500GB  498GB  extended
 5      2001MB  17.0GB  15.0GB  logical  ext4            raid
 6      17.0GB  37.0GB  20.0GB  logical  ext4            raid
12      37.0GB  120GB  83.5GB  logical  ext4
11      400GB  402GB  2146MB  logical                  raid
10      402GB  445GB  42.9GB  logical                  raid
 9      445GB  456GB  11.0GB  logical  ext4            raid
 8      456GB  499GB  42.9GB  logical
 7      499GB  500GB  1074MB  logical  linux-swap(v1)


Model: Linux Software RAID Array (md)
Disk /dev/md0: 1998MB
Sector size (logical/physical): 512B/512B
Partition Table: loop

Number  Start  End    Size    File system  Flags
 1      0.00B  1998MB  1998MB  ext4


Model: Linux Software RAID Array (md)
Disk /dev/md1: 30.0GB
Sector size (logical/physical): 512B/512B
Partition Table: loop

Number  Start  End    Size    File system  Flags
 1      0.00B  30.0GB  30.0GB  ext4


Model: Linux Software RAID Array (md)
Disk /dev/md2: 40.0GB
Sector size (logical/physical): 512B/512B
Partition Table: loop

Number  Start  End    Size    File system  Flags
 1      0.00B  40.0GB  40.0GB  ext4


Model: Linux Software RAID Array (md)
Disk /dev/md3: 85.9GB
Sector size (logical/physical): 512B/512B
Partition Table: loop

Number  Start  End    Size    File system  Flags
 1      0.00B  85.9GB  85.9GB  ext4


Model: Linux Software RAID Array (md)
Disk /dev/md4: 22.0GB
Sector size (logical/physical): 512B/512B
Partition Table: loop

Number  Start  End    Size    File system  Flags
 1      0.00B  22.0GB  22.0GB  ext4


Model: Linux Software RAID Array (md)
Disk /dev/md5: 42.9GB
Sector size (logical/physical): 512B/512B
Partition Table: loop

Number  Start  End    Size    File system  Flags
 1      0.00B  42.9GB  42.9GB  ext4


Model: Linux Software RAID Array (md)
Disk /dev/md6: 2145MB
Sector size (logical/physical): 512B/512B
Partition Table: loop

Number  Start  End    Size    File system  Flags
 1      0.00B  2145MB  2145MB  ext4

Partition 1 on both sdb and sdc are my /boot partitions, setup as RAID 1.

raksasas 09-11-2012 08:03 AM

Quote:

user@debian:~$ sudo parted -l
Model: ATA WDC WD30EZRX-00M (scsi)
Disk /dev/sda: 3001GB
Sector size (logical/physical): 512B/4096B
Partition Table: gpt

Number Start End Size File system Name Flags
1 1049kB 1000MB 999MB raid
2 1000MB 9500MB 8500MB raid
3 9500MB 59.5GB 50.0GB raid
4 59.5GB 3001GB 2941GB raid


Model: ATA WDC WD30EZRX-00M (scsi)
Disk /dev/sdb: 3001GB
Sector size (logical/physical): 512B/4096B
Partition Table: gpt

Number Start End Size File system Name Flags
1 1049kB 1000MB 999MB raid
2 1000MB 9500MB 8500MB raid
3 9500MB 59.5GB 50.0GB raid
4 59.5GB 3001GB 2941GB raid


Warning: Unable to open /dev/sr0 read-write (Read-only file system). /dev/sr0
has been opened read-only.
Error: Invalid partition table - recursive partition on /dev/sr0.
Ignore/Cancel? ignore
Model: TSSTcorp DVD+-RW TS-H653G (scsi)
Disk /dev/sr0: 1173MB
Sector size (logical/physical): 2048B/2048B
Partition Table: msdos

Number Start End Size Type File system Flags
it isn't showing the "md" that i made like it is yours.

towheedm 09-11-2012 09:29 PM

I think this is a problem with how GRUB2 and GPT works together. Have a look at these:

http://lists.debian.org/debian-user/.../msg00595.html
http://www.rodsbooks.com/gdisk/booting.html

raksasas 09-12-2012 01:43 PM

Quote:

Originally Posted by towheedm (Post 4778104)
I think this is a problem with how GRUB2 and GPT works together. Have a look at these:

http://lists.debian.org/debian-user/.../msg00595.html
http://www.rodsbooks.com/gdisk/booting.html

Okay... So how do I get my system up and running?
Use a knoppix disk to fix it? How?

towheedm 09-14-2012 09:16 PM

Well it all depends on if your machine is BIOS-based or EFI-based. I would start by carefully reading through http://www.rodsbooks.com/gdisk/booting.html including all of the links on that page. It has a lot of info on setting up GPT with GRUB2 on both BIOS and EFI machines.

I have never used EFI or GPT, so have no idea at this point how to directly solve this. So sorry for that.

raksasas 09-19-2012 04:49 PM

Okay. I figured it out... Basically you create when doing the partition section from the install. Create a 10mb partition on both drives and set the "Use Type" to "Reserved BIOS boot area" for it instead of "Physical volume for RAID". Once the install is done install grub on the other drive

and that is it. I kept trying to RAID the small partition which does not provide you with the "Resesrved BIOS Boot area" under the "use type"

cypher_zero 02-20-2013 08:00 AM

I'm currently having a similar issue. The 10mb partition you refer to, what is that formatted as or is it unformatted?

raksasas 02-20-2013 08:17 AM

You know, I don't know if it is formatted or formatted maybe someone else can explain what goes on with that 10mb partition. You make the 10mb partition when you are partitioning the drives followed by setting the flag on this partition to "Reserved BIOS boot area" instead of "Physical volume for RAID". The install does the rest...

Once logged into the system you have to add GRUB to the other drive since the install does not install GRUB on the other drive(s).

Hope this helps

cypher_zero 02-20-2013 10:33 AM

Yes, thanks! I was having some trouble getting it to set that flag; turns out that you need to have a GPT partition table (which you have to manually specify if you're creating the partitions in Gparted as I was). Then it should just be a simple matter of setting the bios_grub flag (which you can do with a right-click in Gparted).

I'm still finishing up the install, so I don't know if this has completely fixed my issue, but hopefully I'm at least 1 step closer to where I need to be.

If you're curious, I've described the full problem here:
http://www.linuxquestions.org/questi...08#post4895708


All times are GMT -5. The time now is 04:44 PM.