UFS fstab for MBR

After adopting GPT as my partitioning scheme years ago have forgotten about BSD slices but am trying to change an fstab entry from /dev/ada1s3a
to something which uses a label.

gpart modify -i 3 -l freebsd-main ada0

does not work. What should I use instead?
 
WHAT?! Sorry, but I'm completely confused...
What are you trying to do?
  • Modify an entry in /etc/fstab? Which best be done with your editor. And why do you wanna do this at all? I'm just trying to understand, what your target is. The /etc/fstab is for tell the system to set mountpoints at boot, that e.g. /dev/ada3p3 will become /myporn/. Any error in the fstab will your system boot only into single user mode. So you better know what's on what drive, and the designators are correct. (Best do copies of the original fstab's lines, you comment; makes to restore the former state much easier by commenting the not working line(s) and uncommenting the working ones again.)
  • GPT is not MBR. Already told you that. What are we dealing with here? GPT OR MBR? Your drive can have either one of those schemes, but not both at the same time. MBR for main storage drives (HDD/SSD) is practically obsolete, and if even only used on smaller, external storage devices like flash drives or SDcards, or old drives.
  • The command you show is for labeling a partition - which has no effect on the fstab. You can label ada0p1 as "myporndrive" and use that label instead "ada0p1". That's very practical and very recommendable when your machine has more than one storage drive, because what becomes ada0, ada1, etc. is defined very early when the machine starts. If you do some changes (cables, exchange or add a drive) this numbering can change. When your fstab may not find the right drive anymore, your system fails to boot correctly. While with labels it doesn't matter if "myporndrive" is on ada0, or ada1. You can use "myporndrive" instead of "ada0p1" in fstab. Which would be done by editing fstab, not by just labelling the partition.
  • Quote from gpart(): "Not all partitioning schemes support labels and it is invalid to try to change a partition label in such cases." GPT supports partition labelling, but I'm not sure if MBR supports it. While ada1s3a designates a slice, which is a partition on MBR scheme. GPT scheme partitions are designated with p like in ada0p1
  • ... -i 3 ... means the 3rd partition, while ada1s3a designates the first extended partition on s3, which is the 4th.
...so, you see why I'm confused?
And again:
What is our situation, and what are you trying to achieve exactly?
 
Maturin, please re-read my post, I thought I explained what I wanted to achieve, ie the use of labels in fstab in a MBR based system and how to set them.

It looks like I can't do this using gpart BICBW.
 
----------------------------------------------------------------------------------------------------------------
GPT-partitioning scheme :

To add a label eg MYFREEBSD to partition 3 :
gpart modify -i 3 -l MYFREESD ada0
This should work without errors.
Then you can check :
ls /dev/gpt
Add to fstab :
/dev/gpt/MYFREEBSD ufs defaults 0 X
I use this for all my freebsd partitions , ufs & zfs(zpool)
It's unique and easier then UUID.
And your bios,loading can do freely device renumbering. It will still work.
Note : It only works when partitioning scheme of disk is GPT , MBR is not supported.
----------------------------------------------------------------------------------------------------------------
MBR-partitioning scheme :

For MBR there are two ways,
tunefs -L MYFREEBSD /dev/ada0s3(a)
---> /dev/ufs/MYFREEBSD
[Advised]

Or using GEOM provider :
glabel label MYFREEBSD /dev/ada0s3(a)
---> /dev/label/MYFREEBSD
 
Back
Top