[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Where is GRUB2's pointer to LVM LV / filesystem containing /boot?



On Mon, Nov 12, 2012 at 11:03 PM, Hendrik Boom <hendrik@topoi.pooq.com> wrote:
> On Mon, 28 May 2012 06:59:26 -0400, Tom H wrote:
>> On Sun, May 27, 2012 at 10:05 PM, Dan B. <danb@kempt.net> wrote:
>>>
>>> I think I want to move /boot to the RAID1 array I originally intended
>>> for it (so that booting into GRUB2 depends only on the /boot RAID1
>>> array, and not also on the integrity of my LVM volumes).
>>>
>>>
>>> After I copy/move /boot to the RAID1 array,
>>> 1. how do I tell GRUB2 to look in the new place? and 2. how do I see
>>> the setting in the bios_grub partition (or wherever)
>>>   to try to confirm that I got things right before I reboot and hope
>>>   GRUB2 and my system boot back up?
>>
>> It should be straightforward. Move "/boot" to a separate array, mount
>> it, add it to "/etc/fstab", run "grub-install /dev/sdX and "grub-install
>> /dev/sdY" where these two disks correspond to the raid components, run
>> "update-grub", and check that the UUID on the "set root ..." line in
>> "/boot/grub/grub.cfg" corresponds to the UUID of your new "/boot".
>>
>> (You can also check that the raid and lvm modules are loaded and that
>> the "root ..." argument points to the "/" lvm.)
>
> I've had no luck whatsoever with wheezy putting /boot on LVM on RAID.
> the new wheezy kernel seems to be too big for the usual boot tools.  Make
> sure you have a spare /boot elsewhere, just in case you end up needing it
> if your new one fails.

I've just downloaded the latest wheezy weekly and done an
lvm-over-raid install without a separate "/boot" in a VMWare VM:


~# fdisk -l /dev/sd{a,b}

Disk /dev/sda: 6442 MB, 6442450944 bytes
32 heads, 16 sectors/track, 24576 cylinders, total 12582912 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: 0x0007bb7e

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *        2048    12580863     6289408   fd  Linux raid autodetect

Disk /dev/sdb: 6442 MB, 6442450944 bytes
32 heads, 16 sectors/track, 24576 cylinders, total 12582912 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: 0x00086257

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1   *        2048    12580863     6289408   fd  Linux raid autodetect
~#
~#
~#
~#
~# mdadm --detail /dev/md0
/dev/md0:
        Version : 1.2
  Creation Time : Tue Nov 13 01:06:10 2012
     Raid Level : raid1
     Array Size : 6285248 (5.99 GiB 6.44 GB)
  Used Dev Size : 6285248 (5.99 GiB 6.44 GB)
   Raid Devices : 2
  Total Devices : 2
    Persistence : Superblock is persistent

    Update Time : Tue Nov 13 01:34:41 2012
          State : clean
 Active Devices : 2
Working Devices : 2
 Failed Devices : 0
  Spare Devices : 0

           Name : localhost:0  (local to host localhost)
           UUID : 94566063:7a6df36f:57bb0a39:7fce5b64
         Events : 19

    Number   Major   Minor   RaidDevice State
       0       8        1        0      active sync   /dev/sda1
       1       8       17        1      active sync   /dev/sdb1
~#
~#
~#
~#
~# pvs
  PV         VG     Fmt  Attr PSize PFree
  /dev/md0   sys-vg lvm2 a--  5.99g    0
~#
~#
~#
~#
~# vgs
  VG     #PV #LV #SN Attr   VSize VFree
  sys-vg   1   2   0 wz--n- 5.99g    0
~#
~#
~#
~#
~# lvs
  LV      VG     Attr     LSize   Pool Origin Data%  Move Log Copy%  Convert
  root-lv sys-vg -wi-ao--   5.27g
  swap-lv sys-vg -wi-ao-- 740.00m
~#
~#
~#
~#
~# findmnt
TARGET                    SOURCE                       FSTYPE     OPTIONS
/                         /dev/mapper/sys--vg-root--lv ext4
rw,relatime,errors=remount-ro,user_xattr,barrier=1,data=or
├─/sys                    sysfs                        sysfs
rw,nosuid,nodev,noexec,relatime
├─/proc                   proc                         proc
rw,nosuid,nodev,noexec,relatime
├─/dev                    udev                         devtmpfs
rw,relatime,size=10240k,nr_inodes=98153,mode=755
│ └─/dev/pts              devpts                       devpts
rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000
├─/run                    tmpfs                        tmpfs
rw,nosuid,noexec,relatime,size=79056k,mode=755
│ ├─/run/lock             tmpfs                        tmpfs
rw,nosuid,nodev,noexec,relatime,size=5120k
│ └─/run/shm              tmpfs                        tmpfs
rw,nosuid,nodev,noexec,relatime,size=158100k
└─/var/lib/nfs/rpc_pipefs rpc_pipefs                   rpc_pipefs rw,relatime
~#
~#
~#
~#
~# swapon -s
Filename				Type		Size	Used	Priority
/dev/mapper/sys--vg-swap--lv            partition	757756	0	-1
~#
~#
~#
~#
~# grub-install -v
grub-install (GRUB) 1.99-23
~#


Reply to: