Monday, April 29, 2024
 Popular · Latest · Hot · Upcoming
55
rated 0 times [  55] [ 0]  / answers: 1 / hits: 320436  / 1 Year ago, sun, january 1, 2023, 4:20:18

I know there are similar questions but I get some specific problem I can't overcome.


I have:



  • HDD split into two partitions. /dev/sdb1 and /dev/sdb2. sdb1 is NTFS and I don't need it. I need sdb2 which is fat32.

  • Ubuntu 12.04.1 LTS (server)


I want:


Ultimately I need a perma-mount /dev/sdb2 to /home/storage with access right (rw) for the user media.


Problems I'm facing:


Using manual mount from command line.


If I just use


server# sudo mount /dev/sdb2 /home/storage

It mounts but the /home/storage receives root as owner and group and doesn't allow media user to write there.


If I use mount command without sudo as the user media - i'm not allowed. Says only root can use mount.


If I use mount with options: server# sudo mount /dev/sdb2 /home/storage -o umask=000 I get what I need. A bit overdone of course, since the storage folder becomes writable for everyone. BUT - that is manually mounted - now i need it to remount on every reboot.


Remounting on reboot - using fstab**


So I thought I'll be fine if I use fstab to mount this partition (/dev/sdb2) every time i reboot. The fstab line I added:


UUID=8C52-C1CD /home/storage auto   user,umask=000,utf8,noauto  0   0

Got uuid with blkid. The fs type auto I changed a few times... I tried vfat too, but always on the reboot Ubuntu stops when processing fstab (I think) with the message (took from the log):


fsck from util-linux 2.20.1
/dev/sda5: clean, 120559/10969088 files, 19960144/43861504 blocks
mount: unknown filesystem type 'static'
mountall: mount /etc/fstab: [772] terminated with status 32
mountall: Filesystem could not be mounted: /etc/fstab:
Skipping /etc/fstab: at user request

And also - sudo mount -a never really does anything.


What am I doing wrong? I do suspect I messed up something:)


It seems fstab should hold only mounts for static drives, not any sort of usb stuff. I'm puzzled how then this works with all the people posting on the net their success stories...


However... if this is not possible - I would like to know how to remount my USB after every reboot... if not with fstab - then how? :)


More From » mount

 Answers
0

Your problem seems to be about the permissions you have set. FAT / FAT32 formatted drives don't support file permissions. The permissions for everything are determined by how the drive is mounted. When you set the permission open it worked when you



server# sudo mount /dev/sdb2 /home/storage -o umask=000


As for it not auto mounting on reboot



UUID=8C52-C1CD /home/storage auto user,umask=000,utf8, -->noauto<-- 0 0


The "noauto" makes this NOT automatically mount when the system starts and parses the /etc/fstab file. Remove that option and it will mount on startup. You can set the permissions on the mount point once it's mounted with chmod or specify them in /etc/fstab.



If you need the media user to access it, you can set the permissions to 764, and add them to the security group. Root always has access to everything.



see http://www.linux.org/threads/file-permissions-chmod.4094/ for some examples of propper file permissions



On a side note, bodhi.zazen made a good point
Is there some reason you need to use FAT ? If not, I would back up the data and use a linux native file system. You can then set ownership and permissions.


[#32847] Sunday, January 1, 2023, 1 Year  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
urvedcaly

Total Points: 171
Total Questions: 118
Total Answers: 124

Location: Cape Verde
Member since Fri, Nov 27, 2020
3 Years ago
;