MEPIS Community Forum

A Linux operating system based on Debian Stable
View unanswered posts | View unsolved topics | View active topics |



Reply to topic  [ 20 posts ]  Go to page Previous  1, 2
How to "share" a flash drive across multiple sessions? 
Author Message
MEPIS Guide
MEPIS Guide
User avatar

Joined: Thu Jul 26, 2007 2:40 am
Posts: 2037
Location: Bakersfield, CA
Has thanked: 25 times
Have thanks: 78 times
Post # 266963
Post Re: How to "share" a flash drive across multiple sessions?
SheridanR wrote:
Make sure automounting is on,


Are you talking about an entry in your fstab or something else?

_________________
Registered Linux User #380263
Registered Linux Computer #279395
Linux, working hard to save you $$$ - Get a clue, get Linux!
Intel Pentium D 2.80GHz
Intel Desktop Board D945GTP
Intel ICH7 Ethernet Controller
Intel ICH7 Audio
nVidia GeForce 6200 Video


Mon Mar 28, 2011 5:06 pm
Profile WWW
MEPIS Novice
MEPIS  Novice

Joined: Thu Mar 24, 2011 1:29 pm
Posts: 7
Has thanked: 0 time
Have thanks: 0 time
Post # 266976
Post Re: How to "share" a flash drive across multiple sessions?
Quote:
Are you talking about an entry in your fstab or something else?

When you plug a device into your computer, Mepis will first detect the device and then mount it automatically, under normal circumstances; that's what I'm talking about. I'm not talking about automatic mounting at boot.

EDIT: Unplugging the device and plugging it back in does not help. Mepis detects and mounts the device just fine; the problem has to do with who's mounting the device. Whatever user has logged into the computer first will auto mount the device and prevent any other user from writing to the device, even if the session corresponding to the first user is not being used.


Mon Mar 28, 2011 6:01 pm
Profile
MEPIS Guide
MEPIS Guide
User avatar

Joined: Thu Jul 26, 2007 2:40 am
Posts: 2037
Location: Bakersfield, CA
Has thanked: 25 times
Have thanks: 78 times
Post # 266983
Post Re: How to "share" a flash drive across multiple sessions?
SheridanR wrote:
Quote:
Are you talking about an entry in your fstab or something else?

When you plug a device into your computer, Mepis will first detect the device and then mount it automatically


Not on any of my Mepis installs, I have to first click on the drive to mount it.

Have you tried using kwikdisk to unmount the drive before switching user?

_________________
Registered Linux User #380263
Registered Linux Computer #279395
Linux, working hard to save you $$$ - Get a clue, get Linux!
Intel Pentium D 2.80GHz
Intel Desktop Board D945GTP
Intel ICH7 Ethernet Controller
Intel ICH7 Audio
nVidia GeForce 6200 Video


Mon Mar 28, 2011 6:27 pm
Profile WWW
MEPIS Guide
MEPIS Guide
User avatar

Joined: Thu Jul 26, 2007 2:40 am
Posts: 2037
Location: Bakersfield, CA
Has thanked: 25 times
Have thanks: 78 times
Post # 266984
Post Re: How to "share" a flash drive across multiple sessions?
Also, I'm starting to think you may have a fstab problem.

_________________
Registered Linux User #380263
Registered Linux Computer #279395
Linux, working hard to save you $$$ - Get a clue, get Linux!
Intel Pentium D 2.80GHz
Intel Desktop Board D945GTP
Intel ICH7 Ethernet Controller
Intel ICH7 Audio
nVidia GeForce 6200 Video


Mon Mar 28, 2011 6:29 pm
Profile WWW
MEPIS Guide
MEPIS Guide
User avatar

Joined: Sun Aug 06, 2006 3:02 pm
Posts: 2068
Location: New Zealand BOP
Has thanked: 42 times
Have thanks: 374 times
Post # 267033
Post Re: How to "share" a flash drive across multiple sessions?
SheridanR wrote:
Once again, I tried that method and it doesn't make any difference.

From the sounds of your reply, it doesn't appear that you have, or you forgot to say how far you'd gone in your quest. How much of my suggestion have you tried? So far, you only suggest you've tried changing the permissions on the folder in /media, without a single word regarding the device naming. Please re-read my suggestion and confirm/deny that you have done as I have prescribed.

