12f6e BSD boot config on changing disk names - The FreeBSD Forums
The FreeBSD Forums  

Go Back   The FreeBSD Forums > Base System > Installing & Upgrading

Installing & Upgrading Installing and upgrading FreeBSD.

Reply
 
Thread Tools Display Modes
  #1  
Old August 19th, 2012, 12:46
AndySchmid AndySchmid is offline
Junior Member
 
Join Date: Aug 2012
Location: Melbourne, Australia
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default BSD boot config on changing disk names

I have installed FreeBSD 9 on a HP Microserver. The system has 4 bays which I'll use for data disk and i have moved an operating system disk into the optical bay from which I am booting.

The layout of the disk is that the 4 bays are ada0 to ada3 and the optical drive bay is ada4. I can't change this as this is a BIOS assignment. I can chose to boot from the optical drive bay via the BIOS.

So everything boots and works except if I change the configuration of the 4 drive bays, eg take out one disk:

If i take out one disk ada4 becomes ada3 so what happens the BSD Boot Loader still boots but it than can't find the root file system because it assumes it's on /dev/ada4p2 (p1 is boot loader) but it's now on /dev/ada3p2.

Is there a way that I can tell the boot loader to boot from partition 2 instead of the full path so it wouldn't matter what disk naming the boot disk has?

Any other way I could solve this problem?

NOTE: Of course I won't constantly swapping disk but i am worried in an event that one disk fails the last thing I need is dealing with a system that won't boot anymore because the boot partition has move to /dev/ada?

Thanks for any advise!

Last edited by phoenix; August 22nd, 2012 at 00:58. Reason: Please format your posts!
Reply With Quote
  #2  
Old August 19th, 2012, 13:42
vermaden's Avatar
vermaden vermaden is offline
Giant Locked
 
Join Date: Nov 2008
Location: pl_PL.lodz
Posts: 2,192
Thanks: 59
Thanked 632 Times in 349 Posts
Default

Use glabel to mark partitions/disks with labels or GPT names if You use GPT partitions when working with UFS, or use zpool name when using ZFS.

That way You are nit 'hit' with disk name changes.
__________________
Religions, worst damnation of mankind.
"FreeBSD has always been the operating system that GNU/Linux should have been." Frank Pohlmann, IBM
http://vermaden.blogspot.com
Reply With Quote
  #3  
Old August 19th, 2012, 14:18
SirDice's Avatar
SirDice SirDice is online now
Moderator
 
Join Date: Nov 2008
Location: Rotterdam, Netherlands
Posts: 13,695
Thanks: 47
Thanked 2,021 Times in 1,860 Posts
Default

+1 on labels. Pick some consistent names, you might want to move some disks to another machine for example.

Code:
root@molly:~# mount
/dev/ufs/mollyroot on / (ufs, local)
devfs on /dev (devfs, local, multilabel)
tmpfs on /tmp (tmpfs, local)
procfs on /proc (procfs, local)
fdescfs on /dev/fd (fdescfs)
/dev/ufs/mollyvar on /var (ufs, local, soft-updates)
/dev/ufs/mollyusr on /usr (ufs, local, soft-updates)
/dev/ufs/mollyusrhome on /usr/home (ufs, local, soft-updates)
__________________
Senior UNIX Engineer at Unix Support Nederland
Experience is something you don't get until just after you need it.
Reply With Quote
  #4  
Old August 19th, 2012, 14:33
gkontos's Avatar
gkontos gkontos is offline
Senior Member
 
Join Date: Dec 2009
Location: Polidendri, GR
Posts: 1,265
Thanks: 42
Thanked 218 Times in 164 Posts
Default

Besides the +2 on labels I would also recommend that you boot these servers from USB sticks.

We have quite a few of those configures as ZFS storage servers, booting from a UFS USB stick and they work flawlessly.
__________________
Powered by BareBSD
Reply With Quote
  #5  
Old August 19th, 2012, 14:53
wblock@'s Avatar
wblock@ wblock@ is offline
Moderator
 
Join Date: Sep 2009
Location: Milky Way galaxy
Posts: 7,701
Thanks: 429
Thanked 1,757 Times in 1,456 Posts
Default

Filesystem labels and GPT labels can be added without repartitioning. glabel(8) generic labels need one block of metadata at the end of the space, requiring partition re-sizing to use correctly.
Reply With Quote
The Following User Says Thank You to wblock@ For This Useful Post:
gkontos (August 19th, 2012)
  #6  
