mount usb drive read-only fedora 16
How can I mount my usb drive to be read only. I´ve been going through various documentation and it is a bit confusing, dont know if it is because fedora 16 does things differently or what. Where I am now is that I think its my fstab file I have to configure but the options in it are all set to defaults. The default is r/w. And even though my usb drive mounts automatically it dosnt add an entry to fstab instead it is set in something called by-label.
The reason why im doing this is because im configuring aide and my aide.conf file is going to be on this usb drive as my database. |
Mounting removable drives (USB, CD) to /media/DEVICENAME is managed by gnome-volume-manager. Look for its documentation. You can disable that manager and mount from command line when standard /etc/fstab works.
see http://www.linuxforums.org/forum/red...-usb-disk.html http://www.togaware.com/linux/surviv...e_Manager.html http://www.cyberciti.biz/faq/disable...-automounting/ |
Adding an entry in /etc/fstab, the system should obey the mount options and mount location, even when automounting. Use the UUID value in the first device field. Use the noauto option to allow the system to boot up without the drive being present.
Try first letting it automount. Base the fstab entry on the current mtab entry, or mount command output. Here is an example from my fstab: Code:
UUID=266D-3D87 /mnt/disk vfat rw,nosuid,nodev,noexec,relatime,uid=1000,gid=1000,fmask=0022,dmask=0077,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro,owner,user,helper=udisk |
this is what ive done
Here is what I wrote in my fstab:
Code:
/dev/sdc1 /media/PENDRIVE vfat r,user,owner,comment 0 0 Code:
Error |
It means directory /media/PENDRIVE doesn't exist. Create it using command 'mkdir /media/PENDRIVE'. I don't know if mount command can create empty directory (mountpoint) itself.
|
It would be better to use the UUID since you don't know which device will be used. Also, you want your options to apply to a particular filesystem, not any USB drive.
|
solved
Quote:
find UUID Code:
ls -l /dev/disk/by-uuid Code:
UUID=0000-0000 /media/PENDRIVE/usb1 vfat ro,noauto,user,owner,noexec 0 0 Make mountpoint sudo mkdir /media/PENDRIVE/usb1 manual mounting of the pendrive: Code:
sudo mount /media/PENDRIVE/usb1 Thank you so much for your reply's |
It hasn't worked with the traditional methods, so I guess there is no way around gnome-volume-manager, it seems it overwrites what I've done so far.
I guess I need to dig the net for some instructions on usage..... :-( http://linuxtidbits.wordpress.com/20...-to-play-nice/ |
Quote:
As I understand it the gnome-volume-manager manages tweaks for all kinds of programs, so if I disable it to manage mounting manually it will disable the settings for everything else it manages. |
Maybe solved
Quote:
I think it has something to with that gnome-volume-manager thinks it owns the /media mountpoint so I've changed it to /mnt. It seems to work but I'l give it some days to see before I believe it. find UUID Code:
ls -l /dev/disk/by-uuid Code:
sudo mkdir /mnt/PENDRIVE Code:
UUID=25E9-3553 /mnt/PENDRIVE/usb1 vfat ro,noauto,nodev,noexec,uid=1000,gid=1000,user,owner,comment,noexec 0 0 Code:
sudo mount /mnt/PENDRIVE/usb1 |
The code is working on Fedora 17, my Fedora 16 is offline, and this post was working on my Fedora 16
Quote:
|
All times are GMT -5. The time now is 11:44 PM. |