SOLVED: Software-RAID1 on sarge (AMD64) (was: Re: install-mbr on amd64?)
In the last few days, I was struggling to convert a remote machine with two identical SATA disks (sda and sdb) to a Software RAID 1. Especially the boot-part was tricky as I had no console access to the machine. The whole procedure was done remotely via SSH. I use the md tools (mdadm) and lilo as bootloader. I chose LILO because IMHO it's more straightforward in this setup than GRUB and I have no other Operating Systems I would want to boot. The system was installed on the first disk, the second one has not been used before. Those are the steps I went through: 1. Install a Software-RAID capable kernel and boot the system with it; Install the md tools: 'apt-get install mdadm'; 2. partition the second harddrive (sdb). I created two partitions, a large one at the beginning of the disk (sdb1) and a small swap-partition at the end (sdb2). I do not use separate /boot partitions. NOTE: I do not use two swap spaces on the two disks; instead, I create a RAID array consisting of the two smaller partitions on the two discs and create the swap space on it. In case of a disk failure, I don't need to reboot the system because the swap space is also on RAID. Otherwise, a disk failure would toast one swap space, probably leaving the system in a unusable state until rebooted. Important: both partitions need to be of the type 0xFD Linux raid autodetect 3. Create the RAID arrays: $ mdadm --create /dev/md0 --level=1 --raid-disks=2 missing /dev/sdb1 $ mdadm --create /dev/md1 --level=1 --raid-disks=2 missing /dev/sdb2 4. Create filesystems $ mkfs -t xfs /dev/md0 $ mkswap /dev/md1 I use XFS as filesystem because it has such nice features as online resizing etc and is, IMHO, very stable and mature. Of course you can use whatever you like. 5. Copy the existing Debian system to the new RAID $ mkdir -p /mnt/newroot $ mount /dev/md0 /mnt/newroot $ cd / $ find . -xdev | cpio -pm /mnt/newroot 6. To see if the the new RAID array comes up properly after a reboot, add the following line to /etc/fstab of the system still running from sda: /dev/md0 /mnt/newroot xfs defaults 0 0 Reboot and check with mount if /dev/md0 is mounted properly. 7. I now modified /etc/lilo.conf of the system still running from sda so that on the next reboot, /dev/md0 would be mounted as root filesystem while lilo would still access /boot on sda: # START /etc/lilo.conf lba32 delay=50 map=/boot/map boot=/dev/sda image=/boot/vmlinuz-2.6.16.18 label=RAID root=/dev/md0 read-only alias=1 image=/boot/vmlinuz-OLD label=LinuxOLD root=/dev/sda1 read-only alias=2 # END /etc/lilo.conf This way, we still have a working boot (LinuxOLD) which uses /dev/sda1 as root in case anything goes wrong (NOTE: sda1 is the root partition of the old, non-RAID system). 8. Run LILO First, run $ lilo -t -v to see what lilo would do. If everything is OK do: $ lilo -v $ lilo -v -R RAID This way, lilo chooses the image labeled RAID on the next reboot. On every subsequent reboot, the next entry will be used (so the image specified with -R gets used only one time). So if the system doesn't come up, you can reset it and lilo will boot the other image. 9. Edit the new fstab The new fstab, located at /mnt/newroot/etc/fstab, must now be changed so that /dev/md0 gets mounted as root filesystem: # START /mnt/newroot/etc/fstab /dev/md0 / xfs defaults0 0 /dev/md1 swapswap proc /proc proc # END /mnt/newroot/etc/fstab 10. Reboot the system. If it comes up, check with mount if /dev/md0 is mounted as root filesystem. If it doesn't come up properly, just reset the machine / reboot it and it will boot the other image. 11. Integrade sda into RAID array First, repartition sda exactly as sdb. The partitions must either be of the exact size or greater than those on sdb. Also, the partition type must be 0xFD. Then, integrate the partitions into the existing RAID array: $ mdadm --add /dev/md0 /dev/sda1 $ mdadm --add /dev/md1 /dev/sda2 Now the arrays are being synchronized. Check with $ watch cat /proc/mdstat that the sync proccess is running. You must wait for this process to complete on both arrays. 12. Modify lilo.conf Now we want to boot completely from /dev/md0: # START /etc/lilo.conf lba32 boot=/dev/md0 root=/dev/md0 install=/boot/boot-menu.b map=/boot/map prompt delay=50 timeout=50 vga=normal raid-extra-boot=/dev/sda,/dev/sdb default=RAID image=/boot/vmlinuz-2.6.16.18 label=RAID read-only root=/dev/md0 alias=1 image=/boot/vmlinuz-OLD label=LinuxOLD read-only
Re: install-mbr on amd64?
On Sat, May 20, 2006 at 09:28:07PM +0200, Goswin von Brederlow wrote: man grub-install: grub-install copies GRUB images into the DIR/boot directory specfied by --root-directory, and uses the grub shell to install grub into the boot sector. Your command line would install to /boot/boot/. grub-install --no-floppy /dev/md0 grub-install seems to have issues with seperate boot partitions. If you create a symlink inside boot called boot pointing to itself, then grub-install is fine with it. cd /boot; ln -s . boot With that there is no problem with grub on raid1 /boot. With boot in / on raid1 it just works. Len Sorensen -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Re: install-mbr on amd64?
On Sat, May 20, 2006 at 02:07:54AM +0200, Goswin von Brederlow wrote: Then pull a disk (the right one) and see it stop booting. From grub-install: # Usage: getraid_mdadm mddevice # Routine to find a physical device from an md device # If found, the first grub BIOS device (from device.map) is returned # If no BIOS drives match the RAID devices, the first device returned # from mdadm -D is returned Only one of your disks is bootable. By setting up each device in device.map in turn you get grub on each of them. I run grub-install /dev/sda and /dev/sdb, and both disks are perfectly bootable. I have tested this. Len Sorensen -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Re: install-mbr on amd64?
On Sat, May 20, 2006 at 02:09:27PM +0200, Alexander Sieck wrote: Goswin is right. I have installed etch on amd64 and configured RAID1, LVM and grub in d-i. # BEGIN-CLI deb64a:~# df Filesystem 1K-blocks Used Available Use% Mounted on /dev/md1 1829101189101 1542410 11% / /dev/md0 60093 19372 37515 35% /boot ... # END-CLI After the installation only the MBR on /dev/sda contains meaningful data, whereas the MBR on /dev/sdb contains mostly zeros. True. You have to install grub to both drives, and the installer only does it to one of them. Easily fixed manually. # BEGIN-CLI deb64a:~# dd if=/dev/sda bs=512 count=1 | od -v | head -n 12 1+0 records in 1+0 records out 512 bytes (512 B) copied, 2.2e-05 seconds, 23.3 MB/s 000 044353 150220 000274 175574 003520 017520 137374 076033 020 015677 050006 134527 000745 122363 136713 003676 002261 040 067070 076000 072411 101423 010305 172342 014315 172613 060 143203 044420 014564 026070 173164 132640 132007 001003 100 000377 02 01 00 001000 100372 100312 051752 120 000174 030400 107300 107330 136320 02 120373 076100 140 177474 001164 141210 137122 076571 032350 173001 100302 160 052164 040664 125273 146525 055023 071122 100511 052773 200 072652 120103 076101 140204 002565 160603 072001 063067 220 046213 137020 076005 042306 000777 105546 042036 143574 240 010004 143400 001104 01 104546 004134 042307 06 260 063160 140061 042211 063004 042211 132014 146502 071023 deb64a:~# dd if=/dev/sdb bs=512 count=1 | od -v | head -n 12 1+0 records in 1+0 records out 512 bytes (512 B) copied, 2.1e-05 seconds, 24.4 MB/s 000 134372 01 150216 000274 134260 00 154216 140216 020 137373 076000 000277 134406 001000 122363 020752 06 040 137000 003676 002070 005565 143203 100420 177376 072407 060 165763 132026 130002 135401 076000 100262 072212 105401 100 001114 011715 000352 000174 165400 000376 00 00 120 00 00 00 00 00 00 00 00 140 00 00 00 00 00 00 00 00 160 00 00 00 00 00 00 00 00 200 00 00 00 00 00 00 00 00 220 00 00 00 00 00 00 00 00 240 00 00 00 00 00 00 00 00 260 00 00 00 00 00 00 00 00 # END-CLI After running 'grub-install' on /dev/sdb, both MBRs, on /dev/sda and /dev/sdb, contain the right data. # BEGIN-CLI deb64a:~# grub-install --root-directory=/boot --no-floppy /dev/sdb Probing devices to guess BIOS drives. This may take a long time. Installation finished. No error reported. This is the contents of the device map /boot/boot/grub/device.map. Check if this is correct or not. If any of the lines is incorrect, fix it and re-run the script `grub-install'. (hd0) /dev/sda (hd1) /dev/sdb deb64a:~# dd if=/dev/sda bs=512 count=1 | od -v | head -n 12 1+0 records in 1+0 records out 512 bytes (512 B) copied, 0.000638 seconds, 803 kB/s 000 044353 150220 000274 175574 003520 017520 137374 076033 020 015677 050006 134527 000745 122363 136713 003676 002261 040 067070 076000 072411 101423 010305 172342 014315 172613 060 143203 044420 014564 026070 173164 132640 132007 001003 100 000377 02 01 00 001000 100372 100312 051752 120 000174 030400 107300 107330 136320 02 120373 076100 140 177474 001164 141210 137122 076571 032350 173001 100302 160 052164 040664 125273 146525 055023 071122 100511 052773 200 072652 120103 076101 140204 002565 160603 072001 063067 220 046213 137020 076005 042306 000777 105546 042036 143574 240 010004 143400 001104 01 104546 004134 042307 06 260 063160 140061 042211 063004 042211 132014 146502 071023 deb64a:~# dd if=/dev/sdb bs=512 count=1 | od -v | head -n 12 1+0 records in 1+0 records out 512 bytes (512 B) copied, 0.013082 seconds, 39.1 kB/s 000 044353 010220 150216 000274 134260 00 154216 140216 020 137373 076000 000277 134406 001000 122363 020752 06 040 137000 003676 002070 005565 143203 100420 177376 072407 060 165763 132026 130002 135401 076000 100262 072212 001003 100 000201 02 01 00 001000 110372 173220 100302 120 001165 100262 054752 000174 030400 107300 107330 136320 140 02 120373 076100 177474 001164 141210 137122 076577 160 032350 173001 100302 052164 040664 125273 146525 055023 200 071122 100511 052773 072652 120103 076101 140204 002565 220 160603 072001 063067 046213 137020 076005 042306 000777 240 105546 042036 143574 010004 143400 001104 01 104546 260 004134 042307 06 063160 140061 042211 063004 042211 # END-CLI I did not unplug or replugged the HDs, but I changed the HD boot
Re: install-mbr on amd64?
On Sat, May 20, 2006 at 09:38:16PM +0200, Goswin von Brederlow wrote: Alexander Sieck [EMAIL PROTECTED] writes: After running 'grub-install' on /dev/sdb, both MBRs, on /dev/sda and /dev/sdb, contain the right data. Some data but the right data? The two MBRs should be identical or not? Have you tried removing sda and boot or swap sda and sdb around and boot? (below I see you haven't fully tested that) Hello, maybe you got me wrong, since my wording was misleading. I think we agree on this: Without additional actions after configuring RAID1 and installing grub, the MBR on the 2nd disk contains mainly zeros. From this it looks like the 2nd drive is not bootable directly. How to make the 2nd disk bootable is still not fully clarified and a proof of the approach is still missing. Goswin wrote further up in this thread, that the 2nd disk can be made bootable by switching sda to sdb in /boot/grub/device.map and running grub-install. He could not remember, if additional changes to fstab or mtab were required. I tried to not change device.map, but just run # BEGIN-CLI deb64a:~# grub-install --no-floppy /dev/sdb # END-CLI The option --root-directory=/boot was wrong, since this creates /boot/boot/grub. After running grub-install on /dev/sdb the MBR of the 2nd drive /dev/sdb contains _some_ data. By just looking at the octal numbers I cannot tell, if it is really bootable. # BEGIN-CLI deb64a:~# grub-install --root-directory=/boot --no-floppy /dev/sdb Probing devices to guess BIOS drives. This may take a long time. Installation finished. No error reported. This is the contents of the device map /boot/boot/grub/device.map. Check if this is correct or not. If any of the lines is incorrect, fix it and re-run the script `grub-install'. (hd0) /dev/sda (hd1) /dev/sdb Lets interleave the data for comparision: deb64a:~# dd if=/dev/sda bs=512 count=1 | od -v | head -n 12 deb64a:~# dd if=/dev/sdb bs=512 count=1 | od -v | head -n 12 000 044353 150220 000274 175574 003520 017520 137374 076033 000 044353 010220 150216 000274 134260 00 154216 140216 020 015677 050006 134527 000745 122363 136713 003676 002261 020 137373 076000 000277 134406 001000 122363 020752 06 ... # END-CLI I as well had expected that the MBRs of both disks should be identical and do not know in the moment, if they need to be byte by byte identical. Now I have tested Goswins approach: # BEGIN-CLI deb64a:/boot/grub# cat device.map (hd0) /dev/sdb (hd1) /dev/sda deb64a:/boot/grub# grub-install --no-floppy /dev/sdb Installation finished. No error reported. This is the contents of the device map /boot/grub/device.map. Check if this is correct or not. If any of the lines is incorrect, fix it and re-run the script `grub-install'. (hd0) /dev/sdb (hd1) /dev/sda deb64a:/boot/grub# dd if=/dev/sda bs=512 count=1 | od -v | head -n 8 1+0 records in 1+0 records out 512 bytes (512 B) copied, 0.016311 seconds, 31.4 kB/s 000 044353 150220 000274 175574 003520 017520 137374 076033 020 015677 050006 134527 000745 122363 136713 003676 002261 040 067070 076000 072411 101423 010305 172342 014315 172613 060 143203 044420 014564 026070 173164 132640 132007 001003 100 000377 02 01 00 001000 100372 100312 051752 120 000174 030400 107300 107330 136320 02 120373 076100 140 177474 001164 141210 137122 076571 032350 173001 100302 160 052164 040664 125273 146525 055023 071122 100511 052773 deb64a:/boot/grub# dd if=/dev/sdb bs=512 count=1 | od -v | head -n 8 1+0 records in 1+0 records out 512 bytes (512 B) copied, 0.006904 seconds, 74.2 kB/s 000 044353 010220 150216 000274 134260 00 154216 140216 020 137373 076000 000277 134406 001000 122363 020752 06 040 137000 003676 002070 005565 143203 100420 177376 072407 060 165763 132026 130002 135401 076000 100262 072212 001003 100 000377 02 01 00 001000 110372 173220 100302 120 001165 100262 054752 000174 030400 107300 107330 136320 140 02 120373 076100 177474 001164 141210 137122 076577 160 032350 173001 100302 052164 040664 125273 146525 055023 # END-CLI That is, also after changing sda to sdb in device.map, the two MBRs are not identical. Maybe Goswin, or somebody else who enabled booting from both disks with RAID1 and grub, can give the output of 'dd if=xxx[ab] bs=512 count=1 | od' on their system. I did not unplug or replugged the HDs, but I changed the HD boot order in the BIOS, from IDE-channel2, -channel3 to IDE-channel3, -channel2, and can boot in both cases. Is that the same as removing a disk or does that preserve sda as hd0 and sdb as hd1 and just boot from hd1? I also think, that unplugging the 1st disk, is the only hard test (and even that may not be sufficient to simulate a real crash). Since the time I installed my system a couple of months ago, I would like to test, how much work it will be to recover from a
Re: install-mbr on amd64?
/dev/md0 /boot xfs defaults0 0 /dev/md1 noneswapswap /dev/md2 / xfs defaults0 0 /dev/md3 /home xfs defaults0 0 /dev/md4 /varxfs defaults0 0 /dev/md5 /var/logxfs defaults0 0 /dev/md6 /var/tmpxfs defaults0 0 /dev/md7 /tmpxfs defaults0 0 proc /proc proc Thanks very much for your time, I really appreciate the help I've gotten from all you guys so far very much! -- Kilian Can I once again suggest you to use ms-sys and do the following: # apt-get install ms-sys # ms-sys -s /dev/sda # ms-sys -s /dev/sdb Then mark in fdisk the /dev/md0 underlaying partitions as bootable. Reformat your /dev/md0 with ext3 filesystem as you can't install lilo in a xfs partition. Modify lilo.conf with boot=/dev/md0 root=/dev/md2 # lilo And your partitioning is too complex and you will get many problems in the future if you will want to change the size of any raid partition, so I suggest you to setup a large one raid array from md2-7 and put lvm on it. With a xfs filesystem you will get online resizing of partitions. -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Re: install-mbr on amd64?
Alexander Sieck [EMAIL PROTECTED] writes: That is, also after changing sda to sdb in device.map, the two MBRs are not identical. Maybe Goswin, or somebody else who enabled booting from both disks with RAID1 and grub, can give the output of 'dd if=xxx[ab] bs=512 count=1 | od' on their system. I just dded the mbr from sda to all raid devices making them identical the last time I installed. I did not unplug or replugged the HDs, but I changed the HD boot order in the BIOS, from IDE-channel2, -channel3 to IDE-channel3, -channel2, and can boot in both cases. Is that the same as removing a disk or does that preserve sda as hd0 and sdb as hd1 and just boot from hd1? I also think, that unplugging the 1st disk, is the only hard test (and even that may not be sufficient to simulate a real crash). If a disk fails the system should keep running. Thats the point of raid after all. So when you do reboot it will usualy be to replace the disk. So I'm not much concerned if the system is still bootable with a broken disk still connected. It is likely the bios won't like that at all no matter what the MBR looks like. Since the time I installed my system a couple of months ago, I would like to test, how much work it will be to recover from a disk-crash. So I am willing to test it the hard way by unplugging the 1st disk. But this might take some time. Before doing that, I will do a backup and figure out how to synchronize the RAID afterwards. Install qemu, install a base system with raid1 inside it, start qemu with just harddisk file. This sub-thread fits better to debian-user or debian-boot, since it is absolutely not related to amd64. Maybe there the chance is higher to get people involved which already tested booting from the 2nd disk. Maybe Goswin can report, if he unplugged it. Haven't rebooted once after installation yet. I will inform you after the unplug test, if I do not shoot in my own toe and mess up my system:-). It is my private machine and not a production server, therefore it is not really critical, but I do not want to spent too much time. Alexander MfG Goswin -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Re: install-mbr on amd64?
Hello, I now tested RAID1 together with grub by unplugging the 1st disk (to be sure, I tested with the 2nd as well). As you can read further up in this thread I did run 'grub-install --no-floppy /dev/sdb' to install the boot-loader in the MBR of the 2nd disk /dev/sdb. Then I halted the computer and unplugged the disk connected to the SATA0 port. The system booted without problem and /proc/mdstat displays only 1 active device in the RAID1: # BEGIN-CLI deb64a:~$ cat tmp/mdstat_unplug0.txt Personalities : [raid1] md3 : active raid1 sda6[1] 106896384 blocks [2/1] [_U] md2 : active raid1 sda5[1] 46877568 blocks [2/1] [_U] md1 : active raid1 sda2[1] 1951808 blocks [2/1] [_U] md0 : active raid1 sda1[1] 64128 blocks [2/1] [_U] unused devices: none # END-CLI After halting the system I plugged the SATA0 disk in again and booted. I had to hot add the sda? partitions to the RAID1 with mdadm: # BEGIN-CLI deb64a:~# mdadm /dev/md0 -a /dev/sda1 mdadm: hot added /dev/sda1 deb64a:~# mdadm /dev/md1 -a /dev/sda2 mdadm: hot added /dev/sda2 deb64a:~# mdadm /dev/md2 -a /dev/sda5 mdadm: hot added /dev/sda5 deb64a:~# mdadm /dev/md3 -a /dev/sda6 mdadm: hot added /dev/sda6 # END-CLI It takes about 40 min to rebuild the 100 GB /dev/md3. After that /proc/mdstat shows a clean RAID1: # BEGIN-CLI deb64a:# cat tmp/mdstat_ok.txt Personalities : [raid1] md3 : active raid1 sda6[0] sdb6[1] 106896384 blocks [2/2] [UU] md2 : active raid1 sda5[0] sdb5[1] 46877568 blocks [2/2] [UU] md1 : active raid1 sda2[0] sdb2[1] 1951808 blocks [2/2] [UU] md0 : active raid1 sda1[0] sdb1[1] 64128 blocks [2/2] [UU] unused devices: none # END-CLI Then I repeated the same, but this time I unplugged the disk connected to the SATA1 port. The system did boot without problems. Comparing the output of dmesg after unplugging SATA0 vs. SATA1 shows that I unplugged different disks each time: # BEGIN-CLI deb64a:~$ diff tmp/dmesg_unplug[01].txt | grep 'sd[ab]' # SCSI device sda: 312581808 512-byte hdwr sectors (160042 MB) # SCSI device sda: 312579695 512-byte hdwr sectors (160041 MB) # SCSI device sda: 312581808 512-byte hdwr sectors (160042 MB) # SCSI device sda: 312579695 512-byte hdwr sectors (160041 MB) # sd 1:0:0:0: Attached scsi disk sda # sd 0:0:0:0: Attached scsi disk sda # END-CLI Another proof is the output of mdadm -D /dev/md0' after the reboot with readded disk but before doing the hot add: # BEGIN-CLI deb64a:# cat tmp/mdadm_replug0.txt | tail -n 3 Number Major Minor RaidDevice State 0 00- removed 1 8 171 active sync /dev/sdb1 deb64a:# cat tmp/mdadm_replug1.txt | tail -n 3 Number Major Minor RaidDevice State 0 810 active sync /dev/sda1 1 00- removed # END-CLI As written before, the MBRs on /dev/sda and /dev/sdb are not identical. # BEGIN-CLI deb64a:~# dd if=/dev/sda bs=512 count=1 | od -v | head -n 8 1+0 records in 1+0 records out 512 bytes (512 B) copied, 2.1e-05 seconds, 24.4 MB/s 000 044353 150220 000274 175574 003520 017520 137374 076033 020 015677 050006 134527 000745 122363 136713 003676 002261 040 067070 076000 072411 101423 010305 172342 014315 172613 060 143203 044420 014564 026070 173164 132640 132007 001003 100 000377 02 01 00 001000 110372 173220 100302 120 001165 100262 054752 000174 030400 107300 107330 136320 140 02 120373 076100 177474 001164 141210 137122 076577 160 032350 173001 100302 052164 040664 125273 146525 055023 deb64a:~# dd if=/dev/sdb bs=512 count=1 | od -v | head -n 8 1+0 records in 1+0 records out 512 bytes (512 B) copied, 2.2e-05 seconds, 23.3 MB/s 000 044353 010220 150216 000274 134260 00 154216 140216 020 137373 076000 000277 134406 001000 122363 020752 06 040 137000 003676 002070 005565 143203 100420 177376 072407 060 165763 132026 130002 135401 076000 100262 072212 001003 100 000377 02 01 00 001000 110372 173220 100302 120 001165 100262 054752 000174 030400 107300 107330 136320 140 02 120373 076100 177474 001164 141210 137122 076577 160 032350 173001 100302 052164 040664 125273 146525 055023 # END-CLI On Sun, May 21, 2006 at 05:21:17PM +0200, Goswin von Brederlow wrote: Alexander Sieck [EMAIL PROTECTED] writes: That is, also after changing sda to sdb in device.map, the two MBRs are not identical. Maybe Goswin, or somebody else who enabled booting from both disks with RAID1 and grub, can give the output of 'dd if=xxx[ab] bs=512 count=1 | od' on their system. I just dded the mbr from sda to all raid devices making them identical the last time I installed. After knowing that both disks are bootable with non identical MBRs, now it would be interesting to see, whether dd'ing the MBR of the 1st disk to the other disks also works. I leave this test for somebody else:-) For the sake
Re: install-mbr on amd64?
On Sat, May 20, 2006 at 02:07:54AM +0200, Goswin von Brederlow wrote: On Fri, May 19, 2006 at 04:29:36PM +0200, Goswin von Brederlow wrote: You have to trick grub-install. Say /boot is on /dev/md0, a raid1 of /dev/sda1 and /dev/sdb1. Then you can put /dev/sda1 into devices.map, instal-grub, repeat for sdb1. You might have to change fstab and/or mtab as well. Can't remeber if that is truely needed. ... Then pull a disk (the right one) and see it stop booting. From grub-install: ... Only one of your disks is bootable. By setting up each device in device.map in turn you get grub on each of them. MfG Goswin Hello, Goswin is right. I have installed etch on amd64 and configured RAID1, LVM and grub in d-i. # BEGIN-CLI deb64a:~# df Filesystem 1K-blocks Used Available Use% Mounted on /dev/md1 1829101189101 1542410 11% / /dev/md0 60093 19372 37515 35% /boot ... # END-CLI After the installation only the MBR on /dev/sda contains meaningful data, whereas the MBR on /dev/sdb contains mostly zeros. # BEGIN-CLI deb64a:~# dd if=/dev/sda bs=512 count=1 | od -v | head -n 12 1+0 records in 1+0 records out 512 bytes (512 B) copied, 2.2e-05 seconds, 23.3 MB/s 000 044353 150220 000274 175574 003520 017520 137374 076033 020 015677 050006 134527 000745 122363 136713 003676 002261 040 067070 076000 072411 101423 010305 172342 014315 172613 060 143203 044420 014564 026070 173164 132640 132007 001003 100 000377 02 01 00 001000 100372 100312 051752 120 000174 030400 107300 107330 136320 02 120373 076100 140 177474 001164 141210 137122 076571 032350 173001 100302 160 052164 040664 125273 146525 055023 071122 100511 052773 200 072652 120103 076101 140204 002565 160603 072001 063067 220 046213 137020 076005 042306 000777 105546 042036 143574 240 010004 143400 001104 01 104546 004134 042307 06 260 063160 140061 042211 063004 042211 132014 146502 071023 deb64a:~# dd if=/dev/sdb bs=512 count=1 | od -v | head -n 12 1+0 records in 1+0 records out 512 bytes (512 B) copied, 2.1e-05 seconds, 24.4 MB/s 000 134372 01 150216 000274 134260 00 154216 140216 020 137373 076000 000277 134406 001000 122363 020752 06 040 137000 003676 002070 005565 143203 100420 177376 072407 060 165763 132026 130002 135401 076000 100262 072212 105401 100 001114 011715 000352 000174 165400 000376 00 00 120 00 00 00 00 00 00 00 00 140 00 00 00 00 00 00 00 00 160 00 00 00 00 00 00 00 00 200 00 00 00 00 00 00 00 00 220 00 00 00 00 00 00 00 00 240 00 00 00 00 00 00 00 00 260 00 00 00 00 00 00 00 00 # END-CLI After running 'grub-install' on /dev/sdb, both MBRs, on /dev/sda and /dev/sdb, contain the right data. # BEGIN-CLI deb64a:~# grub-install --root-directory=/boot --no-floppy /dev/sdb Probing devices to guess BIOS drives. This may take a long time. Installation finished. No error reported. This is the contents of the device map /boot/boot/grub/device.map. Check if this is correct or not. If any of the lines is incorrect, fix it and re-run the script `grub-install'. (hd0) /dev/sda (hd1) /dev/sdb deb64a:~# dd if=/dev/sda bs=512 count=1 | od -v | head -n 12 1+0 records in 1+0 records out 512 bytes (512 B) copied, 0.000638 seconds, 803 kB/s 000 044353 150220 000274 175574 003520 017520 137374 076033 020 015677 050006 134527 000745 122363 136713 003676 002261 040 067070 076000 072411 101423 010305 172342 014315 172613 060 143203 044420 014564 026070 173164 132640 132007 001003 100 000377 02 01 00 001000 100372 100312 051752 120 000174 030400 107300 107330 136320 02 120373 076100 140 177474 001164 141210 137122 076571 032350 173001 100302 160 052164 040664 125273 146525 055023 071122 100511 052773 200 072652 120103 076101 140204 002565 160603 072001 063067 220 046213 137020 076005 042306 000777 105546 042036 143574 240 010004 143400 001104 01 104546 004134 042307 06 260 063160 140061 042211 063004 042211 132014 146502 071023 deb64a:~# dd if=/dev/sdb bs=512 count=1 | od -v | head -n 12 1+0 records in 1+0 records out 512 bytes (512 B) copied, 0.013082 seconds, 39.1 kB/s 000 044353 010220 150216 000274 134260 00 154216 140216 020 137373 076000 000277 134406 001000 122363 020752 06 040 137000 003676 002070 005565 143203 100420 177376 072407 060 165763 132026 130002 135401 076000 100262 072212 001003 100 000201 02 01 00 001000 110372 173220 100302 120 001165 100262 054752 000174 030400 107300 107330 136320 140 02 120373 076100 177474 001164 141210 137122 076577 160 032350 173001 100302
Re: install-mbr on amd64?
Goswin von Brederlow wrote: Kilian [EMAIL PROTECTED] writes: Goswin von Brederlow wrote: [...] I went ahead and fixed mbr up for amd64. Apart from the obvious (Build-depends, gcc -m32) I also fixed up some of the more serious warnings and included running the testsuite as much as possible. The package compiles but someone has to risk his/her system and install the mbr now. Thanks a lot for your work! I'd be willing to do that, unfortunately it doesn't compile on my box; I get: Making all in harness make[1]: Entering directory `/usr/local/src/mbr-1.1.5.orig/harness' gcc -DPACKAGE=\mbr\ -DVERSION=\1.1.5\ -I. -I. -Wall -Wstrict-prototypes -Wmissing-prototypes -g -c bios.c Did you apply the patch? Here is what I did: $ apt-get source mbr $ tar xzvf mbr_1.1.5.orig.tar.gz $ cd mbr-1.1.5.orig $ zcat ../mbr_1.1.5-2.diff.gz | patch -p1 $ patch -p1 ../mbr-x86_64.patch # your patch $ ./configure $ make Both patches applied smoothly, no rejects at all. This should be gcc -m32 there. Without it it will create 64bit code which won't work. Hm. Should this flag '-m32' be in your patch? Because I don't find it there.. In file included from bios.c:2: vm86.h:4:22: asm/vm86.h: No such file or directory sh-3.1# cat /usr/include/asm/vm86.h /* All asm/ files are generated and point to the corresponding * file in asm-x86_64 or asm-i386. */ #ifdef __i386__ # include asm-i386/vm86.h #else # error This header is not available for x86_64 #endif $ cat /usr/include/asm/vm86.h cat: /usr/include/asm/vm86.h: No such file or directory sh-3.1# dpkg -S /usr/include/asm/vm86.h linux-kernel-headers: /usr/include/asm/vm86.h $ dpkg -S /usr/include/i386-linux/asm/vm86.h linux-kernel-headers: /usr/include/i386-linux/asm/vm86.h And you don't seem to be on sid. I don't have that file either on sarge so it won't work there. OK, does that mean that there is no reasonable way I can get mbr on sarge to compile? http://mrvn.homeip.net/mbr/mbr_1.1.5-2.1_amd64.deb This won't install here: $ dpkg -i mbr_1.1.5-2.1_amd64.deb (Reading database ... 18347 files and directories currently installed.) Preparing to replace mbr 1.1.5-2.1 (using mbr_1.1.5-2.1_amd64.deb) ... Unpacking replacement mbr ... dpkg: dependency problems prevent configuration of mbr: mbr depends on libc6-i386 (= 2.3.5-1); however: Package libc6-i386 is not installed. dpkg: error processing mbr (--install): dependency problems - leaving unconfigured Errors were encountered while processing: mbr And I can't install libc6-i386 on my system: Package libc6-i386 is not available, but is referred to by another package. This may mean that the package is missing, has been obsoleted, or is only available from another source E: Package libc6-i386 has no installation candidate I'm really stuck. Apparently lilo would be the best choice because it supports md-devices, right? But I can't use lilo because I don't have a working install-mbr. I would give grub a try, but I am not quite sure about the steps required for this. First off, the NEWS says that since 0.90 - 2001-07-11, Linux software RAID support is added (only for RAID-1). Well great, I have (or better want) a RAID-1. But everything I read about grub and RAID talks of sda/sdb or the like, not of mdX. Does grub support it, but not really, or what? Now, is it sufficient if I run grub-install --root-directory=/boot --no-floppy /dev/sda grub-install --root-directory=/boot --no-floppy /dev/sdb ? There exists no menu.lst, device.map or whatever on my system yet, do I have to manually set them up before running grub-install? If yes, how should they look like? I would figure device.map needs to state (hd0) /dev/sda (hd1) /dev/sdb But how does menu.lst have to look like? My fstab for the RAID system will look like this: /dev/md0 /boot xfs defaults0 0 /dev/md1 noneswapswap /dev/md2 / xfs defaults0 0 /dev/md3 /home xfs defaults0 0 /dev/md4 /varxfs defaults0 0 /dev/md5 /var/logxfs defaults0 0 /dev/md6 /var/tmpxfs defaults0 0 /dev/md7 /tmpxfs defaults0 0 proc /proc proc Thanks very much for your time, I really appreciate the help I've gotten from all you guys so far very much! -- Kilian -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Re: install-mbr on amd64?
Kilian [EMAIL PROTECTED] writes: Goswin von Brederlow wrote: Kilian [EMAIL PROTECTED] writes: Goswin von Brederlow wrote: [...] I went ahead and fixed mbr up for amd64. Apart from the obvious (Build-depends, gcc -m32) I also fixed up some of the more serious warnings and included running the testsuite as much as possible. The package compiles but someone has to risk his/her system and install the mbr now. Thanks a lot for your work! I'd be willing to do that, unfortunately it doesn't compile on my box; I get: Making all in harness make[1]: Entering directory `/usr/local/src/mbr-1.1.5.orig/harness' gcc -DPACKAGE=\mbr\ -DVERSION=\1.1.5\ -I. -I. -Wall -Wstrict-prototypes -Wmissing-prototypes -g -c bios.c Did you apply the patch? Here is what I did: $ apt-get source mbr $ tar xzvf mbr_1.1.5.orig.tar.gz $ cd mbr-1.1.5.orig $ zcat ../mbr_1.1.5-2.diff.gz | patch -p1 'apt-get source mbr' should already run dpkg-source -x on the dsc file to extract. Why do you have to untar and patch it manualy and why don't you use 'dpkg-source -x *dsc' for it? $ patch -p1 ../mbr-x86_64.patch # your patch $ ./configure $ make Both patches applied smoothly, no rejects at all. This should be gcc -m32 there. Without it it will create 64bit code which won't work. Hm. Should this flag '-m32' be in your patch? Because I don't find it there.. The patch includes this: | -CC = gcc | -CFLAGS = -g -Wall | +KERNEL_ARCH := $(shell uname -m) | + | +CC = gcc -m32 | +LD = ld -melf_i386 In file included from bios.c:2: vm86.h:4:22: asm/vm86.h: No such file or directory sh-3.1# cat /usr/include/asm/vm86.h /* All asm/ files are generated and point to the corresponding * file in asm-x86_64 or asm-i386. */ #ifdef __i386__ # include asm-i386/vm86.h #else # error This header is not available for x86_64 #endif $ cat /usr/include/asm/vm86.h cat: /usr/include/asm/vm86.h: No such file or directory sh-3.1# dpkg -S /usr/include/asm/vm86.h linux-kernel-headers: /usr/include/asm/vm86.h $ dpkg -S /usr/include/i386-linux/asm/vm86.h linux-kernel-headers: /usr/include/i386-linux/asm/vm86.h And you don't seem to be on sid. I don't have that file either on sarge so it won't work there. OK, does that mean that there is no reasonable way I can get mbr on sarge to compile? You need the sid linux-kernel-headers and also have to set CC = gcc-3.4 -m32. The Build-Depends need to change to ia32-libs-dev as well. http://mrvn.homeip.net/mbr/mbr_1.1.5-2.1_amd64.deb This won't install here: $ dpkg -i mbr_1.1.5-2.1_amd64.deb (Reading database ... 18347 files and directories currently installed.) Preparing to replace mbr 1.1.5-2.1 (using mbr_1.1.5-2.1_amd64.deb) ... Unpacking replacement mbr ... dpkg: dependency problems prevent configuration of mbr: mbr depends on libc6-i386 (= 2.3.5-1); however: Package libc6-i386 is not installed. dpkg: error processing mbr (--install): dependency problems - leaving unconfigured Errors were encountered while processing: mbr In sarge the 32bit libc6 is included in ia32-libs. For testing purposed you can --force-depends. And I can't install libc6-i386 on my system: Package libc6-i386 is not available, but is referred to by another package. This may mean that the package is missing, has been obsoleted, or is only available from another source E: Package libc6-i386 has no installation candidate I'm really stuck. Apparently lilo would be the best choice because it supports md-devices, right? But I can't use lilo because I don't have a working install-mbr. Lilo only suggests mbr. Why can't you use it to install lilo directly into the mbr? I would give grub a try, but I am not quite sure about the steps required for this. First off, the NEWS says that since 0.90 - 2001-07-11, Linux software RAID support is added (only for RAID-1). Well great, I have (or better want) a RAID-1. But everything I read about grub and RAID talks of sda/sdb or the like, not of mdX. Does grub support it, but not really, or what? Now, is it sufficient if I run grub-install --root-directory=/boot --no-floppy /dev/sda grub-install --root-directory=/boot --no-floppy /dev/sdb man grub-install: grub-install copies GRUB images into the DIR/boot directory specfied by --root-directory, and uses the grub shell to install grub into the boot sector. Your command line would install to /boot/boot/. grub-install --no-floppy /dev/md0 should be sufficient to boot but not to get failsave booting in case sda dies. It will only install on the first device mdadm -D lists for the raid and I assume this is sda. Running grub-install on the individual disks will also not result in a bootable sdb disk. As shown below your device.map lists sdb as second bios disk. But if sda fail sdb becomes the first bios disk and grub fails to find the second. You have to tell grub that sdb will be the first disk by putting (hd0) /dev/sdb into
Re: install-mbr on amd64?
Alexander Sieck [EMAIL PROTECTED] writes: After running 'grub-install' on /dev/sdb, both MBRs, on /dev/sda and /dev/sdb, contain the right data. Some data but the right data? The two MBRs should be identical or not? Have you tried removing sda and boot or swap sda and sdb around and boot? (below I see you haven't fully tested that) # BEGIN-CLI deb64a:~# grub-install --root-directory=/boot --no-floppy /dev/sdb Probing devices to guess BIOS drives. This may take a long time. Installation finished. No error reported. This is the contents of the device map /boot/boot/grub/device.map. Check if this is correct or not. If any of the lines is incorrect, fix it and re-run the script `grub-install'. (hd0) /dev/sda (hd1) /dev/sdb Lets interleave the data for comparision: deb64a:~# dd if=/dev/sda bs=512 count=1 | od -v | head -n 12 deb64a:~# dd if=/dev/sdb bs=512 count=1 | od -v | head -n 12 000 044353 150220 000274 175574 003520 017520 137374 076033 000 044353 010220 150216 000274 134260 00 154216 140216 020 015677 050006 134527 000745 122363 136713 003676 002261 020 137373 076000 000277 134406 001000 122363 020752 06 040 067070 076000 072411 101423 010305 172342 014315 172613 040 137000 003676 002070 005565 143203 100420 177376 072407 060 143203 044420 014564 026070 173164 132640 132007 001003 060 165763 132026 130002 135401 076000 100262 072212 001003 100 000201 02 01 00 001000 110372 173220 100302 100 000377 02 01 00 001000 100372 100312 051752 120 000174 030400 107300 107330 136320 02 120373 076100 120 001165 100262 054752 000174 030400 107300 107330 136320 140 02 120373 076100 177474 001164 141210 137122 076577 140 177474 001164 141210 137122 076571 032350 173001 100302 160 032350 173001 100302 052164 040664 125273 146525 055023 160 052164 040664 125273 146525 055023 071122 100511 052773 200 071122 100511 052773 072652 120103 076101 140204 002565 200 072652 120103 076101 140204 002565 160603 072001 063067 220 046213 137020 076005 042306 000777 105546 042036 143574 220 160603 072001 063067 046213 137020 076005 042306 000777 240 010004 143400 001104 01 104546 004134 042307 06 240 105546 042036 143574 010004 143400 001104 01 104546 260 004134 042307 06 063160 140061 042211 063004 042211 260 063160 140061 042211 063004 042211 132014 146502 071023 # END-CLI I did not unplug or replugged the HDs, but I changed the HD boot order in the BIOS, from IDE-channel2, -channel3 to IDE-channel3, -channel2, and can boot in both cases. Is that the same as removing a disk or does that preserve sda as hd0 and sdb as hd1 and just boot from hd1? I think this prooves that grub does not work out of the box with RAID1 as many might expect, but that it is quite easy to enable booting from both HDs. It is rudimentary but needs improving imho. Even if the MBR is missing on the 2nd drive and the 1st drive crashes, one can still install the MBR on the 2nd drive with a rescue CD. Unfortunately every time you run into such a problem you just can't seem to find that rescue CD. :( Alexander MfG Goswin -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Re: install-mbr on amd64?
Hi! I use ms-sys with -s option just a week ago in simular situation. As far as I know, you can't indicate grub to load from /dev/md0, only lilo can do this. And there is no need to recompile the kernel, the debian distributed kernel with the yaird as initrd creator can load the system in your situation. Thanks a lot for your reply! I'm using lilo as bootloader, but as grub is way more modern, I might just switch to grub. The thing is, the machine I'm working on is remote and I have no console access, so everything is a bit tricky. It's already running, has two identical SATA disks, the second one (sdb) is not used. What I want to do is create a RAID 1 array with only sdb (but with the possibility to add sda later). Then I boot from this new RAID array, repartition sda and add it to the RAID array. I've gotten so far as setting up the RAID array, chrooting into it and bootstrap a Debian system on it, compile an new kernel, but when it comes to set up bootloaders, the howto I'm using http://juerd.nl/site.plp/debianraid tells me to run: $ lilo $ install-mbr /dev/sda $ install-mbr /dev/sdb Do you think I could accomplish the same result by only using grub? -- Kilian -- They that can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety. -- Benjamin Franklin, 1759 -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Re: install-mbr on amd64?
Dmitry I. Kulagin [EMAIL PROTECTED] writes: Hi! I use ms-sys with -s option just a week ago in simular situation. As far as I know, you can't indicate grub to load from /dev/md0, only lilo can do this. And there is no need to recompile the kernel, the debian distributed kernel with the yaird as initrd creator can load the system in your situation. You have to trick grub-install. Say /boot is on /dev/md0, a raid1 of /dev/sda1 and /dev/sdb1. Then you can put /dev/sda1 into devices.map, instal-grub, repeat for sdb1. You might have to change fstab and/or mtab as well. Can't remeber if that is truely needed. But grub-install also has some special code for raids. Why it doesn't work or isn't good enough should be someones TODO. Maybe we could make that a NM job :) MfG Goswin -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Re: install-mbr on amd64?
On Thu, May 18, 2006 at 08:02:11AM -0400, Scott Reese wrote: You don't say what boot loader you're using, but if you are using grub, you can simply install the MBR to the second disk using the grub terminal. I needed install-mbr when I wanted to kill grub in favor of lilo a few weeks ago. The solution was to boot from a 32-bit Knoppix CD and run install-mbr from there. Gabor -- - MTA SZTAKI Computer and Automation Research Institute Hungarian Academy of Sciences - -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Re: install-mbr on amd64?
On Fri, May 19, 2006 at 04:29:36PM +0200, Goswin von Brederlow wrote: You have to trick grub-install. Say /boot is on /dev/md0, a raid1 of /dev/sda1 and /dev/sdb1. Then you can put /dev/sda1 into devices.map, instal-grub, repeat for sdb1. You might have to change fstab and/or mtab as well. Can't remeber if that is truely needed. ... and that's why I do not use grub whith software raid. It is much more awkward to set up than lilo, there is no documentation, and it is less reliable. Lilo at least displays some letters when something goes wrong so you know what did you do wrong; grub just hangs without any messages at all. If you want fancy boot, go with grub. If you want reliable boot from an md device, go with lilo. Gabor -- - MTA SZTAKI Computer and Automation Research Institute Hungarian Academy of Sciences - -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Re: install-mbr on amd64?
On Thu, May 18, 2006 at 07:05:56PM +0200, Goswin von Brederlow wrote: I went ahead and fixed mbr up for amd64. Apart from the obvious (Build-depends, gcc -m32) I also fixed up some of the more serious warnings and included running the testsuite as much as possible. The package compiles but someone has to risk his/her system and install the mbr now. Heh, I downloaded the mbr source yesterday and hoped to be able to do the same this weekend, but it seems I'm already late :-) Gabor -- - MTA SZTAKI Computer and Automation Research Institute Hungarian Academy of Sciences - -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Re: install-mbr on amd64?
Gabor Gombas [EMAIL PROTECTED] writes: On Fri, May 19, 2006 at 04:29:36PM +0200, Goswin von Brederlow wrote: You have to trick grub-install. Say /boot is on /dev/md0, a raid1 of /dev/sda1 and /dev/sdb1. Then you can put /dev/sda1 into devices.map, instal-grub, repeat for sdb1. You might have to change fstab and/or mtab as well. Can't remeber if that is truely needed. ... and that's why I do not use grub whith software raid. It is much more awkward to set up than lilo, there is no documentation, and it is less reliable. Lilo at least displays some letters when something goes wrong so you know what did you do wrong; grub just hangs without any messages at all. If you want fancy boot, go with grub. If you want reliable boot from an md device, go with lilo. Gabor Lilo can't boot because of bios checksum errors. Ever since then I use grub. I think I will look into grub stage0 code and grub-install concerning raid support this weekend. It really can't be that hard to patch in better support for it. MfG Goswin -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Re: install-mbr on amd64?
Goswin von Brederlow wrote: tag 330190 + patch thanks Kilian [EMAIL PROTECTED] writes: Dear All, I'm trying to set up a software RAID 1 (two disks) with Debian on a system with an AMD x86_64 Athlon processor. To install the MBR on both discs, I need install-mbr (http://packages.debian.org/stable/base/mbr) if I'm correct, but this package does not exist in the amd64 port... I then tried to compile it myself, which fails, obviously, because the package has not been ported to x86_64 yet as it seems (and I lack the knowledge to do so...). I'm a bit stuck now.. what other tools can I use? Thanks for any hint! Greetz, Kilian I went ahead and fixed mbr up for amd64. Apart from the obvious (Build-depends, gcc -m32) I also fixed up some of the more serious warnings and included running the testsuite as much as possible. The package compiles but someone has to risk his/her system and install the mbr now. Thanks a lot for your work! I'd be willing to do that, unfortunately it doesn't compile on my box; I get: Making all in harness make[1]: Entering directory `/usr/local/src/mbr-1.1.5.orig/harness' gcc -DPACKAGE=\mbr\ -DVERSION=\1.1.5\ -I. -I. -Wall -Wstrict-prototypes -Wmissing-prototypes -g -c bios.c In file included from bios.c:2: vm86.h:4:22: asm/vm86.h: No such file or directory bios.c: In function `handle_int_10': bios.c:73: error: dereferencing pointer to incomplete type [...] bios.c: In function `handle_int_e4': bios.c:243: error: dereferencing pointer to incomplete type bios.c:243: error: dereferencing pointer to incomplete type make[1]: *** [bios.o] Error 1 make[1]: Leaving directory `/usr/local/src/mbr-1.1.5.orig/harness' make: *** [all-recursive] Error 1 Obviously, asm/vm86.h is not found; I located this file in /usr/include/i386-linux/asm, tried to be ugly and changed the include statement in bios.c to the full path of vm86.h, but then I get: Making all in harness make[1]: Entering directory `/usr/local/src/mbr-1.1.5.orig/harness' gcc -DPACKAGE=\mbr\ -DVERSION=\1.1.5\ -I. -I. -Wall -Wstrict-prototypes -Wmissing-prototypes -g -c bios.c bios.c: In function `handle_int_13': bios.c:103: error: `CF' undeclared (first use in this function) bios.c:103: error: (Each undeclared identifier is reported only once bios.c:103: error: for each function it appears in.) bios.c: In function `handle_int_16': bios.c:214: error: `ZF' undeclared (first use in this function) make[1]: *** [bios.o] Error 1 make[1]: Leaving directory `/usr/local/src/mbr-1.1.5.orig/harness' make: *** [all-recursive] Error 1 I'm really sorry but my knowledge does not go that far as making a smart interpretation of the above... can you help? Linux 2.6.8-11-amd64-k8, x86_64, Debian Sarge, gcc version 3.3.5 (Debian 1:3.3.5-13) Thanks a lot! -- Kilian -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Re: install-mbr on amd64?
On Fri, May 19, 2006 at 04:29:36PM +0200, Goswin von Brederlow wrote: You have to trick grub-install. Say /boot is on /dev/md0, a raid1 of /dev/sda1 and /dev/sdb1. Then you can put /dev/sda1 into devices.map, instal-grub, repeat for sdb1. You might have to change fstab and/or mtab as well. Can't remeber if that is truely needed. But grub-install also has some special code for raids. Why it doesn't work or isn't good enough should be someones TODO. Maybe we could make that a NM job :) grub-install works fine here with /boot on a raid1. It has ever since sarge was released (raid1 support was added sometime in early 2005 it seems). No tricks required. Len Sorensen -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Re: install-mbr on amd64?
Kilian [EMAIL PROTECTED] writes: Goswin von Brederlow wrote: tag 330190 + patch thanks Kilian [EMAIL PROTECTED] writes: Dear All, I'm trying to set up a software RAID 1 (two disks) with Debian on a system with an AMD x86_64 Athlon processor. To install the MBR on both discs, I need install-mbr (http://packages.debian.org/stable/base/mbr) if I'm correct, but this package does not exist in the amd64 port... I then tried to compile it myself, which fails, obviously, because the package has not been ported to x86_64 yet as it seems (and I lack the knowledge to do so...). I'm a bit stuck now.. what other tools can I use? Thanks for any hint! Greetz, Kilian I went ahead and fixed mbr up for amd64. Apart from the obvious (Build-depends, gcc -m32) I also fixed up some of the more serious warnings and included running the testsuite as much as possible. The package compiles but someone has to risk his/her system and install the mbr now. Thanks a lot for your work! I'd be willing to do that, unfortunately it doesn't compile on my box; I get: Making all in harness make[1]: Entering directory `/usr/local/src/mbr-1.1.5.orig/harness' gcc -DPACKAGE=\mbr\ -DVERSION=\1.1.5\ -I. -I. -Wall -Wstrict-prototypes -Wmissing-prototypes -g -c bios.c Did you apply the patch? This should be gcc -m32 there. Without it it will create 64bit code which won't work. In file included from bios.c:2: vm86.h:4:22: asm/vm86.h: No such file or directory sh-3.1# cat /usr/include/asm/vm86.h /* All asm/ files are generated and point to the corresponding * file in asm-x86_64 or asm-i386. */ #ifdef __i386__ # include asm-i386/vm86.h #else # error This header is not available for x86_64 #endif sh-3.1# dpkg -S /usr/include/asm/vm86.h linux-kernel-headers: /usr/include/asm/vm86.h And you don't seem to be on sid. I don't have that file either on sarge so it won't work there. http://mrvn.homeip.net/mbr/mbr_1.1.5-2.1_amd64.deb MfG Goswin -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Re: install-mbr on amd64?
[EMAIL PROTECTED] (Lennart Sorensen) writes: On Fri, May 19, 2006 at 04:29:36PM +0200, Goswin von Brederlow wrote: You have to trick grub-install. Say /boot is on /dev/md0, a raid1 of /dev/sda1 and /dev/sdb1. Then you can put /dev/sda1 into devices.map, instal-grub, repeat for sdb1. You might have to change fstab and/or mtab as well. Can't remeber if that is truely needed. But grub-install also has some special code for raids. Why it doesn't work or isn't good enough should be someones TODO. Maybe we could make that a NM job :) grub-install works fine here with /boot on a raid1. It has ever since sarge was released (raid1 support was added sometime in early 2005 it seems). No tricks required. Len Sorensen Then pull a disk (the right one) and see it stop booting. From grub-install: # Usage: getraid_mdadm mddevice # Routine to find a physical device from an md device # If found, the first grub BIOS device (from device.map) is returned # If no BIOS drives match the RAID devices, the first device returned # from mdadm -D is returned Only one of your disks is bootable. By setting up each device in device.map in turn you get grub on each of them. MfG Goswin -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Re: install-mbr on amd64?
Kilian wrote: Dear All, I'm trying to set up a software RAID 1 (two disks) with Debian on a system with an AMD x86_64 Athlon processor. To install the MBR on both discs, I need install-mbr (http://packages.debian.org/stable/base/mbr) if I'm correct, but this package does not exist in the amd64 port... I then tried to compile it myself, which fails, obviously, because the package has not been ported to x86_64 yet as it seems (and I lack the knowledge to do so...). I'm a bit stuck now.. what other tools can I use? You don't say what boot loader you're using, but if you are using grub, you can simply install the MBR to the second disk using the grub terminal. Run grub, then from the grub prompt (and assuming your boot partition is the first partition on the disk): MBR on the first disk: grub root (hd0,0) grub setup (hd0) MBR on the second disk: grub root (hd1,0) grub setup (hd1) And then you're done: grub quit Grub supports tab completion, so if you put in grub root (hd and hit the tab key, it will show the valid drive numbers. It will do the same for the partitions if you hit tab after: grub root (hd1, to help you pick the correct partition. Remember, all numbers are zero-origin, so if the parition holding /boot is /dev/sda1, its partition number will be 0 in grub. And, as always, a bootable grub disk as a safety measure is highly recommended. -Scott -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Re: install-mbr on amd64?
Scott Reese wrote: Kilian wrote: Dear All, I'm trying to set up a software RAID 1 (two disks) with Debian on a system with an AMD x86_64 Athlon processor. To install the MBR on both discs, I need install-mbr (http://packages.debian.org/stable/base/mbr) if I'm correct, but this package does not exist in the amd64 port... I then tried to compile it myself, which fails, obviously, because the package has not been ported to x86_64 yet as it seems (and I lack the knowledge to do so...). I'm a bit stuck now.. what other tools can I use? You don't say what boot loader you're using, but if you are using grub, you can simply install the MBR to the second disk using the grub terminal. Thanks a lot for your reply! I'm using lilo as bootloader, but as grub is way more modern, I might just switch to grub. The thing is, the machine I'm working on is remote and I have no console access, so everything is a bit tricky. It's already running, has two identical SATA disks, the second one (sdb) is not used. What I want to do is create a RAID 1 array with only sdb (but with the possibility to add sda later). Then I boot from this new RAID array, repartition sda and add it to the RAID array. I've gotten so far as setting up the RAID array, chrooting into it and bootstrap a Debian system on it, compile an new kernel, but when it comes to set up bootloaders, the howto I'm using http://juerd.nl/site.plp/debianraid tells me to run: $ lilo $ install-mbr /dev/sda $ install-mbr /dev/sdb Do you think I could accomplish the same result by only using grub? -- Kilian -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Re: install-mbr on amd64?
On Thursday 18 May 2006 08:41, Kilian wrote: Dear All, I'm trying to set up a software RAID 1 (two disks) with Debian on a system with an AMD x86_64 Athlon processor. To install the MBR on both discs, I need install-mbr (http://packages.debian.org/stable/base/mbr) if I'm correct, but this package does not exist in the amd64 port... I then tried to compile it myself, which fails, obviously, because the package has not been ported to x86_64 yet as it seems (and I lack the knowledge to do so...). I'm a bit stuck now.. what other tools can I use? Thanks for any hint! Greetz, Kilian Just install an MBR on one disk, and then use dd to copy it. A master boot record is always 512 bytes long. Assuming you are using SATA disks and the MBR was installed on the first, the command would be # dd if=/dev/sda of=/dev/sdb bs=512 count=1 To test it, shut down cleanly {so the RAID integrity is maintained}, and physically swap the drives. -- AJS -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Re: install-mbr on amd64?
On Thu, May 18, 2006 at 09:41:27AM +0200, Kilian wrote: I'm trying to set up a software RAID 1 (two disks) with Debian on a system with an AMD x86_64 Athlon processor. To install the MBR on both discs, I need install-mbr (http://packages.debian.org/stable/base/mbr) if I'm correct, but this package does not exist in the amd64 port... I then tried to compile it myself, which fails, obviously, because the package has not been ported to x86_64 yet as it seems (and I lack the knowledge to do so...). I'm a bit stuck now.. what other tools can I use? Thanks for any hint! I use grub-install /dev/sda and grub-install /dev/sdb. I see no reason for the mbr package on my systems. Len Sorensen -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Re: install-mbr on amd64?
On Thu, May 18, 2006 at 02:18:14PM +0200, Kilian wrote: I'm using lilo as bootloader, but as grub is way more modern, I might just switch to grub. The thing is, the machine I'm working on is remote and I have no console access, so everything is a bit tricky. It's already running, has two identical SATA disks, the second one (sdb) is not used. What I want to do is create a RAID 1 array with only sdb (but with the possibility to add sda later). Then I boot from this new RAID array, repartition sda and add it to the RAID array. I've gotten so far as setting up the RAID array, chrooting into it and bootstrap a Debian system on it, compile an new kernel, but when it comes to set up bootloaders, the howto I'm using http://juerd.nl/site.plp/debianraid tells me to run: $ lilo $ install-mbr /dev/sda $ install-mbr /dev/sdb Do you think I could accomplish the same result by only using grub? Unless you also have windows on the system, there is no reason to not put the boot loader in the MBR directly rather than on to one of the partitions. Both lilo and grub can install directly to the MBR and work from there without the install-mbr at all. Len Sorensen -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Re: install-mbr on amd64?
Kilian wrote: Thanks a lot for your reply! I'm using lilo as bootloader, but as grub is way more modern, I might just switch to grub. The thing is, the machine I'm working on is remote and I have no console access, so everything is a bit tricky. It's already running, has two identical SATA disks, the second one (sdb) is not used. What I want to do is create a RAID 1 array with only sdb (but with the possibility to add sda later). Then I boot from this new RAID array, repartition sda and add it to the RAID array. I've gotten so far as setting up the RAID array, chrooting into it and bootstrap a Debian system on it, compile an new kernel, but when it comes to set up bootloaders, the howto I'm using http://juerd.nl/site.plp/debianraid tells me to run: $ lilo $ install-mbr /dev/sda $ install-mbr /dev/sdb Do you think I could accomplish the same result by only using grub? -- Kilian Without console access to the machine, lilo or grub is going to be something of a moot point because you are going to have to get the configuration correct the first time or you are completely out of luck. The nice thing about grub is that it has a console at boot where you can modify the booting kernel and the parameters, which is nice if you got you /boot/grub/menu.lst wrong in some way. But without a console, you only get what's in your menu.lst - so if that's wrong it won't boot. What you're saying sounds do-able, but you'll have to get everything completely right the first time. You're assuming that your chrooted build on /dev/sdb will boot. In the situation you're talking about, you don't really need an MBR on /dev/sdb. The only reason you would need an MBR on /dev/sdb would be if /dev/sda had a failure. For what you are describing, you need a properly set up MBR on /dev/sda which defaults to booting your root partition on /dev/sdb?. On a side note, if this is an important machine to you, you might to check out some sort of lights-out remote access which would get you remote access to the machine's console. It's a real life-saver when you can't get to the machine easily. Good luck. -Scott -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Re: install-mbr on amd64?
tag 330190 + patch thanks Kilian [EMAIL PROTECTED] writes: Dear All, I'm trying to set up a software RAID 1 (two disks) with Debian on a system with an AMD x86_64 Athlon processor. To install the MBR on both discs, I need install-mbr (http://packages.debian.org/stable/base/mbr) if I'm correct, but this package does not exist in the amd64 port... I then tried to compile it myself, which fails, obviously, because the package has not been ported to x86_64 yet as it seems (and I lack the knowledge to do so...). I'm a bit stuck now.. what other tools can I use? Thanks for any hint! Greetz, Kilian I went ahead and fixed mbr up for amd64. Apart from the obvious (Build-depends, gcc -m32) I also fixed up some of the more serious warnings and included running the testsuite as much as possible. The package compiles but someone has to risk his/her system and install the mbr now. MfG Goswin PS: Dear maintainer, consider this a notification of intent to NMU your package. -- diff -u mbr-1.1.5/debian/control mbr-1.1.5/debian/control --- mbr-1.1.5/debian/control +++ mbr-1.1.5/debian/control @@ -3,10 +3,10 @@ Priority: optional Maintainer: Santiago Garcia Mantinan [EMAIL PROTECTED] Standards-Version: 3.6.1 -Build-Depends: bin86 +Build-Depends: bin86, libc6-dev-i386 [amd64], ia32-libs [amd64] Package: mbr -Architecture: i386 +Architecture: i386 amd64 Depends: ${shlibs:Depends} Description: Master Boot Record for IBM-PC compatible computers. This is used in booting Linux from the hard disk. diff -u mbr-1.1.5/debian/changelog mbr-1.1.5/debian/changelog --- mbr-1.1.5/debian/changelog +++ mbr-1.1.5/debian/changelog @@ -1,3 +1,24 @@ +mbr (1.1.5-2.1) unstable; urgency=low + + * NMU: Port to amd64 (closes: #330190) ++ debian/rules: set CC and LD ++ debian/rules: add -W to CFLAGS for proper warnings ++ debian/control: Build-Depend on libc6-dev-i386 [amd64] and + (temporary) on ia32-libs [amd64] for dpkg-shlibdeps to work + * Fix potentialy harmfull warnings ++ harness/args.c:57: warning: suggest parentheses around arithmetic in operand of ^ ++ harness/output.c:22: warning: comparison between signed and unsigned ++ harness/process.c:25: warning: implicit declaration of function 'exit' ++ install-mbr.c:617: warning: return type defaults to 'int' ++ install-mbr.c:702: warning: comparison between signed and unsigned ++ install-mbr.c:1357: warning: format '%d' expects type 'int', but argument 4 has type 'char *' + * Enable testsuite partialy ++ remove tests for non existing old mbrs ++ conditionaly remove runtime test that fail on amd64 + * Fix typo in manpage found by A Costa [EMAIL PROTECTED] (Closes: #311235) + + -- Goswin von Brederlow [EMAIL PROTECTED] Thu, 18 May 2006 18:43:42 + + mbr (1.1.5-2) unstable; urgency=low * The we are no longer required for anything release. diff -u mbr-1.1.5/debian/rules mbr-1.1.5/debian/rules --- mbr-1.1.5/debian/rules +++ mbr-1.1.5/debian/rules @@ -3,8 +3,12 @@ package = mbr docdir = debian/tmp/usr/share/doc/$(package) -CC = gcc -CFLAGS = -g -Wall +KERNEL_ARCH := $(shell uname -m) + +CC = gcc -m32 +LD = ld -melf_i386 + +CFLAGS = -g -Wall -W INSTALL_PROGRAM = install ifeq (,$(findstring noopt,$(DEB_BUILD_OPTIONS))) @@ -17,7 +21,13 @@ build: $(checkdir) ./configure --prefix=/ - $(MAKE) CC=$(CC) CFLAGS=$(CFLAGS) + $(MAKE) CC=$(CC) LD=$(LD) CFLAGS=$(CFLAGS) +ifneq (,$(findstring x86_64,$(KERNEL_ARCH))) + # Limit the tests on x86_64 kernels + $(MAKE) TESTS=tests/inst-1 tests/inst-3 tests/inst-4 tests/inst-6 tests/inst-7 tests/inst-8 check-TESTS +else + $(MAKE) check-TESTS +endif touch build clean: only in patch2: unchanged: --- mbr-1.1.5.orig/Makefile.in +++ mbr-1.1.5/Makefile.in @@ -71,7 +71,7 @@ man_MANS = install-mbr.8 -TESTS = tests/version tests/inst-1 tests/inst-2 tests/inst-3 tests/inst-4 tests/inst-5 tests/inst-6 tests/inst-7 tests/inst-8 tests/mbr-1 tests/mbr-2 tests/mbr-3 tests/mbr-4 tests/mbr-5 tests/mbr-6 +TESTS = tests/inst-1 tests/inst-3 tests/inst-4 tests/inst-6 tests/inst-7 tests/inst-8 tests/mbr-1 tests/mbr-2 tests/mbr-3 tests/mbr-4 tests/mbr-5 tests/mbr-6 TESTS_ENVIRONMENT = sh ${srcdir}/wraptest @@ -478,13 +478,7 @@ check-TESTS: \ table.b \ - mbr.b \ - mbr-1.1.3.b \ - mbr-1.1.2.b \ - mbr-1.1.1.b \ - mbr-1.1.0.b \ - mbr-1.0.1.b \ - mbr-1.0.0.b + mbr.b .PRECIOUS: mbr.b only in patch2: unchanged: --- mbr-1.1.5.orig/Makefile.am +++ mbr-1.1.5/Makefile.am @@ -7,21 +7,15 @@ man_MANS = install-mbr.8 -TESTS = tests/version tests/inst-1 tests/inst-2 tests/inst-3 \ -tests/inst-4 tests/inst-5 tests/inst-6 tests/inst-7 tests/inst-8 \ +TESTS = tests/inst-1 tests/inst-3 \ +tests/inst-4 tests/inst-6 tests/inst-7 tests/inst-8 \ tests/mbr-1 tests/mbr-2 tests/mbr-3 tests/mbr-4 \