NetBSD-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Using NAME= as file system specification? ("Thomas Mueller") writes:

>I see something about a new feature in HEAD branch, using 
>NAME=<partition-label> in /etc/fstab .  Would this also work with mount
>command, like
>mount NAME=nb6i386root /mnt ?

The functionality is so far in the following commands:


>Simpler in FreeBSD, like
>mount /dev/gpt/<partition-label> /mnt (or whatever mount point).

NetBSD doesn't have a device filesystem, the NAME= feature is strictly
userland and implemented in the getfsspecname() function. The kernel still
sees only the /dev/dkXX wedge devices and e.g. mount or df will report only

# dkctl sd0 listwedges
/dev/rsd0d: 3 wedges:
dk5: 72a45a52-09c5-11df-bed3-001cc4d779ed, 16000000 blocks at 18, type: swap
dk6: 72a45a70-09c5-11df-bed3-001cc4d779ed, 200000000 blocks at 16000018, type: 
dk7: bla bla, 28198549 blocks at 216000018, type: lfs
# mount NAME="bla bla" /mnt
# df /mnt
Filesystem   512-blocks       Used      Avail %Cap Mounted on
/dev/dk7       53143578   12962576   34866214  27% /mnt
# mount | grep /mnt
/dev/dk7 on /mnt type lfs (local)

>I'm trying to avoid (mis)counting dk-wedges, could, for instance, newfs
>(which would act as nukefs) the wrong partition.

newfs doesn't know the NAME= scheme.

>Does this work only in NetBSD-HEAD (6.99.x), or can I use NAME= in
>/etc/fstab in NetBSD 6 as well?

It is only -current.

>I tried looking through source code, but couldn't find any hint.

src/lib/libutil/getfsspecname.c and its users.

>dk-wedge numbering can be disrupted by adding another GPT-partitioned drive,
>including USB sticks and USB hard drives.

My test system running -current is using named wedges and also the
kernel option DKWEDGE_METHOD_BSDLABEL to mix and match traditional
BSD partitions and GPT partitions.

                                Michael van Elst
                                "A potential Snark may lurk in every tree."

Home | Main Index | Thread Index | Old Index