Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

Previously I had a software raid set up using (mdadm) of drives sda and sdb. sdb failed and the only way to reboot the system was by unplugging the second hard drive.

Now I've added fresh sdb and sdc to my RAID setup. sda is the oldest (so most likely to fail) and it is the drive from which we boot (I think, how can I check?).

How can I ensure and test (through GRUB configuration, etc.) that if sda fails, I will still be able to boot my machine.

fdisk -l:

Disk /dev/sda: 250.0 GB, 250000000000 bytes
255 heads, 63 sectors/track, 30394 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000080

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1       30064   241489048+  fd  Linux raid autodetect
/dev/sda2           30065       30394     2650725    5  Extended
/dev/sda5           30065       30394     2650693+  fd  Linux raid autodetect

Disk /dev/sdb: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders
Units = cylinders of 16065 * 512 = 8225280 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   *           1       30064   241489048+  fd  Linux raid autodetect
Partition 1 does not start on physical sector boundary.
/dev/sdb2           30065       30394     2650725    5  Extended
/dev/sdb5           30065       30394     2650693+  fd  Linux raid autodetect
Partition 5 does not start on physical sector boundary.

Disk /dev/sdc: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders
Units = cylinders of 16065 * 512 = 8225280 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/sdc1   *           1       30064   241489048+  fd  Linux raid autodetect
Partition 1 does not start on physical sector boundary.
/dev/sdc2           30065       30394     2650725    5  Extended
/dev/sdc5           30065       30394     2650693+  fd  Linux raid autodetect
Partition 5 does not start on physical sector boundary.

Disk /dev/md0: 247.3 GB, 247284695040 bytes
2 heads, 4 sectors/track, 60372240 cylinders
Units = cylinders of 8 * 512 = 4096 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Alignment offset: 512 bytes
Disk identifier: 0x00000000

Disk /dev/md0 doesn't contain a valid partition table

Disk /dev/md1: 2714 MB, 2714238976 bytes
2 heads, 4 sectors/track, 662656 cylinders
Units = cylinders of 8 * 512 = 4096 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Alignment offset: 512 bytes
Disk identifier: 0x00000000

Disk /dev/md1 doesn't contain a valid partition table
share|improve this question

1 Answer 1

up vote 1 down vote accepted

You can not. Only unplugging sda will help in this case. In that case sdb will be sda... (braindead Linux device numbering - Solaris and HP-Unix use SCSI-IDs.)

So for the bootloader you should install it on sda and then copy it with dd to sdb and sdc.

share|improve this answer
    
So then as long as GRUB is set to boot from md0 and a bootloader is found on sdb, my system should boot? When I installed the two fresh drives, I copied the partition table and put both partitions in the appropriate arrays md0 and md1 (as per link). Are you saying I will still have to copy the bootloader manually on sdb and sdc? Is The bootloader not copied as a result of my RAID 1 setup? How can I check if it is? (Note: I'm not too familiar with bootloaders so I appreciate any advice) –  jpp Jul 22 '13 at 1:19
    
Forgive my ignorance, but I ran grub-install /dev/sdb and I am wondering if that's sufficient to install the bootloader. –  jpp Jul 22 '13 at 1:46
    
Note to any future readers, my RAID array disappeared after running grub-install as above so I'd recommend looking a bit more carefully... –  jpp Jul 27 '13 at 5:29
    
@user1850672 Are you sure your grub has an idea what md0 is? I doubt this, since that code resides in the kernel or the initrd - which comes AFTER grub. The UUID of your boot-md-device is normally passed as kernel-parameter. –  Nils Jul 27 '13 at 21:28
    
When I boot and select my kernel, the conf file is set to md0 and when I run it as such it says md0 does not exist. I can only boot directly from sda1 now. If you are more interested, I've recently asked other questions which give better characterizations of the problem. The consensus seems to be that my md0 is gone but it is still strangely showing up in mtab –  jpp Jul 28 '13 at 1:11

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.