Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
The last line, I have put in. The USB flash is formatted with FAT.
After restart of computer, the USB flash is not availeble. If I go to terminal and log in as root, and follow it up by typing "mount -t vfat /dev/sda1 /mnt/usbflash", I can afterwards open my USB flash.
Could a friendly soul please help me, what to alter in the last line of FSTAB.
add 'users' to your mount options to allow non-root users to mount the drive. Also make sure the permissions are set correctly on the '/mnt/usbflash' folder. Also, were you wanting to mount this read-only? Your umask options are set for this.
Try it like this if you want a specific user to write to this drive:
add 'users' to your mount options to allow non-root users to mount the drive. Also make sure the permissions are set correctly on the '/mnt/usbflash' folder. Also, were you wanting to mount this read-only? Your umask options are set for this.
Try it like this if you want a specific user to write to this drive:
The "chown username.users /mnt/usbflash" reported something like "operation not allowed". The folowing reported the same, "chown hp.users /mnt/usbflash" and "chmod hp.users /mnt/usbflash"
The "chown username.users /mnt/usbflash" reported something like "operation not allowed". The folowing reported the same, "chown hp.users /mnt/usbflash" and "chmod hp.users /mnt/usbflash"
The '#' before the command indicates that it must be run as root. Is that what you did? You also need to make sure this is done before mounting. Switch over to root with 'su' then run
ok thanks!!it mounts my flash drive!!
for the first time
but!!!
when i'm plugging it out end then plugging in back can't read it!!
here what i've got:
root@gnom: /home/gnom# umount /mnt/usbflash
umount: /mnt/usbflash: device is busy
umount: /mnt/usbflash: device is busy
root@gnom:/home/gnom# mount -a -t vfat /dev/sda1 /mnt/usbflash -o user,exec,dev,suid,rw,umask=000
mount: special device /dev/sda1 does not exist
root@gnom:/home/gnom#
Well first off, make sure you ‘unmount’ the device before pulling it out or your Linux box will hate you for it.
Quote:
root@gnom: /home/gnom# umount /mnt/usbflash
umount: /mnt/usbflash: device is busy
umount: /mnt/usbflash: device is busy
If you did not already pull the device out and you still get this error, it means you have a file or directory on the device open. ‘fuser –k /mnt/usbflash’ should take care of that. Once you killed any processes using the device, umount it like normal then remove the device.
Quote:
root@gnom:/home/gnom# mount -a -t vfat /dev/sda1 /mnt/usbflash -o user,exec,dev,suid,rw,umask=000
mount: special device /dev/sda1 does not exist
root@gnom:/home/gnom#
A couple things may cause this. The problem with removable devices is the system device that points to it could change based on what else you have plugged into your usb ports. For instance, if you take your flash device out, then plug something in like an ipod, then plug in your flash device back in; the ipod will get /dev/sda1 and the and the flash device will get the next available /dev/sda2.
If you are using udev with a 2.6 kernel to handle the device creation, most of this stuff should be handled pretty automatically. All you need to do is A) make sure you un-mount before pulling out the device, and b) plug things in the same order and location (usb port) that you did when you created the /etc/fstab. This way it should create the same device name every time.
ok thanks for reply!!i'll try it,
but where is the sense of automount if i need to type command for unmounting?is there any way not to type comands and to make my linux box to do it automatically?? automount and auto unmount??
yes, you could write a bash script that automatically mounts the drive when it detects the device file is created by udev, and automatically destroys the device file when the flash drive is removed. Although I wouldn't recommend doing the later unless you really know what you're doing. It would be better just to do 'umount /mnt/usbflash' when you are done using it.
You can use autofs to auto-mount your usb stick. So there is no need to manually (or via /etc/fstab) mount it and you cat unplug it when you want without the need to unmount it first. Take a look here for details.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.