UFS partition is auto mounting but in read only mode

Hi,
I am using GhostBSD which as you know is based on FreeBSD. I have a SSD on which GhostBSD is installed & I also have a spinning HDD with only 1 partition which I use to store data. When I was using Linux the data partition was EXT4 but later I backed up all data & formatted it to UFS because I thought its better to use a filesystem which FreeBSD supports fully.

The data partition is getting auto mounted but I can't write anything to it. Under Linux I used to use the command "chown" to gain write permission so decided to try it under FreeBSD too & it works but temporarily. What happens is after I use the chown command I gain write permission but as soon as I reboot the partition becomes read only again.

This is the command I using (after every reboot)

Code:
sudo chown -R  bsd /media/ada0p1/

Please tell me how to make the permission to persist.
 
If the data partition is on an internal disk, you should add it to /etc/fstab instead of letting an automounter handle it.

For example:
/dev/ada0p1 /choose/your/mount/point ufs rw 0 2

Otherwise check your automounter's settings, I don't know which one GhostBSD uses by default.
 
Quick note. (I really hate to be "that guy", especially as I don't necessarily agree with the policy, but I'm nicer about telling people.) :)


There's another similar one about asking questions about CURRENT, and other unsupported versions.

There are some good reasons for this--for example, if posts about CURRENT were allowed, people would start fighting here about decisions made for FreeBSD's future, but basically, the forum asks that for questions about GhostBSD, or other derivatives, you look to their forums, or whatever support they offer.

There are workarounds. If you make it an I hate Linux, so I'm using GhostBSD, I hate Linux threads will go on for 3 pages. :)
Or, even though it's sneaky, don't mention that you're asking about CURRENT, GhostBSD, etc.

However, note that in the post itself, the mods are kind enough to give ways to ask, assuming you meet some prerequisites. The other way is to rephrase the question, such as, I'm having this problem in GhostBSD, has anyone experienced the same in FreeBSD?
 
  • Thanks
Reactions: mtu
bsduck
That single line of code is looks very simple but since GhostBSD uses auto mount feature by default I am worried if I add that line to fstab it may make my system unbootable. I don't have the necessary knowledge to recover from that kind of a situation. So I will wait for someone who knows for sure how to deal with this.

scottro

https://forums.freebsd.org/threads/ghostbsd-pfsense-truenas-and-all-other-freebsd-derivatives.7290/

To show that you have indeed tried to get a solution from the forum or mailing list of the FreeBSD derivative in question, you may be asked to provide a link to a forum post or a mailing list message demonstrating that you asked the proper community for help first. You cannot expect the FreeBSD community to support all derivative and spin-off projects.

My username at GhostBSD forums is security_lover. This is my thread :

https://forums.ghostbsd.org/viewtopic.php?f=61&t=1934&p=9392#p939
 
Since you used chown with success (and not mount -u), I think the partition is mounted read-write. Your user just doesn't have the proper permissions to access /media.
 
Since you used chown with success (and not mount -u), I think the partition is mounted read-write. Your user just doesn't have the proper permissions to access /media.
Okay but why is the permission after reboot reverting back to root ? When I was using Linux after adding a partition to /etc/fstab & rebooting I couldn't write to that partition as a regular user so I used the chown command. The difference is under Linux I had to use the chown command just once & reboot. That's it. After that the regular user had read/write permissions.
 
There's a big difference between autofs and fstab, the latter being static. Once you chown the mount point it sticks until you change it.
With autofs, it mounts it according to devfs, auto_master and expects you to be in the wheel group.
If you read section 18.4.2 of the handbook, where it says -nosuid as a mount option in auto_master, you can add other mount commands like -m 777 to mount rw to everybody. Also -autoro might help. Thus it looks like this:
Code:
/media        -media        -nosuid, -autoro, -m=770
(Apologies, spacing killed by quoting)
 
If the data partition is on an internal disk, you should add it to /etc/fstab instead of letting an automounter handle it.

For example:
/dev/ada0p1 /choose/your/mount/point ufs rw 0 2

Otherwise check your automounter's settings, I don't know which one GhostBSD uses by default.
I unmounted the data partition then added it to fstab just like you suggested & finally rebooted.
Sadly it didn't work. Despite the entry in fstab GhostBSD is still auto mounting the partition.

Code:
> cat /etc/fstab
# Device        Mountpoint        FStype        Options    Dump Pass
procfs            /proc            procfs        rw        00
linprocfs        /compat/linux/proc    linprocfs    rw        00
tmpfs /compat/linux/dev/shm tmpfs rw,mode=1777 0 0
linsysfs /compat/linux/sys linsysfs rw 0 0
fdesc /dev/fd fdescfs rw 0 0
/dev/ada0p1 /home/bsd/spinning ufs     rw              0       2


Now I got 2 entries in my file manager (please see attachment).
When I click on the "spinning" which is the folder I created as a mount point for the partition I see an error message (please see attachment)

partition.png
partition error.png
 
Back
Top