Installed a new drive for my Software RAID1 in Linux but I cannot install grub on it
Hello everyone,
I am using Ubuntu 8.04 (32bit) and I am running a RAID1 array (sda,sdb). Anyway, I replaced /dev/sdb and created bigger partitions, the array was built and in sync after a few hours. Now, I tried to install grub as I read in the documentation and also tested this in a VM to simulate the RAID1 disk replacement. grub> root (hd1,0) grub> setup (hd1) In the documentation and on my tests this worked like a charm but on the real physical server I get "Error 15". It cannot find the stage1 in my server, so I tried grub-install and it worked with no errors but after running the bootscriptsinfo, I can see grub1 is installed in /dev/sdb but will try to boot from hd0 which is not good for me as I want to replace also /dev/sda (hd0). I have no idea why this didn't work for the real server. Any help appreciated, I haven't rebooted the server as it is working as a file server and I don't know if it is going to come up, so this weekend I am going to backup /home and reboot it. I also have the old hard drive, so I believe at any point I can actually boot from it and copy over the backup. Here is my bootscriptsinfo. --- Boot Info Script 0.61 [1 April 2012] ============================= Boot Info Summary: =============================== => Grub Legacy (v0.97) is installed in the MBR of /dev/sda and looks on the same drive in partition #1 for /boot/grub/stage2 and /boot/grub/menu.lst. => Grub Legacy (v0.97) is installed in the MBR of /dev/sdb and looks on boot drive #1 in partition #1 for /boot/grub/stage2 and /boot/grub/menu.lst. sda1: __________________________________________________________________________ File system: mdraid Boot sector type: - Boot sector info: Mounting failed: mount: unknown filesystem type 'mdraid' sda2: __________________________________________________________________________ File system: mdraid Boot sector type: - Boot sector info: Mounting failed: mount: unknown filesystem type 'mdraid' mount: unknown filesystem type 'mdraid' sda3: __________________________________________________________________________ File system: mdraid Boot sector type: - Boot sector info: Mounting failed: mount: unknown filesystem type 'mdraid' mount: unknown filesystem type 'mdraid' mount: unknown filesystem type 'mdraid' sdb1: __________________________________________________________________________ File system: mdraid Boot sector type: - Boot sector info: Mounting failed: mount: unknown filesystem type 'mdraid' mount: unknown filesystem type 'mdraid' mount: unknown filesystem type 'mdraid' mount: unknown filesystem type 'mdraid' sdb2: __________________________________________________________________________ File system: mdraid Boot sector type: - Boot sector info: Mounting failed: mount: unknown filesystem type 'mdraid' mount: unknown filesystem type 'mdraid' mount: unknown filesystem type 'mdraid' mount: unknown filesystem type 'mdraid' mount: unknown filesystem type 'mdraid' sdb3: __________________________________________________________________________ File system: mdraid Boot sector type: - Boot sector info: Mounting failed: mount: unknown filesystem type 'mdraid' mount: unknown filesystem type 'mdraid' mount: unknown filesystem type 'mdraid' mount: unknown filesystem type 'mdraid' mount: unknown filesystem type 'mdraid' mount: unknown filesystem type 'mdraid' sdb4: __________________________________________________________________________ File system: Boot sector type: - Boot sector info: Mounting failed: mount: unknown filesystem type 'mdraid' mount: unknown filesystem type 'mdraid' mount: unknown filesystem type 'mdraid' mount: unknown filesystem type 'mdraid' mount: unknown filesystem type 'mdraid' mount: unknown filesystem type 'mdraid' mount: unknown filesystem type '' md0: ___________________________________________________________________________ File system: ext3 Boot sector type: - Boot sector info: Operating System: Ubuntu 8.04.4 LTS Boot files: /boot/grub/menu.lst /etc/fstab md2: ___________________________________________________________________________ File system: swap Boot sector type: - Boot sector info: md1: ___________________________________________________________________________ File system: ext3 Boot sector type: - Boot sector info: Operating System: Boot files: ============================ Drive/Partition Info: ============================= Drive: sda _____________________________________________________________________ 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 Disk identifier: 0x000abbde Partition Boot Start Sector End Sector # of Sectors Id System /dev/sda1 * 32 62,500,863 62,500,832 fd Linux raid autodetect /dev/sda2 1,937,904,885 1,953,520,064 15,615,180 fd Linux raid autodetect /dev/sda3 62,500,864 1,937,899,519 1,875,398,656 fd Linux raid autodetect Drive: sdb _____________________________________________________________________ Disk /dev/sdb: 3000.5 GB, 3000592982016 bytes 255 heads, 63 sectors/track, 364801 cylinders, total 5860533168 sectors Units = sectors of 1 * 512 = 512 bytes Disk identifier: 0x00000000 Partition Boot Start Sector End Sector # of Sectors Id System /dev/sdb1 * 63 100,004,624 100,004,562 fd Linux raid autodetect /dev/sdb2 124,021,800 3,196,019,294 3,071,997,495 fd Linux raid autodetect /dev/sdb3 100,004,625 124,021,799 24,017,175 fd Linux raid autodetect /dev/sdb4 3,196,019,295 5,860,528,064 2,664,508,770 fd Linux raid autodetect "blkid" output: ________________________________________________________________ Device UUID TYPE LABEL /dev/md0 cbaa4b3c-ea50-4211-bb34-f65c55867997 ext3 /dev/md1 dbf487fb-8bbb-4ef6-bf34-efe086a9a98a ext3 /dev/md2 2627b650-1249-452f-8cf7-4357bde3f818 swap /dev/sda1 b4e71627-429d-ac7d-8350-1d5e21714c8a mdraid /dev/sda2 7bb36491-dd5e-7d58-db74-4fe8465c9f6f mdraid /dev/sda3 fb46a936-dcf0-2bd8-844f-fbe8892078dc mdraid /dev/sdb1 b4e71627-429d-ac7d-8350-1d5e21714c8a mdraid /dev/sdb2 fb46a936-dcf0-2bd8-844f-fbe8892078dc mdraid /dev/sdb3 7bb36491-dd5e-7d58-db74-4fe8465c9f6f mdraid ================================ Mount points: ================================= Device Mount_Point Type Options /dev/md0 / ext3 (rw,relatime,errors=remount-ro) /dev/md1 /home ext3 (rw,relatime) =========================== md0/boot/grub/menu.lst: ============================ -------------------------------------------------------------------------------- # menu.lst - See: grub(8), info grub, update-grub(8) # grub-install(8), grub-floppy(8), # grub-md5-crypt, /usr/share/doc/grub # and /usr/share/doc/grub-doc/. ## default num # Set the default entry to the entry number NUM. Numbering starts from 0, and # the entry number 0 is the default if the command is not used. # # You can specify 'saved' instead of a number. In this case, the default entry # is the entry saved with the command 'savedefault'. # WARNING: If you are using dmraid do not use 'savedefault' or your # array will desync and will not let you boot your system. default 0 ## timeout sec # Set a timeout, in SEC seconds, before automatically booting the default entry # (normally the first entry defined). timeout 3 ## hiddenmenu # Hides the menu by default (press ESC to see the menu) hiddenmenu # Pretty colours #color cyan/blue white/blue ## password ['--md5'] passwd # If used in the first section of a menu file, disable all interactive editing # control (menu entry editor and command-line) and entries protected by the # command 'lock' # e.g. password topsecret # password --md5 $1$gLhU0/$aW78kHK1QfV3P2b2znUoe/ # password topsecret # # examples # # title Windows 95/98/NT/2000 # root (hd0,0) # makeactive # chainloader +1 # # title Linux # root (hd0,1) # kernel /vmlinuz root=/dev/hda2 ro # # # Put static boot stanzas before and/or after AUTOMAGIC KERNEL LIST ### BEGIN AUTOMAGIC KERNELS LIST ## lines between the AUTOMAGIC KERNELS LIST markers will be modified ## by the debian update-grub script except for the default options below ## DO NOT UNCOMMENT THEM, Just edit them to your needs ## ## Start Default Options ## ## default kernel options ## default kernel options for automagic boot options ## If you want special options for specific kernels use kopt_x_y_z ## where x.y.z is kernel version. Minor versions can be omitted. ## e.g. kopt=root=/dev/hda1 ro ## kopt_2_6_8=root=/dev/hdc1 ro ## kopt_2_6_8_2_686=root=/dev/hdc2 ro # kopt=root=/dev/md0 ro ## Setup crashdump menu entries ## e.g. crashdump=1 # crashdump=0 ## default grub root device ## e.g. groot=(hd0,0) # groot=(hd0,0) ## should update-grub create alternative automagic boot options ## e.g. alternative=true ## alternative=false # alternative=true ## should update-grub lock alternative automagic boot options ## e.g. lockalternative=true ## lockalternative=false # lockalternative=false ## additional options to use with the default boot option, but not with the ## alternatives ## e.g. defoptions=vga=791 resume=/dev/hda5 # defoptions=quiet splash ## should update-grub lock old automagic boot options ## e.g. lockold=false ## lockold=true # lockold=false ## Xen hypervisor options to use with the default Xen boot option # xenhopt= ## Xen Linux kernel options to use with the default Xen boot option # xenkopt=console=tty0 ## altoption boot targets option ## multiple altoptions lines are allowed ## e.g. altoptions=(extra menu suffix) extra boot options ## altoptions=(recovery) single # altoptions=(recovery mode) single ## controls how many kernels should be put into the menu.lst ## only counts the first occurence of a kernel, not the ## alternative kernel options ## e.g. howmany=all ## howmany=7 # howmany=all ## should update-grub create memtest86 boot option ## e.g. memtest86=true ## memtest86=false # memtest86=true ## should update-grub adjust the value of the default booted system ## can be true or false # updatedefaultentry=false ## should update-grub add savedefault to the default options ## can be true or false # savedefault=false ## ## End Default Options ## title Ubuntu 8.04.4 LTS, kernel 2.6.24-31-server root (hd0,0) kernel /boot/vmlinuz-2.6.24-31-server root=/dev/md0 ro quiet splash initrd /boot/initrd.img-2.6.24-31-server quiet title Ubuntu 8.04.4 LTS, kernel 2.6.24-31-server (recovery mode) root (hd0,0) kernel /boot/vmlinuz-2.6.24-31-server root=/dev/md0 ro single initrd /boot/initrd.img-2.6.24-31-server title Ubuntu 8.04.4 LTS, kernel 2.6.24-29-server root (hd0,0) kernel /boot/vmlinuz-2.6.24-29-server root=/dev/md0 ro quiet splash initrd /boot/initrd.img-2.6.24-29-server quiet title Ubuntu 8.04.4 LTS, kernel 2.6.24-29-server (recovery mode) root (hd0,0) kernel /boot/vmlinuz-2.6.24-29-server root=/dev/md0 ro single initrd /boot/initrd.img-2.6.24-29-server title Ubuntu 8.04.4 LTS, kernel 2.6.24-28-server root (hd0,0) kernel /boot/vmlinuz-2.6.24-28-server root=/dev/md0 ro quiet splash initrd /boot/initrd.img-2.6.24-28-server quiet title Ubuntu 8.04.4 LTS, kernel 2.6.24-28-server (recovery mode) root (hd0,0) kernel /boot/vmlinuz-2.6.24-28-server root=/dev/md0 ro single initrd /boot/initrd.img-2.6.24-28-server title Ubuntu 8.04.4 LTS, kernel 2.6.24-23-server root (hd0,0) kernel /boot/vmlinuz-2.6.24-23-server root=/dev/md0 ro quiet splash initrd /boot/initrd.img-2.6.24-23-server quiet title Ubuntu 8.04.4 LTS, kernel 2.6.24-23-server (recovery mode) root (hd0,0) kernel /boot/vmlinuz-2.6.24-23-server root=/dev/md0 ro single initrd /boot/initrd.img-2.6.24-23-server title Ubuntu 8.04.4 LTS, memtest86+ root (hd0,0) kernel /boot/memtest86+.bin quiet ### END DEBIAN AUTOMAGIC KERNELS LIST -------------------------------------------------------------------------------- ================================ md0/etc/fstab: ================================ -------------------------------------------------------------------------------- # /etc/fstab: static file system information. # # <file system> <mount point> <type> <options> <dump> <pass> proc /proc proc defaults 0 0 # /dev/md0 UUID=cbaa4b3c-ea50-4211-bb34-f65c55867997 / ext3 relatime,errors=remount-ro 0 1 # /dev/md1 UUID=dbf487fb-8bbb-4ef6-bf34-efe086a9a98a /home ext3 relatime 0 2 # /dev/md2 UUID=2627b650-1249-452f-8cf7-4357bde3f818 none swap sw 0 0 /dev/scd0 /media/cdrom0 udf,iso9660 user,noauto,exec,utf8 0 0 /dev/scd0 /media/floppy0 auto rw,user,noauto,exec,utf8 0 0 # scanner files #//deimos.tsl.local/printer/scanfiles /home/samba/tsl/Scanner cifs username=printer,password=printer,uid=1003,gid=1009,file_mode=0660,dir_mode=0770 0 0 //192.168.0.8/Scan /home/samba/tsl/Scanner cifs password=,uid=1003,gid=1009,file_mode=0660,dir_mode=0770 0 0 -------------------------------------------------------------------------------- ==================== md0: Location of files loaded by Grub: ==================== GiB - GB File Fragment(s) ?? = ?? boot/grub/menu.lst ?? = ?? boot/grub/stage2 ?? = ?? boot/initrd.img-2.6.24-23-server ?? = ?? boot/initrd.img-2.6.24-23-server.bak ?? = ?? boot/initrd.img-2.6.24-28-server ?? = ?? boot/initrd.img-2.6.24-28-server.bak ?? = ?? boot/initrd.img-2.6.24-29-server ?? = ?? boot/initrd.img-2.6.24-29-server.bak ?? = ?? boot/initrd.img-2.6.24-31-server ?? = ?? boot/initrd.img-2.6.24-31-server.bak ?? = ?? boot/vmlinuz-2.6.24-23-server ?? = ?? boot/vmlinuz-2.6.24-28-server ?? = ?? boot/vmlinuz-2.6.24-29-server ?? = ?? boot/vmlinuz-2.6.24-31-server ?? = ?? initrd.img ?? = ?? initrd.img.old ?? = ?? vmlinuz ?? = ?? vmlinuz.old |
Look at the second example in the comments. It installs grub to both.
http://blog.bigsmoke.us/2009/06/21/i...-grub-on-raid1 You might consider having the initial partition being non-raid, and use /dev/sdb1 as a n identical clone. A regular or image backup of /boot as well will be a snap due to it's small size. |
Thanks for the reply.
Actually that's what I did in my tests and worked fine but if I try to do that with the new hard-drive, I get the Error 15 from Grub. :( |
Try booting from the grub menu after replacing sda' using sdb1 as the grub root. The grub menu has tab-completion. If you can find boot partition from the grub shell, you should be able to boot. If that doesn't work' boot from a cdrom, perform the steps you need after replacing sda, then you can boot from sda1 as normal.
I still prefer a normal /boot partition were possible. Just saying. |
All times are GMT -5. The time now is 03:46 AM. |