FakeRAID + GPT + LVM on Wheezy

Help with issues regarding installation of Debian

FakeRAID + GPT + LVM on Wheezy

Postby Talz » 2014-07-17 04:42

This post is both a guide, and a request for suggestions to
improve the process.

Short Story:
I bought a new computer a while ago, which was the first
time I came across UEFI/GPT and FakeRAID, and I wanted
to get both to work with LVM on Wheezy. This is what I
came up with.

This guide is loosely based on this document:
https://wiki.debian.org/DebianInstaller/SataRaid

=================================================
My Setup:
=================================================
I have 2x250GB Samsung 840 EVO SSDs in RAID0 (FakeRAID)

My partition table looks like this:
Code: Select all
GPT fdisk (gdisk) version 0.8.5

Partition table scan:
  MBR: protective
  BSD: not present
  APM: not present
  GPT: present

Found valid GPT with protective MBR; using GPT.
Disk /dev/mapper/isw_dcddcgedij_Volume0: 976783872 sectors, 465.8 GiB
Logical sector size: 512 bytes
Disk identifier (GUID): C62D5FA3-E81E-4487-B54E-5E4DCABE2271
Partition table holds up to 128 entries
First usable sector is 34, last usable sector is 976783838
Partitions will be aligned on 2048-sector boundaries
Total free space is 2493 sectors (1.2 MiB)

Number  Start (sector)    End (sector)  Size       Code  Name
   1            2048          206847   100.0 MiB   EF00  EFI system partition
   2          206848          468991   128.0 MiB   0C01  Microsoft reserved part
   3          468992       477183999   227.3 GiB   0700  Basic data partition
   4       477184000       976783359   238.2 GiB   8E00  Deb_LVM

Note: While I have Windows 7 installed ("Basic data partition" from above),
I don't cover adding Windows to the grub bootloader for 2 reasons:
  • I haven't figured it out yet
  • Last time I tried (months ago), I failed, and now I know
    that's a whole different massive problem.
=================================================
PART 1 - Installing Debian, and configuring Grub:
=================================================

Note: My RAID0 device is called isw_dcddcgedij_Volume0.
Yours may be something else. You should easily be able to
identify it by checking your /dev/mapper/ directory. If yours
has a different name, replace anywhere where I use
isw_dcddcgedij_Volume0 with your device's name.

Also Note: While I use 2 DVD's below, you could probably
save some time by installing directly from the Live Debian 7 DVD.

You will need both:
  • Regular Debian 7 DVD
  • Live Debian 7 DVD
Instructions:
  • Boot from the Regular Debian 7 DVD until you get to the boot menu
  • Highlight the regular "Install" option, hit 'tab', and add:
    to the end of the line. Now boot into it
  • Install Debian. Setup LVM volumes the way you want
      Note: At the end, grub will ask you where to install. Even if you give it the
      proper RAID0 device (/dev/mapper/isw_dcddcgedij_Volume0), it will probably
      fail. Go on without a bootloader
    Note: At this point, you have an installed Debian 7 system that won't boot
  • Switch to the Debian 7 Live DVD and boot into it
  • Install dmraid:
  • Let dmraid find Raid0 and create the device in /dev/mapper:
  • Install parted
  • Run partprobe (comes with parted) to detect partitions on the Raid0 drive
      Code: Select all
      # partprobe /dev/mapper/isw_dcddcgedij_Volume0
  • Install lvm2
  • Let lvm scan for and activate volume groups
  • Chroot into installed debian:
      Code: Select all
         # mount /dev/mapper/vg0-lv_root /mnt
         # mount -o bind /dev /mnt/dev/
         # mount -o bind /proc /mnt/proc/
         # mount -o bind /sys /mnt/sys/
         # mount -o bind /dev/pts /mnt/dev/pts
         # chroot /mnt
            ### Delete old grub ###
               # apt-get purge grub-common
            ### Install EFI grub ###
               # apt-get install grub-efi-amd64
            ### Install grub to the Raid0 device ###
               # grub-install /dev/mapper/isw_dcddcgedij_Volume0
            ### Update grub menu ###
               # update-grub
            
=================================================
PART 2 - Getting partprobe into initramfs image:
=================================================

WHILE STILL IN THE CHROOT ENVIRONMENT FROM ABOVE:
  • Install parted to get partprobe tool
  • Copy 'partprobe' file (my attached file) to /usr/share/initramfs-tools/hooks/
    • Make sure the file has the same ownership/permissions as the
      other files in the hooks dir
  • Copy 'e-partprobe' file (my second attached file) to /usr/share/initramfs-tools/scripts/local-top/
    • Make sure the file has the same ownership/permissions as the
      other files in the local-top dir
  • Update initramfs
  • Exit chroot environment
  • Reboot
======================================
ADDITIONAL NOTES/THOUGHTS:
======================================

The article I linked to above tells you to use the Rescue mode from the Debian 7 DVD.
I found this to not work because the rescue mode does NOT have apt-get, which
prevented me from installing parted and using partprobe. Without it, all I
got under my /dev/mapper/ is the main RAID0 device (isw_dcddcgedij_Volume0)
and none of the partitions. Partprobe is the only way I have found to actually
have the system scan isw_dcddcgedij_Volume0 to find it's partitions, which
isn't possible in recovery mode. This is why I use a live environment instead.
Without partprobe, even the Debian 7 live environment had the same problem -
it couldn't see the partitions under the RAID0 device.

I read someone online say that the new Ubuntu (14.04) comes with mdadm that
can handle Intel FakeRAID, but Debian 7 comes with a much older mdadm, so I'm
pretty sure it doesn't yet support FakeRAID, which is why I went with dmraid.
Maybe one day I'll try the mdadm way to do this.

If you want a slightly cleaner solution, edit e-partprobe, and change the line that
reads:
Code: Select all
/sbin/partprobe 2>/dev/null

to read
Code: Select all
/sbin/partprobe /dev/mapper/isw_dcddcgedij_Volume0

where isw_dcddcgedij_Volume0 is your device name. If you don't know why this is
cleaner, you're probably better off leaving it alone.

=================================================
Request for Comments:
=================================================

The trouble appears to be caused either by GPT not being
supported by dmraid, or mkinitrd, as outlined here:
https://bugzilla.redhat.com/show_bug.cgi?id=500322
While this works, I want to know - is there a cleaner solution
for telling the system not to scan the disks for partitions before
dmraid creates the RAID0 device? Or if that's not possible, a way
to rerun the check for new partitions with native tools without
requiring a long process of copying partprobe (or kpartx) into
the initramfs image?
Attachments
partprobe_files.tar.gz
(443 Bytes) Downloaded 267 times
Talz
 
Posts: 7
Joined: 2014-07-17 01:58

Return to Installation

Who is online

Users browsing this forum: No registered users and 11 guests

fashionable