In case you don't know what I am on about, unmount the device, fire up gparted, provide your root password, select the device from the drop down menu, right click on the devices partition and choose Label, then type a unique name that is less than 11 characters in length and without any spaces in the name, apply the changes, close gparted, unplug and replug the device, now it will be mounted with a device name, not a generic node which can be used by any device that "lands" in the corresponding position, and it is this name inside /media that I am referring to when the device is mounted.

I have about 11 flash drives, all of them have names that uniquely identify them, irrespective of what OS they are plugged into. The 2GB flash drives I use as bootable Live-Linux systems are labelled such that I have no doubt what drive is inserted and what it's purpose is. For example, 2GB_M11-32 is the name I give to my 32-bit bootable flash drive, 2GB_M11-64 is the name I give to my 64-bit bootable flash drive, both with the latest version, beta or other, of Mepis 11. My Parted Magic thumb drive is labelled PMAGIC510, the 510 refers to the version number and my two 8GB toolkit flash drives are labelled Mikes8Gi and Mikes8Ga, the last character tells me what brand of drive is installed.

The benefit of unique names is that when mounted into a unix-type system, the mount points for each will be totally unique and if I want, I can set different permissions for each mount point. If my drives had no partition name, I could plug in drive 1, it appears at /media/sdb1, I umount it, plug in drive 2, it appears at the same location, and so on for all 11. Does this help?

Mike P

_________________
Mike P

Regd Linux User #472293
(1)Lenovo e520, i7-2640M, 8GB, 750GB Seagate Hybrid, MX-14.1_DVD (my own respin)
(2) Asus M4A88TD-M, AMD Phenom II x4 955 CPU, Radeon HD 4250, 4Gb, 1.5TB, antiX-13-64


Tue Mar 29, 2011 4:14 am
Profile
MEPIS Novice
MEPIS  Novice

Joined: Thu Mar 24, 2011 1:29 pm
Posts: 7
Has thanked: 0 time
Have thanks: 0 time
Post # 267050
Post Re: How to "share" a flash drive across multiple sessions?
The flash drive is formatted as FAT32, and when I formatted the flash drive, I gave it a label. When I plug the flash drive into my Mepis box, it appears to use this name under the /media folder... But, it does not retain permission information and, for whatever reason, I can't change the label in gparted.

What do you think? Perhaps formatting the drive under FAT32 was a bad decision on my part?

Quote:
Have you tried using kwikdisk to unmount the drive before switching user?

Yup. When I unmount the device I can manually mount it on any other session I like, but I don't want to have to resort to silly manual solutions like that.


Tue Mar 29, 2011 10:48 am
Profile
MEPIS Guide
MEPIS Guide
User avatar

Joined: Thu Jul 26, 2007 2:40 am
Posts: 2037
Location: Bakersfield, CA
Has thanked: 25 times
Have thanks: 78 times
Post # 267057
Post Re: How to "share" a flash drive across multiple sessions?
SheridanR wrote:
When I unmount the device I can manually mount it on any other session I like, but I don't want to have to resort to silly manual solutions like that.


If you want the drive mounted all the time then put it in your fstab using its UUID, use blkid to get the UUID, make a folder in media with the same name as the one you use in fstab and then put it in fstab: UUID=D4E4-A1A7 /media/flash-drive auto auto,users,exec,relatime 0 0

By the way kwikdisk is not silly it's a tool I have been using for many years to mount and umount partitions that may or may not be auto mounted, if I'm searching my home folder for foo I can save time by unmounting my 2TB drive when I know that foo is not on that drive, also I don't auto mount partitions that have other systems on them, but if I want to look at a file on that system I can use kwikdisk to temporarily mount the drive, but if you want to use the console to mount and umount partitions that's fine with me.

_________________
Registered Linux User #380263
Registered Linux Computer #279395
Linux, working hard to save you $$$ - Get a clue, get Linux!
Intel Pentium D 2.80GHz
Intel Desktop Board D945GTP
Intel ICH7 Ethernet Controller
Intel ICH7 Audio
nVidia GeForce 6200 Video


