Re: booting from wrong disk
PJ wrote: While trying to learn and understand the dump-retore process, I messed up the ad4s1a partition and could not boot. To fix it I restored a dumpfile of ad12s1a which is, for all intents and purposes, the same as ad4s1a. I then boot from ad4 and surprise, surprise... #df shows we have been booted from ad12 and all partitions are ad12 Booting from ad12s1a gives exactly the same results. So, how can I get ad4s1a to boot from ad4? I imagine it is something in the boot files... but how to fix that? ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org I see from the boot process that this should fix it... # fdisk -B -b /boot/boot0 ad4 but... how do I get this onto the right disk? If I boot from ad4 or ad12 and change the mbr, then it will be the ad12 that will be booting from ad4 and vice versa... or have I got it wrong? But in the end, I suppose it really doesn't matter, or does it? ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org
Re: booting from wrong disk
PJ wrote: While trying to learn and understand the dump-retore process, I messed up the ad4s1a partition and could not boot. To fix it I restored a dumpfile of ad12s1a which is, for all intents and purposes, the same as ad4s1a. I then boot from ad4 and surprise, surprise... #df shows we have been booted from ad12 and all partitions are ad12 Booting from ad12s1a gives exactly the same results. So, how can I get ad4s1a to boot from ad4? I imagine it is something in the boot files... but how to fix that? ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org add another thought... If I change the mbr on the ad12 then mount ad4s1a to /mnt copy /mnt/boot/boot0 to /boot/boot0.tmp and then copy the modified /boot/boot0 (for ad4) back to /mnt/boot/ and then umount ad4s1a --- I should be ok, OK? Have I got it? ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org
Re: booting from wrong disk
On Thu, 15 Oct 2009 11:36:56 -0400, PJ af.gour...@videotron.ca wrote: I imagine it is something in the boot files... but how to fix that? The easiest way is to prepare the disk with sysinstall. The steps usually involve: 1. creation of slice, usually covering whole disk 2. marking the slice active 3. installing the standard MBR 4. partitioning the slice as intended 5. format the partitions And as I said, sysinstall's slice and partition editor are often my tools of choice, allthough you can do all this with the correct command line tools (which you obviously do when scripting automated processes). -- Polytropon Magdeburg, Germany Happy FreeBSD user since 4.0 Andra moi ennepe, Mousa, ... ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org
Re: booting from wrong disk
On Thu, 15 Oct 2009 12:07:17 -0400, PJ af.gour...@videotron.ca wrote: I see from the boot process that this should fix it... # fdisk -B -b /boot/boot0 ad4 but... how do I get this onto the right disk? If I boot from ad4 or ad12 and change the mbr, then it will be the ad12 that will be booting from ad4 and vice versa... or have I got it wrong? But in the end, I suppose it really doesn't matter, or does it? The active flag on the partition tells the MBR loader from which device to boot. In other words, the FIRST device that is market as active will be booted. If you have, for example, ad4 ad ad12 in your system, and ad4 is detected first, then it will be booted, no matter if ad12 is marked active, too. Of course, ad4's boot loader can refer to another device as bootdev (booting device), but that's out of scope for now. If you have two disks ad4 and ad12, both marked active, and you exchange them physically, boot order will change, too. A similar setting could involve things like a mix of ATA, SCSI and SATA disks. Again, who comes first will be booted - but as I said, only if the device is marked active; if not, it will be ignored. -- Polytropon Magdeburg, Germany Happy FreeBSD user since 4.0 Andra moi ennepe, Mousa, ... ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org
Re: booting from wrong disk
On Thu, 15 Oct 2009 12:13:08 -0400, PJ af.gour...@videotron.ca wrote: add another thought... If I change the mbr on the ad12 then mount ad4s1a to /mnt copy /mnt/boot/boot0 to /boot/boot0.tmp and then copy the modified /boot/boot0 (for ad4) back to /mnt/boot/ and then umount ad4s1a --- I should be ok, OK? Have I got it? Why not just remove the active marking from the disk you do not want to be booted from? Furthermore, I'm not sure if the desired operation can be performed UFS-file-wise... The easiest way really is to use sysinstall. It's the lazy man's swiss army knife. :-) -- Polytropon Magdeburg, Germany Happy FreeBSD user since 4.0 Andra moi ennepe, Mousa, ... ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org
Re: booting from wrong disk
On Thu, 15 Oct 2009, PJ wrote: While trying to learn and understand the dump-retore process, I messed up the ad4s1a partition and could not boot. To fix it I restored a dumpfile of ad12s1a which is, for all intents and purposes, the same as ad4s1a. I then boot from ad4 and surprise, surprise... #df shows we have been booted from ad12 and all partitions are ad12 Booting from ad12s1a gives exactly the same results. The /etc/fstab from ad12 will point at ad12. After restoring on ad4, did you edit fstab to now have ad4 entries? -Warren Block * Rapid City, South Dakota USA ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org
Re: booting from wrong disk
On Thu, 15 Oct 2009 12:22:29 -0600 (MDT), Warren Block wbl...@wonkity.com wrote: The /etc/fstab from ad12 will point at ad12. After restoring on ad4, did you edit fstab to now have ad4 entries? Ha! Excellent point; I missed to see this obvious thing. Next to booting, the /etc/fstab mechanism is very important to have a look at when cloning disks that will have a different signature in the target than in the source. -- Polytropon Magdeburg, Germany Happy FreeBSD user since 4.0 Andra moi ennepe, Mousa, ... ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org
Re: booting from wrong disk
Polytropon wrote: On Thu, 15 Oct 2009 12:13:08 -0400, PJ af.gour...@videotron.ca wrote: add another thought... If I change the mbr on the ad12 then mount ad4s1a to /mnt copy /mnt/boot/boot0 to /boot/boot0.tmp and then copy the modified /boot/boot0 (for ad4) back to /mnt/boot/ and then umount ad4s1a --- I should be ok, OK? Have I got it? Why not just remove the active marking from the disk you do not want to be booted from? Furthermore, I'm not sure if the desired operation can be performed UFS-file-wise... The easiest way really is to use sysinstall. It's the lazy man's swiss army knife. :-) Yeh, but even with a swill army knife you can cut yourself. ;-) But sysinstall will overwrite all the info on the disk and that defeats the whole purpose of the exercise. What complicates matters is the use of GAG as boot manager. If I select to boot from ad4 and the boot is from ad12, then there is something wrong. It indicates to me that the mbr is loading the wrong disk. I noticed this when trying to boot a disk on my other computer... it was looking for ad12 when there was no ad12 installed. I found that strange, but then I recalled thatManolis Klagias had warned about something of the sort. Now, I'll have to sort that out. And you think you're lazy... this is back-braking work for me... :-D ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org
Re: booting from wrong disk
Polytropon wrote: On Thu, 15 Oct 2009 12:22:29 -0600 (MDT), Warren Block wbl...@wonkity.com wrote: The /etc/fstab from ad12 will point at ad12. After restoring on ad4, did you edit fstab to now have ad4 entries? Ha! Excellent point; I missed to see this obvious thing. Next to booting, the /etc/fstab mechanism is very important to have a look at when cloning disks that will have a different signature in the target than in the source. AHA! Now, we're getting somewhere... cut's the workload. ;-) I'll try it ASAP. ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org
Re: booting from wrong disk
On Thu, 15 Oct 2009 14:42:24 -0400, PJ af.gour...@videotron.ca wrote: But sysinstall will overwrite all the info on the disk and that defeats the whole purpose of the exercise. If you only change a slice's state and add an MBR, it won't do anything to the data inside the slice. What complicates matters is the use of GAG as boot manager. Hmmm... I'm not familar with that, nor have I ever heared of it. If I select to boot from ad4 and the boot is from ad12, then there is something wrong. Check /etc/fstab as suggested. Furthermore, check what GAG actually does - just to be sure it boots the correct device. I always assumed that you use the standard MBR which does, as I explained, simply boot the first active slice on the first disk it finds. Maybe GAG acts differently. It indicates to me that the mbr is loading the wrong disk. In this case, it's good to read how booting works. MBR, and bootN, the FreeBSD loader and the kernel own specified points in this race. :-) I noticed this when trying to boot a disk on my other computer... it was looking for ad12 when there was no ad12 installed. Who was looking for ad12? Was it at the boot or the Ok prompt? I found that strange, but then I recalled thatManolis Klagias had warned about something of the sort. Now, I'll have to sort that out. You have to be entirely sure that the booting process works as intended. The easiest way to ensure this is to first use only one disk at once in the system. There are different stages where things can get messed up, such as the loader or /etc/fstab. They have to match the situation. As a sidenote, GEOM supports labelling partitions so it does not matter anymore if, for example, a / partition is ad4s1a or ad12s1a. There's a section in the handbook that illustrates how to get rid of device names in /etc/fstab. -- Polytropon Magdeburg, Germany Happy FreeBSD user since 4.0 Andra moi ennepe, Mousa, ... ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org
Re: booting from wrong disk
Polytropon wrote: On Thu, 15 Oct 2009 14:42:24 -0400, PJ af.gour...@videotron.ca wrote: But sysinstall will overwrite all the info on the disk and that defeats the whole purpose of the exercise. If you only change a slice's state and add an MBR, it won't do anything to the data inside the slice. What complicates matters is the use of GAG as boot manager. Hmmm... I'm not familar with that, nor have I ever heared of it. If I select to boot from ad4 and the boot is from ad12, then there is something wrong. Check /etc/fstab as suggested. Furthermore, check what GAG actually does - just to be sure it boots the correct device. I always assumed that you use the standard MBR which does, as I explained, simply boot the first active slice on the first disk it finds. Maybe GAG acts differently. Gag is really about the simplest you can find... it is installed on the main drive that is selected by bios and it works from there. I have found it to be quite safe and reliable. Only difficulty is sometimes to figure ;out what dist it is booting from but that can be worked out be trial and error. I've tried the rest, this is the best KISS. It indicates to me that the mbr is loading the wrong disk. In this case, it's good to read how booting works. MBR, and bootN, the FreeBSD loader and the kernel own specified points in this race. :-) I noticed this when trying to boot a disk on my other computer... it was looking for ad12 when there was no ad12 installed. Who was looking for ad12? Was it at the boot or the Ok prompt? the boot... it could be seen in the onscreen mesages... and then the boot oviously failed... I found that strange, but then I recalled thatManolis Klagias had warned about something of the sort. Now, I'll have to sort that out. You have to be entirely sure that the booting process works as intended. The easiest way to ensure this is to first use only one disk at once in the system. There are different stages where things can get messed up, such as the loader or /etc/fstab. They have to match the situation. As a sidenote, GEOM supports labelling partitions so it does not matter anymore if, for example, a / partition is ad4s1a or ad12s1a. There's a section in the handbook that illustrates how to get rid of device names in /etc/fstab. I noticed that but have not yet had the opportunity to look into it. The fstab did cure the problem and showed some of the pitfalls one can encounter. After fixing the fstab, the boot did not complete because the fstab from the source disk had anextra partition (/backups) which were not present in the original ad4 disk. But that was easiily fixed by simply removing the fstab entry for that /backups partition. Now it works fine. ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org
Re: booting from wrong disk
On Thu, 15 Oct 2009 19:08:12 -0400, PJ af.gour...@videotron.ca wrote: Gag is really about the simplest you can find... it is installed on the main drive that is selected by bios and it works from there. I have found it to be quite safe and reliable. Only difficulty is sometimes to figure ;out what dist it is booting from but that can be worked out be trial and error. I've tried the rest, this is the best KISS. The last time I did dual boot is long ago; I used FreeBSD's boot manager for this, it worked well, so there was no need for something else to try. :-) the boot... it could be seen in the onscreen mesages... and then the boot oviously failed... Seems that the first boot stage finds ad12 BEFORE ad4, which is quite strange... or is the setting hardcoded somewhere in the boot loader? I noticed that but have not yet had the opportunity to look into it. That would be a good point to start diagnostics. The most obvious is often such a point... The fstab did cure the problem and showed some of the pitfalls one can encounter. After fixing the fstab, the boot did not complete because the fstab from the source disk had anextra partition (/backups) which were not present in the original ad4 disk. But that was easiily fixed by simply removing the fstab entry for that /backups partition. Now it works fine. Excellent! And you have learned something new. :-) -- Polytropon Magdeburg, Germany Happy FreeBSD user since 4.0 Andra moi ennepe, Mousa, ... ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org
Re: booting from wrong disk
On 10/15/09, PJ af.gour...@videotron.ca wrote: While trying to learn and understand the dump-retore process, I messed up the ad4s1a partition and could not boot. To fix it I restored a dumpfile of ad12s1a which is, for all intents and purposes, the same as ad4s1a. I then boot from ad4 and surprise, surprise... #df shows we have been booted from ad12 and all partitions are ad12 Booting from ad12s1a gives exactly the same results. So, how can I get ad4s1a to boot from ad4? I imagine it is something in the boot files... but how to fix that? Probably because ad12's /etc/fstab tell it to mount ad12's filesystems. rewriting mbrs and stuff probably won't help. check your fstab. ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org