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

lvm+raid1 boot disk: initrd/initramfs? howto?



Hi all,

Desperating that lvm will ever offer the 'encapsulation' of /boot in lvm like
hpux does), i am trying to install a more common lvm+raid1 boot disk with
following scheme:
boot disk will be build on raid1 + lv, i.e:
	o the / (aka root), /boot, swap will be purely raid1
	  (as recommended)

	o the rest /home, /var, /tmp will be in LVs over raid1
	  (to get benefit of resizing LVM facilities)

	  ps: raid1 base is still necessary because against announces
	      LVM is not yet able to manage its own raid1 stuff ;-(

Additional data (/Develop, /Sources, /DebApt, /MultiCd, ...) will stand
on LVs over a software raid5 array of 6*4Gb disk (i.e. 5 + 1 spare)

New Boot disk slicing:

# cfdisk /dev/sdc
                                  cfdisk 2.12p

                              Disk Drive: /dev/sdc
                        Size: 9104953344 bytes, 9104 MB
              Heads: 64   Sectors per Track: 32   Cylinders: 8683

    Name        Flags      Part Type  FS Type          [Label]        Size (MB)
 ------------------------------------------------------------------------------
    sdc1                    Primary   Linux/PA-RISC boot                  32.51
    sdc2                    Primary   Linux raid autodetect              132.13
    sdc3                    Primary   Linux raid autodetect              395.32
    sdc5                    Logical   Linux raid autodetect             2097.16
    sdc6                    Logical   Linux raid autodetect             6447.70


RAID1 md creation:

# mdadm --verbose --create --auto=md /dev/md/boot --level 1 --raid-devices=2
missing /dev/sdc2
# mdadm --verbose --create --auto=md /dev/md/swap --level 1 --raid-devices=2
missing /dev/sdc3
# mdadm --verbose --create --auto=md /dev/md/root --level 1 --raid-devices=2
missing /dev/sdc5
# mdadm --verbose --create --auto=md /dev/md/more_root --level 1
--raid-devices=2 missing /dev/sdc6

# mdadm --detail --scan
ARRAY /dev/md3 level=raid1 num-devices=2 UUID=5582e410:c46bda68:e41d50bc:80ce6ffa
ARRAY /dev/md2 level=raid1 num-devices=2 UUID=be276566:ca577e05:310f9b03:b6edb13a
ARRAY /dev/md1 level=raid1 num-devices=2 UUID=0e8ef8a9:93230c78:30dfa3c5:7033b63d
ARRAY /dev/md0 level=raid1 num-devices=2 UUID=28b23a65:5a30a02b:dc1d7564:0f051b08

# ll /dev/md/
total 26
drwxr-xr-x  2 root root  1024 Jan 25 17:55 .
drwxr-xr-x  8 root root 24576 Jan 25 17:40 ..
brw-------  1 root root  9, 0 Jan 25 16:18 boot
brw-------  1 root root  9, 3 Jan 25 17:43 more_root
brw-------  1 root root  9, 4 Jan 25 17:55 raid5
brw-------  1 root root  9, 2 Jan 25 16:17 root
brw-------  1 root root  9, 1 Jan 25 16:14 swap

# ll /dev/md[01234]
brw-rw----  1 root disk 9, 0 Jan 25 15:23 /dev/md0	<== boot
brw-rw----  1 root disk 9, 1 Jan 25 15:23 /dev/md1	<== swap
brw-rw----  1 root disk 9, 2 Jan 24 18:22 /dev/md2	<== root
brw-rw----  1 root disk 9, 3 Jan 25 15:23 /dev/md3	<== more_root
brw-rw----  1 root disk 9, 4 Jan 24 18:22 /dev/md4	<== raid5

LVM2 filter configuration
-------------------------

in /etc/lvm/lvm.conf

comment all filter and add a custom one to accept only /dev/md/*:

    # Custom: only /dev/md/* ;-)
    filter = [ "a|/dev/md/*|", "r/.*/" ]

# pvcreate /dev/md/more_root
  Physical volume "/dev/md/more_root" successfully created

# vgcreate vg00 /dev/md/more_root
  Volume group "vg00" successfully created

# lvcreate -L 512M -n /dev/vg00/lv_var
  Logical volume "lv_var" created

# lvcreate -L 128M -n /dev/vg00/lv_tmp
  Logical volume "lv_tmp" created

# lvcreate -L 128M -n /dev/vg00/lv_home
  Logical volume "lv_home" created

# for /usr/src
# lvcreate -L 2G -n /dev/vg00/lv_src
  Logical volume "lv_src" created

Creating FS (swap + ext3)
=========================

# mkswap /dev/md/swap

(why not activate it and check)

# swapon /dev/md/swap
# swapon -s

# mke2fs -j /dev/md/boot
# mke2fs -j /dev/md/root

# mke2fs -j /dev/vg00/lv_var
# mke2fs -j /dev/vg00/lv_tmp
# mke2fs -j /dev/vg00/lv_home
# mke2fs -j /dev/vg00/lv_src

Everything was mounted successfully and a copy of my running system is now
finished.

fwiw, the first boot (/dev still filled in without udev) seems to be ok ;-)

