Michael Sperber
2010-Sep-16 09:10 UTC
How to predict drive number change for 7.3->8.1 upgrade?
I just upgraded my desktop system from 7.3 to 8.1, and the main hard drive, which was /dev/ad6 before is now /dev/ad10. Consequently, the initial boot failed when trying to mount the root file system from ad6. The desktop system is now fixed, but I also have a rented server with only a serial console, and I worry that the upgrade is going to leave me with a dead machine. Is there any way to predict how the drive number changes? (Why does it change at all?) If so, what's the proper way to tell the system the initial root device *before* rebooting? -- Regards, Mike
Stefan Bethke
2010-Sep-16 09:30 UTC
How to predict drive number change for 7.3->8.1 upgrade?
Am 16.09.2010 um 11:05 schrieb Michael Sperber:> I just upgraded my desktop system from 7.3 to 8.1, and the main hard > drive, which was /dev/ad6 before is now /dev/ad10. Consequently, the > initial boot failed when trying to mount the root file system from ad6. > > The desktop system is now fixed, but I also have a rented server with > only a serial console, and I worry that the upgrade is going to leave me > with a dead machine. Is there any way to predict how the drive number > changes? (Why does it change at all?) If so, what's the proper way to > tell the system the initial root device *before* rebooting?If you have a serial console, you can always enter the root device at the prompt, so you can recover there. If you can figure out the new device name, you can simply change the fstab entry for /; that's where loader picks up the root device that it hands to the kernel. Long-term, the best option is to label your filesystems or partitions, and use the label entries in fstab instead of the device names. I don't remember what 7.3 offers in terms of labels, but glabel should be available. Check tunefs if it offers the -L volname option, that's even better. Stefan -- Stefan Bethke <stb@lassitu.de> Fon +49 151 14070811
Jeremy Chadwick
2010-Sep-16 09:30 UTC
How to predict drive number change for 7.3->8.1 upgrade?
On Thu, Sep 16, 2010 at 11:05:06AM +0200, Michael Sperber wrote:> I just upgraded my desktop system from 7.3 to 8.1, and the main hard > drive, which was /dev/ad6 before is now /dev/ad10. Consequently, the > initial boot failed when trying to mount the root file system from ad6. > > The desktop system is now fixed, but I also have a rented server with > only a serial console, and I worry that the upgrade is going to leave me > with a dead machine. Is there any way to predict how the drive number > changes? (Why does it change at all?) If so, what's the proper way to > tell the system the initial root device *before* rebooting?This has to do with ATA device naming schemes, and changes in the ATA driver, in addition to capabilities of the chipset. For example, FreeBSD 7.x may have seen only 2 PATA or SATA ports on your system, but with 8.x (and improved drivers) it may see 4, or possibly 2 of each (2 PATA, 2 SATA). The device numbers shift/change as a result. AFAIK, there is no failsafe way to "predict" what the device numbers will be. I've dealt with this "problem" many times, and this is how I do it: Print out or copy/paste the contents of /etc/fstab prior to upgrade. If you have serial console on your remote server, then you have little to worry about -- you know what drive name/model/size is associated with ad6 on 7.x. When you upgrade, boot the 8.x kernel and into single-user mode. While the kernel boots, you'll see the device names in the kernel output, and will then be prompted for the root filesystem. Enter the correct ufs reference string with the correct device number. After that, just mount the /usr, /tmp, and /var filesystems by hand using the correct device number. Once you have that, you should be able to edit /etc/fstab and change the device numbers (you might have to do mount -o rw -u / to make it read-writeable). Reboot the machine and go into single-user, and you should find that the root filesystem is mounted + mount -a should work fine + everything work going forward. If you find that the device numbers are changing "randomly" after every reboot, that's a separate problem and should be dealt with separately. -- | Jeremy Chadwick jdc@parodius.com | | Parodius Networking http://www.parodius.com/ | | UNIX Systems Administrator Mountain View, CA, USA | | Making life hard for others since 1977. PGP: 4BD6C0CB |
Edho P Arief
2010-Sep-16 09:32 UTC
How to predict drive number change for 7.3->8.1 upgrade?
On Thu, Sep 16, 2010 at 4:05 PM, Michael Sperber <sperber@deinprogramm.de> wrote:> > I just upgraded my desktop system from 7.3 to 8.1, and the main hard > drive, which was /dev/ad6 before is now /dev/ad10. ?Consequently, the > initial boot failed when trying to mount the root file system from ad6. >doesn't 7.3 have ufs label? -- O< ascii ribbon campaign - stop html mail - www.asciiribbon.org
Marat N.Afanasyev
2010-Sep-16 09:47 UTC
How to predict drive number change for 7.3->8.1 upgrade?
Michael Sperber wrote:> > I just upgraded my desktop system from 7.3 to 8.1, and the main hard > drive, which was /dev/ad6 before is now /dev/ad10. Consequently, the > initial boot failed when trying to mount the root file system from ad6. > > The desktop system is now fixed, but I also have a rented server with > only a serial console, and I worry that the upgrade is going to leave me > with a dead machine. Is there any way to predict how the drive number > changes? (Why does it change at all?) If so, what's the proper way to > tell the system the initial root device *before* rebooting? >you may try to label your slices/labels and mount /dev/label/root instead of /dev/adXsYa see man 8 glabel -- SY, Marat
Oliver Fromme
2010-Sep-17 12:39 UTC
How to predict drive number change for 7.3->8.1 upgrade?
Michael Sperber <sperber@deinprogramm.de> wrote: > I just upgraded my desktop system from 7.3 to 8.1, and the main hard > drive, which was /dev/ad6 before is now /dev/ad10. Consequently, the > initial boot failed when trying to mount the root file system from ad6. > > The desktop system is now fixed, but I also have a rented server with > only a serial console, and I worry that the upgrade is going to leave me > with a dead machine. Is there any way to predict how the drive number > changes? (Why does it change at all?) If so, what's the proper way to > tell the system the initial root device *before* rebooting? Remove "options ATA_STATIC_ID" from your kernel config before building the new kernel and rebooting. Then your first disk will be ad0, no matter what controller and channel it is connected to. Be sure to update your /etc/fstab file. Best regards Oliver -- Oliver Fromme, secnetix GmbH & Co. KG, Marktplatz 29, 85567 Grafing b. M. Handelsregister: Registergericht Muenchen, HRA 74606, Gesch?ftsfuehrung: secnetix Verwaltungsgesellsch. mbH, Handelsregister: Registergericht M?n- chen, HRB 125758, Gesch?ftsf?hrer: Maik Bachmann, Olaf Erb, Ralf Gebhart FreeBSD-Dienstleistungen, -Produkte und mehr: http://www.secnetix.de/bsd "I have stopped reading Stephen King novels. Now I just read C code instead." -- Richard A. O'Keefe