[nmglug] raid1 kernel crash

js at jasonschaefer.com js at jasonschaefer.com
Mon Oct 3 18:24:10 PDT 2005


I got it to boot. But now the partitions somehow became tiny. These are
80gb drives. Anyone have any in site into this?

Apparently, not adding the hda to the raid caused grub to read the
information from hda instead of the md and freaked. Even though I had
put the correct fstab and menu.lst in hda before rebooting:-( I also
encountered a problem with mdadm not assembling md1 and md2. Followed
the nifty command example in mdadm man.
# echo 'DEVICE /dev/hd*[0-9] /dev/sd*[0-9] > /etc/mdadm/mdadm.conf
# mdadm --detail --scan >> /etc/mdadm/mdadm.conf
Oh, you have to do this after assembling your raid partitions (mdadm -A
/dev/md? /dev/hda? /dev/hdb?)

Some reference of my current system:

# df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/md0              290M  290M     0 100% /
tmpfs                 122M     0  122M   0% /dev/shm
/dev/md2              4.2G   33M  3.9G   1% /home
/dev/md1              174M   66M  100M  40% /var

#cat /proc/mdstat
Personalities : [raid1]
md1 : active raid1 hda3[0] hdb3[1]
      183872 blocks [2/2] [UU]
     
md2 : active raid1 hda4[0] hdb4[1]
      4382208 blocks [2/2] [UU]
     
md3 : active raid1 hda1[0] hdb1[1]
      30592 blocks [2/2] [UU]
     
md0 : active raid1 hda2[0] hdb2[1]
      306368 blocks [2/2] [UU]
     
unused devices: <none>

# fdisk -l

Disk /dev/hda: 80.0 GB, 80026361856 bytes
255 heads, 63 sectors/track, 9729 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/hda1               1          61      489951   fd  Linux raid
autodetect
/dev/hda2   *          62         669     4883760   fd  Linux raid
autodetect
/dev/hda3             670        1034     2931862+  fd  Linux raid
autodetect
/dev/hda4            1035        9729    69842587+  fd  Linux raid
autodetect

Disk /dev/hdb: 80.0 GB, 80026361856 bytes
16 heads, 63 sectors/track, 155061 cylinders
Units = cylinders of 1008 * 512 = 516096 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/hdb1               1          61       30712+  fd  Linux raid
autodetect
/dev/hdb2   *          62         669      306432   fd  Linux raid
autodetect
/dev/hdb3             670        1034      183960   fd  Linux raid
autodetect
/dev/hdb4            1035        9729     4382280   fd  Linux raid
autodetect

Disk /dev/md0: 313 MB, 313720832 bytes
2 heads, 4 sectors/track, 76592 cylinders
Units = cylinders of 8 * 512 = 4096 bytes


Disk /dev/md3: 31 MB, 31326208 bytes
2 heads, 4 sectors/track, 7648 cylinders
Units = cylinders of 8 * 512 = 4096 bytes


Disk /dev/md2: 4487 MB, 4487380992 bytes
2 heads, 4 sectors/track, 1095552 cylinders
Units = cylinders of 8 * 512 = 4096 bytes


Disk /dev/md1: 188 MB, 188284928 bytes
2 heads, 4 sectors/track, 45968 cylinders
Units = cylinders of 8 * 512 = 4096 bytes




Ed Brown wrote:

>Not sure I'm following... are you saying you can boot using the second
>grub entry below?  Do you mean you want to be able to boot without
>manually adding hda to the md devices?
>
>Some more general ideas, (lacking a clear picture):
>Do you have a /etc/raidtab file, for maintaining the raid configuration
>between reboots?  /proc/mdstat has useful info about the state of
>things, before and after md commands.  To be able to boot from either
>drive, assuming a failure situation, you can install grub into the MBR
>of both drives.
>
>-Ed
>
>On Mon, 2005-10-03 at 16:35, js at jasonschaefer.com wrote:
>  
>
>>My OS is Debian 3.1r0a. I can boot into hda without raid. I can build
>>the raid with mdrun, currently it is still missing hda. I want it to
>>boot before adding hda to the raid.
>>
>>fstab:
>>proc            /proc               proc    defaults        0       0
>>/dev/md0       /                    ext3    defaults,errors=remount-ro
>>0       1
>>/dev/md2       /home           ext3    defaults         0       2
>>/dev/md1       /var               ext3    defaults         0       2
>>/dev/hda1       none            swap    sw,pri=1      0       0
>>/dev/hdb1       none            swap    sw,pri=1      0       0
>>
>>menu.lst:
>>title           Debian GNU/Linux, kernel 2.6.8-2-386
>>root            (hd0,1)
>>kernel          /boot/vmlinuz-2.6.8-2-386 root=/dev/md0
>>md=0,/dev/hda2,/dev/hdb2 ro
>>initrd          /boot/initrd.img-2.6.8-2-386
>>savedefault
>>boot
>>
>>title           Debian GNU/Linux, kernel 2.6.8-2-386 (recovery mode)
>>root            (hd0,1)
>>kernel          /boot/vmlinuz-2.6.8-2-386 root=/dev/md0 md=0,/dev/hdb2
>>ro singleinitrd          /boot/initrd.img-2.6.8-2-386
>>savedefault
>>boot
>>
>>
>>Edward F. Brown wrote:
>>
>>    
>>
>>>Jason,
>>>
>>>If you are still trying to solve this, can you add some details?  OS,
>>>grub.conf, fstab...  Can you still boot from hda only, or are you working
>>>on this from a rescue environment?
>>>
>>>-Ed
>>>
>>>
>>> 
>>>
>>>      
>>>
>>>>Hello
>>>>
>>>>I am at my ends wit! I am trying to setup a software raid1 on my entire
>>>>system, including boot and root.
>>>>
>>>>I keep getting a kernel panic
>>>>
>>>>pivot_root: No such file for directory
>>>>/sbin/init: 432: cannot open dev/console no such file
>>>>kernel panic: attempted to kill init!
>>>>
>>>>setup partitions on hdb to match hda, marked type fd (raid autodetect)
>>>>
>>>>mdadm --create /dev/md0 --raid-devices=2 --level=1 missing /dev/hdb2,3,4
>>>>etc.
>>>>
>>>>I then mkfs.ext3 /dev/md0,2,3 etc. and copied files from hda to
>>>>appropriate mda.
>>>>
>>>>Modified grub: root (hd0,1) and root=/dev/md0 md=0,/dev/hda2,/dev/hdb2
>>>>
>>>>changed /etc/fstab to be md instead of hd.
>>>>
>>>>I have setup /etc/mkinitrd/modules with various modules I think I may
>>>>need (not too sure what exactly I need)
>>>>
>>>>sis
>>>>sis5513
>>>>ide-core
>>>>ide-generic
>>>>ide-disk
>>>>md
>>>>raid1
>>>>
>>>>I rebuilt initrd with mkinitrd -o /boot/initrd.....
>>>>
>>>>Let me know if you see any fault with my method.
>>>>
>>>>-Jason
>>>>
>>>>
>>>>_______________________________________________
>>>>nmglug mailing list
>>>>nmglug at nmglug.org
>>>>http://www.nmglug.org/mailman/listinfo/nmglug
>>>>
>>>>   
>>>>
>>>>        
>>>>
>>>_______________________________________________
>>>nmglug mailing list
>>>nmglug at nmglug.org
>>>http://www.nmglug.org/mailman/listinfo/nmglug
>>>
>>> 
>>>
>>>      
>>>
>
>
>  
>




More information about the nmglug mailing list