All could be very cool if I didn't have the idea to reboot it:
[...]
[42949435.320000] Freeing unused kernel memory: 336k freed
Failed to mount /selinux/: No such file or directory
INIT: version 2.86 booting
.udev/ already exists on the static /dev!
Starting the hotplug events dispatcher: udevd.
Synthesizing the initial hotplug events...done.
Waiting for /dev to be fully populated...done (timeout).
Will now activate swap.
swapon on /dev/md1
swapon: cannot stat /dev/md1: No such file or directory
Swap activation failed with error code 255.
Will now check root file system.
fsck 1.39-WIP (31-Dec-2005)
[/sbin/fsck.ext3 (1) -- /dev/shm/root] fsck.ext3 -a -C0 /dev/shm/root
/dev/shm/root: clean, 85969/256000 files, 327578/511968 blocks
Done checking root file system.
A log will be saved in /var/log/fsck/checkroot if that location is writable.
[42949544.230000] EXT3 FS on md2, internal journal
Setting the system clock:.
System Clock set. Local time: Fri Jan 27 15:58:48 UTC 2006.
Cleaning up ifupdown...done.
Not running depmod because /lib/modules/2.6.16-rc1-vs2.1.0.6.1-pa2-d32up/ is
not writeable.
Loading modules...
All modules loaded.
FATAL: Could not load
/lib/modules/2.6.16-rc1-vs2.1.0.6.1-pa2-d32up/modules.dep: No such file or
directory
Setting the system clock again:.
System Clock set. Local time: Fri Jan 27 15:58:50 UTC 2006.
Loading device-mapper support.
Starting raid devices: done.
Setting up LVM Volume Groups...
  Reading all physical volumes.  This may take a while...
  No volume groups found
  No volume groups found
  No volume groups found
Will now check all file systems.
fsck 1.39-WIP (31-Dec-2005)
Checking all file systems.
[/sbin/fsck.ext3 (1) -- /boot] fsck.ext3 -a -C0 /dev/md0
fsck.ext3: No such file or directory while trying to open /dev/md0
/dev/md0:
The superblock could not be read or does not describe a correct ext2
filesystem.  If the device is valid and it really contains an ext2
filesystem (and not swap or ufs or something else), then the superblock
is corrupt, and you might try running e2fsck with an alternate superblock:
    e2fsck -b 8193 <device>

[/sbin/fsck.ext3 (1) -- /var] fsck.ext3 -a -C0 /dev/vg00/lv_var
fsck.ext3: No such file or directory while trying to open /dev/vg00/lv_var
/dev/vg00/lv_var:
The superblock could not be read or does not describe a correct ext2
filesystem.  If the device is valid and it really contains an ext2
filesystem (and not swap or ufs or something else), then the superblock
is corrupt, and you might try running e2fsck with an alternate superblock:
    e2fsck -b 8193 <device>

[/sbin/fsck.ext3 (1) -- /tmp] fsck.ext3 -a -C0 /dev/vg00/lv_tmp
fsck.ext3: No such file or directory while trying to open /dev/vg00/lv_tmp
/dev/vg00/lv_tmp:
The superblock could not be read or does not describe a correct ext2
filesystem.  If the device is valid and it really contains an ext2
filesystem (and not swap or ufs or something else), then the superblock
is corrupt, and you might try running e2fsck with an alternate superblock:
    e2fsck -b 8193 <device>

[/sbin/fsck.ext3 (1) -- /home] fsck.ext3 -a -C0 /dev/vg00/lv_home
fsck.ext3: No such file or directory while trying to open /dev/vg00/lv_home
/dev/vg00/lv_home:
The superblock could not be read or does not describe a correct ext2
filesystem.  If the device is valid and it really contains an ext2
filesystem (and not swap or ufs or something else), then the superblock
is corrupt, and you might try running e2fsck with an alternate superblock:
    e2fsck -b 8193 <device>

[/sbin/fsck.ext3 (1) -- /usr/src] fsck.ext3 -a -C0 /dev/vg00/lv_src
fsck.ext3: No such file or directory while trying to open /dev/vg00/lv_src
/dev/vg00/lv_src:
The superblock could not be read or does not describe a correct ext2
filesystem.  If the device is valid and it really contains an ext2
filesystem (and not swap or ufs or something else), then the superblock
is corrupt, and you might try running e2fsck with an alternate superblock:
    e2fsck -b 8193 <device>

fsck died with exit status 8
File system check failed.
A log is being saved in /var/log/fsck/checkfs if that location is writable.
Please repair the file system manually.
A maintenance shell will now be started.
CONTROL-D will terminate this shell and resume system boot.
Give root password for maintenance
(or type Control-D to continue):
(DebianUnstable)root@(none):~# cat /proc/mdstat
Personalities : [linear] [raid0] [raid1] [raid5] [raid4]
md1 : active raid1 sdc3[1]
      385984 blocks [2/1] [_U]

md2 : active raid1 sdc5[1]
      2047872 blocks [2/1] [_U]

md3 : active raid1 sdc6[1]
      6296448 blocks [2/1] [_U]

md0 : active raid1 sdc2[1]
      128960 blocks [2/1] [_U]

unused devices: <none>
(DebianUnstable)root@(none):~# ll /dev/md0
ls: /dev/md0: No such file or directory
(
jso@iatst001:~$

Having no experience at all with this new udev env, I have a lot of questions:

    1/ which could be the reason why this 'Waiting for /dev to be fully
       populated...done (timeout).'

    2/ could it be the reason of next pbs (most probably)?

    3/ is it possible to continue to use the md mnemonics:
          /dev/md/boot
          /dev/md/swap
          /dev/md/root
          /dev/md/more_root

TIA for attetion,
    Joel

---------------------------------------------------------------
A free anti-spam and anti-virus filter on all Scarlet mailboxes
More info on http://www.scarlet.be/



Reply to: