how to find out the boot device
Brooks Davis
brooks at one-eyed-alien.net
Fri Aug 26 20:47:34 GMT 2005
On Fri, Aug 26, 2005 at 10:41:47PM +0200, Jan Pechanec wrote:
>
> hello guys,
>
> during the rc.d phase, I need to find out in a shell script from
> which disk the system has booted up.
>
> - I cannot use kern.rootdev because my root fs is a memory disk
> - I cannot use kern.disks because the first disk there doesn't
> necessarily mean the boot disk (eg. my home box says 'cd0 ad0' for that)
>
> - I could use 'atacontrol list' or 'camcontrol devlist' because I
> always boot from the 1st disk, but if I have both types of disks then I have
> 1st ATA disk and 1st SCSI disk and again unable to recognize which one is
> the one I need.
>
> any ideas, please?
Use glabel and label the disk or file systems during deployment. Then
you'll have /dev/label/<disk label> or /dev/ufs/<label> entries. Once
that's done, it won't matter where the drive moves or what kind of bus
you use.
-- Brooks
--
Any statement of the form "X is the one, true Y" is FALSE.
PGP fingerprint 655D 519C 26A7 82E7 2529 9BF0 5D8E 8BE9 F238 1AD4
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-stable/attachments/20050826/5d157335/attachment.bin
More information about the freebsd-stable
mailing list