svn commit: r220983 - head

Warner Losh imp at bsdimp.com
Mon Apr 25 05:00:55 UTC 2011


On Apr 24, 2011, at 11:34 AM, Daniel O'Connor wrote:

> 
> On 24/04/2011, at 18:19, Andrey Chernov wrote:
>> On Sun, Apr 24, 2011 at 09:23:08AM +0000, Alexander Motin wrote:
>>> 	ATA device names in /etc/fstab or other places, make sure to update
>>> 	them respectively (adX -> adaY, acdX -> cdY, afdX -> daY, astX -> saY,
>>> -	where 'Y's are the sequential numbers for each type in order of
>>> -	detection, unless configured otherwise with tunables, see cam(4)).
>>> +	where 'Y's are the sequential numbers starting from zero for each type
>>> +	in order of detection, unless configured otherwise with tunables,
>>> +	see cam(4)).
>> 
>> Is there any way to guess resulting 'Y' numbers _before_ booting new 
>> kernel? I have remote machine with console access almost impossible (very 
>> hard for me).
>> 
>> It seems something like
>> vfs.root.mountfrom="ufs:/dev/ada0s1a ufs:/dev/ada1s1a ..."
>> (up to max channels) helps to find root, but what about other mounted 
>> disks?
> 
> The best way is to change to use GPT IDs (/dev/gptid/xxx) if you are on a GPT system) or UFS IDs (/dev/ufsid/xxx) if you can't.

I've been running with ufs labels for a couple of years now, since the first rumblings of this hit the streets.  They work great no matter what the underlying partitioning scheme.  The one drawback is that if you have multiple disks with the same labels, then the first one wins.  Normally not a problem, but when you have it, you need to ensure the right one is selected.  I avoid this problem by prefixing a hostname to the label...

> gpart list will show the GPTID (rawuuid) and dumpfs will show the UFS ID.
> 
> The following shell snippet will generate the UFS ID for a given FS.
> 
> getfsid() {
>  line=`dumpfs 2> /dev/null $1 | head | grep superblock\ location`
>  if [ $? -ne 0 ]; then
>    return 1
>  fi
>  # dumpfs doesn't print leading 0s
>  eval `echo $line | sed -nEe 's/superblock location.*id.*\[ (.*) (.*)\ ]/printf %0x $((0x\1 << 32 | 0x\2))/p'`
> }

This is also good.

Warner


More information about the svn-src-all mailing list