Software raid1 on Debian Wheezy 7.5

Discussion in 'HOWTO-Related Questions' started by dimas, Apr 29, 2014.

  1. dimas

    dimas Member

    Good day, I'm trying to set up a software raid on Debian Wheezy 7.5 as described in this howto (with modifications suggested for Wheezy in the comments):

    http://www.howtoforge.com/how-to-se...ystem-incl-grub2-configuration-debian-squeeze

    The problem is that during step 8 - Preparing GRUB2 (Part 2), when I take a look at /boot/grub/grub.cfg, I see the following:

    Code:
    ### BEGIN /etc/grub.d/10_linux ###
    menuentry 'Debian GNU/Linux, with Linux 3.2.0-4-amd64' --class debian --class gnu-linux --class gnu --class os {
    load_video
    insmod gzio
    insmod raid
    insmod mdraid1x
    insmod part_msdos
    insmod part_msdos
    insmod ext2
    set root='(mduuid/55008a4d218d5938c13b2cda87565b7e)'
    search --no-floppy --fs-uuid --set=root da150210-2441-4610-ae1b-48e489b129df
    echo 'Loading Linux 3.2.0-4-amd64 ...'
    linux /vmlinuz-3.2.0-4-amd64 root=/dev/md2 ro  quiet
    echo 'Loading initial ramdisk ...'
    initrd /initrd.img-3.2.0-4-amd64
    }
    
    There are 2 things that seem wrong to me. Firstly, the "insmod part_msdos" line is repeated 2 times. Secondly, and more importantly, the "set root" statement shows mduuid instead of (md/0).

    It appears that grub is not heeding that this line:

    Code:
    GRUB_DISABLE_LINUX_UUID="true"
    
    is uncommented in /etc/default/grub (I tried it both with and without quotes around "true", and of course running "update-grub" afterwards).

    After extensive reading, I have found the the cause is perhaps this line that gets generated:

    Code:
    search --no-floppy --fs-uuid --set=root da150210-2441-4610-ae1b-48e489b129df
    
    The only solution that I was able to find was to manually change /etc/grub.d/10_linux and /usr/lib/grub/grub-mkconfig_lib - but of course this means that these files will have to be manually changed after each update.

    So, my questions are:

    1. Is it possible to make grub generate labels instead of uuids without hacking the above files?

    2. If I decide for go for uuids instead of labels, what do I need to change? Only /etc/fstab and "set root" statement in /etc/grub.d/09_swraid1_setup? Nothing else?

    At the moment here's my situation.

    /etc/fstab:
    Code:
    /dev/md2 /       ext4    errors=remount-ro 0       1
    /dev/md0 /boot   ext4    defaults        0       2
    /dev/md1 none            swap    sw              0       0
    /dev/sr0        /media/cdrom0   udf,iso9660 user,noauto     0       0
    /dev/sdc1       /media/usb0     auto    rw,user,noauto  0       0
    
    Code:
    [email protected]:/etc# df -h
    Filesystem      Size  Used Avail Use% Mounted on
    rootfs          887G  872M  841G   1% /
    udev             10M     0   10M   0% /dev
    tmpfs           1.6G  320K  1.6G   1% /run
    /dev/md2        887G  872M  841G   1% /
    tmpfs           5.0M     0  5.0M   0% /run/lock
    tmpfs           9.1G     0  9.1G   0% /run/shm
    /dev/md0        938M   35M  856M   4% /boot
    
    Code:
    [email protected]:/etc# mount
    sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,relatime)
    proc on /proc type proc (rw,nosuid,nodev,noexec,relatime)
    udev on /dev type devtmpfs (rw,relatime,size=10240k,nr_inodes=2054732,mode=755)
    devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000)
    tmpfs on /run type tmpfs (rw,nosuid,noexec,relatime,size=1645036k,mode=755)
    /dev/md2 on / type ext4 (rw,relatime,errors=remount-ro,user_xattr,barrier=1,data=ordered)
    tmpfs on /run/lock type tmpfs (rw,nosuid,nodev,noexec,relatime,size=5120k)
    tmpfs on /run/shm type tmpfs (rw,nosuid,nodev,noexec,relatime,size=9536840k)
    /dev/md0 on /boot type ext4 (rw,relatime,user_xattr,barrier=1,data=ordered)
    rpc_pipefs on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw,relatime)
    
    Code:
    [email protected]:/etc# fdisk -l
    
    Disk /dev/sda: 1000.2 GB, 1000204886016 bytes
    255 heads, 63 sectors/track, 121601 cylinders, total 1953525168 sectors
    Units = sectors of 1 * 512 = 512 bytes
    Sector size (logical/physical): 512 bytes / 4096 bytes
    I/O size (minimum/optimal): 4096 bytes / 4096 bytes
    Disk identifier: 0x00020869
    
       Device Boot      Start         End      Blocks   Id  System
    /dev/sda1   *        2048     1953791      975872   fd  Linux raid autodetect
    /dev/sda2         1953792    64454655    31250432   fd  Linux raid autodetect
    /dev/sda3        64454656  1953523711   944534528   fd  Linux raid autodetect
    
    Disk /dev/sdb: 1000.2 GB, 1000204886016 bytes
    255 heads, 63 sectors/track, 121601 cylinders, total 1953525168 sectors
    Units = sectors of 1 * 512 = 512 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   *        2048     1953791      975872   fd  Linux raid autodetect
    /dev/sdb2         1953792    64454655    31250432   fd  Linux raid autodetect
    /dev/sdb3        64454656  1953523711   944534528   fd  Linux raid autodetect
    
    Disk /dev/md0: 998 MB, 998703104 bytes
    2 heads, 4 sectors/track, 243824 cylinders, total 1950592 sectors
    Units = sectors of 1 * 512 = 512 bytes
    Sector size (logical/physical): 512 bytes / 4096 bytes
    I/O size (minimum/optimal): 4096 bytes / 4096 bytes
    Disk identifier: 0x00000000
    
    Disk /dev/md0 doesn't contain a valid partition table
    
    Disk /dev/md1: 32.0 GB, 31983534080 bytes
    2 heads, 4 sectors/track, 7808480 cylinders, total 62467840 sectors
    Units = sectors of 1 * 512 = 512 bytes
    Sector size (logical/physical): 512 bytes / 4096 bytes
    I/O size (minimum/optimal): 4096 bytes / 4096 bytes
    Disk identifier: 0x00000000
    
    Disk /dev/md1 doesn't contain a valid partition table
    
    Disk /dev/md2: 967.1 GB, 967068942336 bytes
    2 heads, 4 sectors/track, 236100816 cylinders, total 1888806528 sectors
    Units = sectors of 1 * 512 = 512 bytes
    Sector size (logical/physical): 512 bytes / 4096 bytes
    I/O size (minimum/optimal): 4096 bytes / 4096 bytes
    Disk identifier: 0x00000000
    
    Disk /dev/md2 doesn't contain a valid partition table
    
    Code:
    [email protected]:/etc# cat /proc/mdstat
    Personalities : [raid1]
    md2 : active raid1 sda3[2] sdb3[1]
          944403264 blocks super 1.2 [2/2] [UU]
    
    md1 : active raid1 sda2[2] sdb2[1]
          31233920 blocks super 1.2 [2/2] [UU]
    
    md0 : active raid1 sda1[2] sdb1[1]
          975296 blocks super 1.2 [2/2] [UU]
    
    unused devices: <none>
    
    I'll greatly appreciate your help!
     

Share This Page