Old August 20th, 2012, 01:10
AndySchmid AndySchmid is offline
Junior Member
 
Join Date: Aug 2012
Location: Melbourne, Australia
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by gkontos View Post
Besides the +2 on labels I would also recommend that you boot these servers from USB sticks.

We have quite a few of those configures as ZFS storage servers, booting from a UFS USB stick and they work flawlessly.
So yes I did that before and it worked I was only worried that USB 2.0 speed being 480Mbs is much slower than disk at 3Gbs hence I moved it to a disk. Also considering ZFS writes some cache and log files /boot/zfs/.

Any impact on performance doing this to a USB stick at 480Mbs?

Regarding the labels, that's fine I can do that. Can somebody point me in the right direction what file I need to update to tell FreeBSD to boot from the "label" instead of the physical device?
Reply With Quote
  #7  
Old August 20th, 2012, 02:45
jb_fvwm2 jb_fvwm2 is offline
Senior Member
 
Join Date: Nov 2008
Posts: 1,386
Thanks: 60
Thanked 145 Times in 130 Posts
Default

/etc/fstab
I usually tunefs -L or one of the other ways, boot to single-user, check that the labels are in a subdir in /dev (/dev/ufs, /dev/label, or... mount them manually, then write it to fstab and backup the fstab. Howsoever, I am only usually doing it from experience and not reliably enough to even detail precisely how it is accomplished.
Reply With Quote
  #8  
Old August 20th, 2012, 03:08
wblock@'s Avatar
wblock@ wblock@ is offline
Moderator
 
Join Date: Sep 2009
Location: Milky Way galaxy
Posts: 7,701
Thanks: 429
Thanked 1,757 Times in 1,456 Posts
Default

The first link in post #5 shows how to do it with UFS. ZFS should be very similar.
Reply With Quote
  #9  
Old August 20th, 2012, 09:49
gkontos's Avatar
gkontos gkontos is offline
Senior Member
 
Join Date: Dec 2009
Location: Polidendri, GR
Posts: 1,265
Thanks: 42
Thanked 218 Times in 164 Posts
Default

Quote:
Originally Posted by AndySchmid View Post
So yes I did that before and it worked i was only worried that USB 2.0 speed being 480Mbs is much slower than disk at 3Gbs hence I moved it to a disk. Also considering ZFS writes some cache and log files /boot/zfs/

Any impact on performance doing this to a USB stick at 480Mbs?
Actually /boot/zfs is being used only if you boot from ZFS. What we do is to boot from a minimal USB UFS installation. We only have the necessary software installed like samba & afp. Then we have 2 ZVOLS, 1 for swap and 1 for /var/log.
__________________
Powered by BareBSD
Reply With Quote
  #10  
Old August 21st, 2012, 01:44
AndySchmid AndySchmid is offline
Junior Member
 
Join Date: Aug 2012
Location: Melbourne, Australia
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I have been playing a bit more and tried PC-BSD. Decided I don't like it but I found it did some interesting thing when installing.

Apparently PC-BSD does that partition labelling automatically on install and it creates a fstab like this:
Code:
/dev/label/rootfs0         /
/dev/labal/swap0          none
/dev/label/var0             /var
/dev/label/usr0             /usr
I'll try to copy this onto a plain vanilla FreeBSD Server install to make it work the same.

Not sure if this is the right place but maybe this is something to consider for the FreeBSD install process as well so hardware changes on the server won't trip over FreeBSD from booting?

Last edited by phoenix; August 22nd, 2012 at 01:00.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Preparing 7.2 USB boot disk with Mac OS X Disk Utility DirtyGerman Installing & Upgrading 8 November 7th, 2011 12:00
[Solved] After formating a sata disk, all disk names change from /dev/ad0# to /dev/ad#p1 bbmak0 General 12 October 24th, 2011 18:14
ZFS: Adding disk and changing to RAIDZ2 bsus General 6 July 5th, 2011 16:56
[Solved] ahci disk device names Ghirai System Hardware 7 July 10th, 2010 18:52
Please HELP! made mistake in boot.config Just_Johnny General 2 June 13th, 2010 00:51


All times are GMT +1. The time now is 10:31.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2013, vBulletin Solutions, Inc.
The mark FreeBSD is a registered trademark of The FreeBSD Foundation and is used by The FreeBSD Project with the permission of The FreeBSD Foundation.
Web protection and acceleration provided by CloudFlare
0