Tue Mar 29, 2011 11:46 am
Profile WWW
MEPIS is cool!
MEPIS is cool!
User avatar

Joined: Thu Aug 17, 2006 7:56 am
Posts: 874
Location: Scotland
Has thanked: 87 times
Have thanks: 45 times
Post # 267114
Post Re: How to "share" a flash drive across multiple sessions?
SheridanR wrote:
Quote:
I think the automounting is the problem. I tried this yesterday and plugging in a flash drive pops up a dialog in any other sessions.

Yeah, I've determined the automounting is the problem; if I unmount the device on my session, then my sister can mount the device manually and use it normally. But we'd like to avoid such hassles.

Quote:
Alternatively, you may be able to fiddle with udev and alter the default permissions.

udev? You'll have to educate me on this command, I've never used it before.


I don't see how clicking an option on a pop-up is such a huge hassle? Clearly, with your user claiming the flash drive by automounting it the drive is then owned exclusively by that user. There's no way getting around that. You can relax the default permissions your user sets on the drive so that your sister can write to it, but that seems to be going against the strong permissions model in Linux IMO.

If you really want to go down that road, you could try to set the uid, gid or umask options in fstab (see the mount command for specifics).

Or there's udev. Udev is the system that manages removable media and works with a system of rules. You should find some already in /etc/udev. You should be able to use it to recognise the flash drive, mount it somewhere consistent and define default permissions for it. However, the syntax for doing that is unusual and quite painful to work with - although it could just be me. Try this link for more info:
http://reactivated.net/writing_udev_rules.html


Tue Mar 29, 2011 6:37 pm
Profile
MEPIS Enthusiast
MEPIS Enthusiast
User avatar

Joined: Wed Jul 12, 2006 5:54 am
Posts: 10314
Location: Tulsa, Oklahoma U.S.A.
Has thanked: 3247 times
Have thanks: 752 times
Post # 267862
Post Re: How to "share" a flash drive across multiple sessions?
SheridanR wrote:
The flash drive is formatted as FAT32, and when I formatted the flash drive, I gave it a label. When I plug the flash drive into my Mepis box, it appears to use this name under the /media folder... But, it does not retain permission information and, for whatever reason, I can't change the label in gparted.

What do you think? Perhaps formatting the drive under FAT32 was a bad decision on my part?

Quote:
Have you tried using kwikdisk to unmount the drive before switching user?

Yup. When I unmount the device I can manually mount it on any other session I like, but I don't want to have to resort to silly manual solutions like that.


Permissions don't work on FAT 32 formatted drives. Plus FAT 32 will not preserve them either. I believe NTSF would be a better choice if you need Windows accessibility. Or you could try one of the programs that allow Windows to see and use Ext2/3 etc.

_________________
Yes, even I am dishonest. Not in many ways, but in some. Forty-one, I think it is.
--Mark Twain


Mon Apr 04, 2011 5:28 am
Profile
MEPIS Novice
MEPIS  Novice

Joined: Thu Mar 24, 2011 1:29 pm
Posts: 7
Has thanked: 0 time
Have thanks: 0 time
Post # 268032
Post Re: How to "share" a flash drive across multiple sessions?
I've been very busy lately and haven't had the time to check back here, but now I'm back.

Thanks for all of your helpful advice; I think I'll look into my udev configuration files a bit, but if I can't find a solution there in a reasonable amount of time I'll just turn off auto mounting.

Thanks again for your help, I'll keep you updated on my progress.

EDIT: I messed around with udev for some time, but was unable to have it properly set permissions for removable flash drives. So, I did some more looking around online and found out that if I open "/home/<myuser>/.kde/share/config/medianotifierrc" and remove the lines regarding removeable drives, my system will not automount usb flash drives; however, mepis will still notify me with a popup whenever I plug a flash drive in. This solution satisfies me.

Once again, thank you all for your help.


Tue Apr 05, 2011 9:57 am
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 20 posts ]  Go to page Previous  1, 2

Who is online

Users browsing this forum: No registered users and 0 guests


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 post attachments in this forum

Search for:
Jump to:  

Protected by Anti-Spam ACP Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by STSoftware for PTF.