Fedora Linux Support Community & Resources Center

Go Back   FedoraForum.org > Fedora 17/18 > Using Fedora
FedoraForum Search

Forgot Password? Join Us!

Using Fedora General support for current versions. Ask questions about Fedora and it's software that do not belong in any other forum.

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 1st April 2009, 04:47 PM
gdr01 Offline
Registered User
 
Join Date: Jan 2009
Location: Livingston, Scotland
Posts: 52
ext2 fs on usb memory stick - not user writeable

Fedora 10

I have a usb memory stick that I partitioned and formatted as an ext2 filesystem.
I have created a line in fstab to mount it in my home directory.

LABEL=Lexar-256 /home/gordon/usbstik ext2 rw,noatime,user 0 0

When I insert the mem stick into the usb port it mounts ok in my home directory
but I have no write permissions and the directory (usbstik) now belongs to root.

The output of the mount command shows

/dev/sdf1 on /home/gordon/usbstik type ext2 (rw,noexec,nosuid,nodev,noatime,user=gordon)

As a user I can mount and umount the device but cannot write to it.

If a memory stick filesystem is vfat the permissions set are different from when the filesystem is ext2 and I can write to it.

I suspect that the udev rules are doing this but cannout seem to find where
these mount permissions are set.

Any advice?
Reply With Quote
  #2  
Old 1st April 2009, 09:58 PM
sidebrnz's Avatar
sidebrnz Online
Registered User
 
Join Date: Oct 2007
Location: Freedonia
Age: 63
Posts: 2,104
Try changing rw to umask=0000 and see if it helps. I know it works for mounting Windows partitions on hard drives, so it should do the same here.
__________________
Registered Linux user #470359 and permanently recovered BOFH.

Any advice in this post is worth exactly what you paid for it.
Reply With Quote
  #3  
Old 2nd April 2009, 03:23 PM
gdr01 Offline
Registered User
 
Join Date: Jan 2009
Location: Livingston, Scotland
Posts: 52
Tried that and get window with message

Cannot Mount volume
Invalid mount option when attempting to mount the volume 'Lexar-256'.

--
It does show in Nautilus but if I click on it get error message

DBus error org.freedesktop.DBus.Error.NoReply: Did not receive a reply.
Possible causes include: the remote application did not send a reply, the
message bus security policy blocked the reply, the reply timeout expired, or
the network connection was broken.
Reply With Quote
  #4  
Old 2nd April 2009, 04:49 PM
sidebrnz's Avatar
sidebrnz Online
Registered User
 
Join Date: Oct 2007
Location: Freedonia
Age: 63
Posts: 2,104
Odd. However, I'm wondering why you formatted the drive as ext2, instead of leaving it with the default of vfat?
__________________
Registered Linux user #470359 and permanently recovered BOFH.

Any advice in this post is worth exactly what you paid for it.
Reply With Quote
  #5  
Old 2nd April 2009, 10:32 PM
gdr01 Offline
Registered User
 
Join Date: Jan 2009
Location: Livingston, Scotland
Posts: 52
I was reading about Tom-Tom versus MS and thought I would move away from MS a bit more. I found out (but have not tried yet) that ext2 can be used on XP so I thought I would give it a whirl and got sucked into some weird and unexpected results. A bit like PabloTwo and "one to put in the weird jar". I have (maybe had) a good understanding of volumes and groups and lvm as I worked for several years on AIX and partitioned many disks so I was quite taken aback when my wee memory stick misbehaved.
As with any linux problem it entailed lots of reading and I have a better understanding of udev and its rules now and learnt some new commands like tune2fs - a clever utility.

I have just got it working and am trying to document it, to add to this thread.
Reply With Quote
  #6  
Old 2nd April 2009, 10:34 PM
marko's Avatar
marko Offline
Registered User
 
Join Date: Jun 2004
Location: Laurel, MD USA
Posts: 5,442
I usually insert the new key, and when it's mounted, I use chown via root to set that mount point as owned by me. Somehow that sticks even after the key is later removed and reinserted. I'm guessing udev hides that info away somewhere.
Reply With Quote
  #7  
Old 2nd April 2009, 10:50 PM
gdr01 Offline
Registered User
 
Join Date: Jan 2009
Location: Livingston, Scotland
Posts: 52
Hi Marko

yes i finally tried that too and cant figure out why it works.

thanks for the input
-------------------

My usb / ext2 memory stick fix

Started from scratch and did everything from the command line. I initially used gparted but got strange results.
Use fdisk and delete all partitions – boy did it have some strange ones.
Use mke2fs to format. First time I tried mke2fs.ext2 but I had funnies.
Insert usb memory stick and use dmesg or mount to determine device. Normally /dev/sd??

As root
umount /dev/sd??
fdisk /dev/sd? - leave off number – that's the partition
delete all current partitions – starting with the highest - and create 1 new primary one.
fdisk -l /dev/sd? -- You will see your new partition - Unfortunately it does not show the Label

better still try
cfdisk /dev/sd? -- get a nice layout with name fstype size etc.
note no label is set -- will set it at format time.

mke2fs -t ext2 -L <your label> /dev/sd?1 – note the '1' – this is first partition

this will format the memory stick as an ext2 file system and create the label which you will use in /etc/fstab

try cfdisk /dev/sd? again and note the label.

Edit /etc/fstab and add

LABEL=<your label> /home/<user>/<your label> ext2 rw,noatime,user 0 0



exit root

as user create the directory /home/<user><your label>

pull the mem stick out and re-insert it.

You should get an icon on your desktop and a line in nautilus with the label you created.
Type
mount -- it will show all
ls -l <user><your label>

Now the first time I did this the <user><your label> directory I created in my user directory switched
to being owned by root. So as root I

chown user:user <your label> directory

after that the user retained ownership.

I hope I got all the steps correct. I did this twice with 2 different memory sticks a Lexar jump drive 256Mb and a
bytestor 1gig memory stick. Oh and they were both on a Genesys Logic, Inc. USB-2.0 4-Port HUB.

Once you have them working try
lsusb -- note how they retain their manufacturers ID

tune2fs -l /dev/sd?1
-- note the filesystem volume name or 'label'

I also set the number of times a mount is allowed lower so that the filesystem is checked more often with e2fsck

tune2fs -c 3 /dev/sd?1

Last edited by gdr01; 2nd April 2009 at 10:54 PM. Reason: ..
Reply With Quote
Reply

Tags
ext2, memory, stick, usb, user, writeable

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
SD and Memory Stick rikardote Hardware & Laptops 4 25th June 2008 01:09 AM


Current GMT-time: 22:19 (Saturday, 18-05-2013)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive
logo

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat