Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Flash drive mounts read only
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
shgadwa
Guru
Guru


Joined: 12 Mar 2009
Posts: 327

PostPosted: Thu Jan 28, 2010 2:15 pm    Post subject: Flash drive mounts read only Reply with quote

I've had this problem for a while now.

My flash drive does not mount unless I add a entry in /etc/fstab for it and then mount it manually as root. Then, when I do mount it... it mounts read only.

Any ideas?
Back to top
View user's profile Send private message
mikegpitt
Advocate
Advocate


Joined: 22 May 2004
Posts: 3224

PostPosted: Thu Jan 28, 2010 3:46 pm    Post subject: Reply with quote

A few questions...

1) How are you trying to mount the drive as a non-root user?

2) What is the filesystem of the flash drive?

3) Have you checked to make sure the physical read-only switch is flipped in the correct direction (assuming your drive has one)?

Also, can you post the output of:
1) `fdisk -l` (with the flash drive plugged in)
2) `cat /etc/fstab`
Back to top
View user's profile Send private message
shgadwa
Guru
Guru


Joined: 12 Mar 2009
Posts: 327

PostPosted: Fri Jan 29, 2010 12:09 pm    Post subject: Reply with quote

mikegpitt wrote:
A few questions...

1) How are you trying to mount the drive as a non-root user?

2) What is the filesystem of the flash drive?

3) Have you checked to make sure the physical read-only switch is flipped in the correct direction (assuming your drive has one)?

Also, can you post the output of:
1) `fdisk -l` (with the flash drive plugged in)
2) `cat /etc/fstab`


Its supposed to automatically mount and it does not do that. I try to mount it by clicking on it and it says I don't have permission and that only root can do that. I just tried it in the terminal with my user name and it said only root can do that. Its a FAT drive. It does not have a switch and it works flawlessly on Mac OS X and windows XP both read and write.

Code:
atlantis shawn # fdisk -l

Disk /dev/sda: 120.0 GB, 120034123776 bytes
255 heads, 63 sectors/track, 14593 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x119b2f60

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1               1           5       40131   83  Linux
/dev/sda2               6         371     2939895   82  Linux swap / Solaris
/dev/sda3             372        6073    45801315   83  Linux
/dev/sda4   *        6074       12801    54042660    7  HPFS/NTFS

Disk /dev/sdb: 16.0 GB, 16039018496 bytes
75 heads, 40 sectors/track, 10442 cylinders
Units = cylinders of 3000 * 512 = 1536000 bytes
Disk identifier: 0xc3072e18

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1   *           1       10443    15663084    c  W95 FAT32 (LBA)


Code:
atlantis shawn # cat /etc/fstab
# /etc/fstab: static file system information.
#
# noatime turns off atimes for increased performance (atimes normally aren't
# needed; notail increases performance of ReiserFS (at the expense of storage
# efficiency).  It's safe to drop the noatime options if you want and to
# switch between notail / tail freely.
#
# The root filesystem should have a pass number of either 0 or 1.
# All other filesystems should have a pass number of 0 or greater than 1.
#
# See the manpage fstab(5) for more information.
#

# <fs>         <mountpoint>   <type>      <opts>      <dump/pass>

# NOTE: If your BOOT partition is ReiserFS, add the notail option to opts.
/dev/sda1      /boot      ext2      noauto,noatime   1 2
/dev/sda3      /      ext4      noatime      0 1
/dev/sda2      none      swap      sw      0 0
/dev/sda4               /media/windows  ntfs-3g         defaults        0 0
/dev/cdrom      /media/CDROM   auto      noauto,ro   0 0
/dev/sdb1               /media/Shawn    auto            defaults        0 0

# glibc 2.2 and above expects tmpfs to be mounted at /dev/shm for
# POSIX shared memory (shm_open, shm_unlink).
# (tmpfs is a dynamically expandable/shrinkable ramdisk, and will
#  use almost no memory if not populated with files)
shm         /dev/shm   tmpfs      nodev,nosuid,noexec   0 0
#/squashed/usr/usr.sfs   /squashed/usr/ro   squashfs   loop,ro   0 0
#usr    /usr    aufs    udba=reval,br:/squashed/usr/rw:/squashed/usr/ro  0 0
chromium /home/shawn/.config/chromium tmpfs size=192M,noauto,user,exec,uid=1001,gid=100 0 0
Back to top
View user's profile Send private message
krinn
Watchman
Watchman


Joined: 02 May 2003
Posts: 7471

PostPosted: Fri Jan 29, 2010 3:52 pm    Post subject: Reply with quote

try
/dev/sdb1 /media/Shawn auto nodev,noexec,nosuid,rw,users,umask=007,gid=users
Back to top
View user's profile Send private message
shgadwa
Guru
Guru


Joined: 12 Mar 2009
Posts: 327

PostPosted: Fri Jan 29, 2010 4:33 pm    Post subject: Reply with quote

That did it! Thanks a lot!!

Now my only problem is automounting drives that are not in /etc/fstab... is that possible?
Back to top
View user's profile Send private message
krinn
Watchman
Watchman


Joined: 02 May 2003
Posts: 7471

PostPosted: Fri Jan 29, 2010 7:27 pm    Post subject: Reply with quote

udev is there for that.

for some general mount, i think gnome and kde should mount it themself without anything special to do.
Back to top
View user's profile Send private message
mikegpitt
Advocate
Advocate


Joined: 22 May 2004
Posts: 3224

PostPosted: Sat Jan 30, 2010 1:17 pm    Post subject: Reply with quote

I don't know in the case of Gnome and KDE, but having an entry in your fstab typically overides automounting. I would comment out that line to see if automounting works by default. If it doesn't, can you report back what automounter you are using? Personally I use halevt, which is a successor to ivman.
Back to top
View user's profile Send private message
shgadwa
Guru
Guru


Joined: 12 Mar 2009
Posts: 327

PostPosted: Mon Feb 01, 2010 1:36 am    Post subject: Reply with quote

Well, I just realized that I have the same problem with CD ROMS... should I use a different fstab entry for it or what?

Thanks a lot,
~Shawn
Back to top
View user's profile Send private message
mikegpitt
Advocate
Advocate


Joined: 22 May 2004
Posts: 3224

PostPosted: Mon Feb 01, 2010 5:02 am    Post subject: Reply with quote

belikeyeshua wrote:
Well, I just realized that I have the same problem with CD ROMS... should I use a different fstab entry for it or what?

Thanks a lot,
~Shawn
The CD-ROM won't automount with the entry in your fstab. If you want to add user mounting to the mix add the 'user' flag to the mount options:
Code:
/dev/cdrom             /mnt/cdrom      auto            noauto,ro,user  0 0
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum