Change mount Point Post Initial Install

This is my first post. I hope I do not make too many formatting and typo errors. Typo errors may be more than my normal due to DE keyboard layout issues that will be another posting, so please do not ask about the DE keyboard layout issues in this posting.

I did a fresh install of FreeBSD 14.2 20241210 using
Code:
uname -a
FreeBSD df001 14.2-RELEASE FreeBSD 14.2-RELEASE releng/14.2-n269506-c8918d6c7412 GENERIC amd64
I have decided I want to allow /home to be changed from dedicated partition /dev/ada0p6 to exist on /dev/ada0p2 which is root mount point / The dedicated mount point dedicated partition /dev/ada0p6 would be changed to dedicated partition /Data

I know there are various files and directories in the /home/foo of the current /dev/ada0p6 that need to be copied to /home migrated to /dev/ada0p2 I have created a shell command file to archive those files to /home migrated to /dev/ada0p2

I changed the line in /etc/fstab
Code:
/dev/ada0p6     /home           ufs     rw      2       2
to
Code:
/dev/ada0p6     /Data           ufs     rw      2       2

When I rebooted FreeBSD it dropped to single user mode with messages related to not able to find /Data mount point. I am assuming that the mount point name is part of the /dev/ada0p6 partition information
Code:
gpart list /dev/ada0
for /dev/ada0p2
Code:
Geom name: ada0
modified: false
state: OK
fwheads: 16
fwsectors: 63
last: 625142407
first: 40
entries: 128
scheme: GPT
Providers:

.... snip ...

6. Name: ada0p6
   Mediasize: 150323855360 (140G)
   Sectorsize: 512
   Stripesize: 4096
   Stripeoffset: 0
   Mode: r1w1e1
   efimedia: HD(6,GPT,6c04e08e-b6be-11ef-b09d-6c4b9045aed0,0x13c00020,0x11800000)
   rawuuid: 6c04e08e-b6be-11ef-b09d-6c4b9045aed0
   rawtype: 516e7cb6-6ecf-11d6-8ff8-00022d09712b
   label: home
   length: 150323855360
   offset: 169651224576
   type: freebsd-ufs
   index: 6
   end: 624951327
   start: 331350048
Consumers:
1. Name: ada0
   Mediasize: 320072933376 (298G)
   Sectorsize: 512
   Stripesize: 4096
   Stripeoffset: 0
   Mode: r5w5e9

Over the last several days I have done extensive searching using many different combinations of keywords assuming I need to change
Code:
label: home
for /dev/ada0p6 to
Code:
label: Data
It appears that
Code:
label: home
is what I need to change so /etc/fstab for
Code:
/dev/ada0p6     /Data           ufs     rw      2       2
change is successful. It appears based on research that
Code:
gpart modify -i index [-l label] [-t type] [-f flags] geom
is the command needed for the change I wish to effect for /etc/fstab

Before I ask more specific questions and if I need be provide additional system details is my current conclusion for the
Code:
gpart
command correct?
 
I am assuming that the mount point name is part of the /dev/ada0p6 partition information
No, it's an empty directory. You mount a filesystem on a directory (the mountpoint). So, just mkdir /Data.

The partition label is just a convenient way to address that partition, instead of /dev/ada0p6 you can use /dev/gpt/<label> (for GPT partition labels, see glabel(8)). That makes it a bit more readable for us humans, it also has the side effect of always addressing that specific partition even if the drive moves around (when you add a disk for example, ada0 could move to ada1). The label will automagically point to the correct partition of the disk.
 
SirDice, I had never had to do this in a BSD. I never even thought BSD based partitions would be just like normal Unix. Opps. As you know it is not a good idea to create mount points for non-root users in / nor /root. Hence I created /mnt/Data/ mount point and made the respective change to /etc/fstab. Migration of the /home/foo_user directory was successful. DE worked with all custom settings as did prior to /etc/fstab change for /dev/ada0p6.
 
I had never had to do this in a BSD. I never even thought BSD based partitions would be just like normal Unix.
FreeBSD has roots going back to the original, it's a direct descendant: https://cgit.freebsd.org/src/tree/share/misc/bsd-family-tree

Hence I created /mnt/Data/ mount point and made the respective change to /etc/fstab.
Don't use /mnt for anything 'permanent', it's meant for temporary mounts. /Data is fine, I use /storage and/or /exports for example. If you don't want user permissions in / create a subdirectory under /Data, i.e. /Data/foo_user.
 
Back
Top