LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices



Poll: filesystem managment the right way?
Poll Options
filesystem managment the right way?

You must log in and have one post to vote in this poll. If you don't have an account, you can register here.
Results will be available after the polls close.

The nominees are:

manual (mount as root or from fstab)
automatic (users can't/won't/don't know mount)
not important at all

Reply
 
Search this Thread
Old 04-25-2007, 08:19 AM   #46
rkelsen
Senior Member
 
Registered: Sep 2004
Distribution: slackware
Posts: 1,808

Rep: Reputation: 234Reputation: 234Reputation: 234

Quote:
Originally Posted by SCerovec
First I apologize for the loss of sleep to rkelsen
Sometimes you gotta do what you gotta do! Going to hit the sack early tonight though...
Quote:
Originally Posted by SCerovec
The question is, how would a newbie know to umount that from a GUI? It's supposed just to work.
It does. No mounting or unmounting on the user's behalf. Insert a USB storage device and an icon pops up on the desktop. Click that icon for access to the device. The icon is named according to the brand and model number. If it has more than one partition, you get more than one icon, each numbered with the partition number. Remove the USB device and all icons for that device disappear. All mounting & unmounting happens in the background. The user doesn't even have to know which device names or mountpoints are being used. I don't think it can get any easier than that for USB devices.

The cherry on the cake is that it is all dead simple. I didn't write the scripts. I just modified them to work with Slackware. No binaries, no bulldust, and the main script is less than 6 kilobytes. The dependancies are: udev, lockfile (from the procmail package) and run-parts (from the dcron package). That's it.

One thing which may be a drawback for some people is the necessity to be running KDE, but I can only assume that it wouldn't be too difficult to modify the scripts to work with XFCE (if they don't already), because I borrowed a few ideas from the VL-Hot scripts from VectorLinux which uses XFCE exclusively.

The only other problem (at least in my opinion) is that every device gets the same icon, but at least you can choose whichever icon you like.

Please check out the package I linked to towards the end of my previous post.
Quote:
Originally Posted by SCerovec
And OTOH the sync is quite depressing for its lack of speed for VFAT fs.
I haven't noticed this, although I did have a problem once. It turns out that I had compiled the low-speed USB driver as a kernel module, and this was making udev detect my USB sticks as /dev/ub*, which makes them work painfully slow. They're a lot faster being detected as /dev/sd*
 
Old 04-25-2007, 12:22 PM   #47
gnashley
Amigo developer
 
Registered: Dec 2003
Location: Germany
Distribution: Slackware
Posts: 4,775

Rep: Reputation: 481Reputation: 481Reputation: 481Reputation: 481Reputation: 481
You really need to have a way for the user to 'safely remove device' by unmounting all mounted partitions. Otherwise there may be data loss. Since the udev or hotplug programs run as root it is no prblem to 'unmount -l' the partitions whnever the USB 'remove' ACTION is triggered. But even with sync mount option we can't know that the buffers are flushed. (Trying to unmount while the device is already being synced would probably hang things up as well.

Steve, I purposely left holes in my code to merge some of your code in. I think the idea deserves some cooperative work and particularly testing.

Most of the unaddressed areas that the usbmount homepage mentions are exactly what I have addressed. The best way to imagine the functionality of my code is as if it were running on an internet cafe computer. It's setup to recognize and mount any USB device you plug in. No fstab entry is neccessary, but if found then those mount options are used. I left this very simple using the /dev/sd?? as the key identifier. Steve has addressed the options here more -the best idea as mentioned by rkelson is to use the PRODUCT/partition number as the identifier. My code includes some minimal conf options for general mount options, but Steve has covered this more. I was first concerned with getting really bullet-proof mount routines. I used blkid in my code also and found some critical stuff that needs to be done for proper dynamic device ID's. The problem is that pluggin in different devices one after the other would lave stale entries in /etc/blkid.tab.
Also, mounting reiserfs(and perhaps other journalled fs) can cause problems. The GUI icons I am using are just a modified xtdektop. I also show xmessage text prompts and messages. I spent a lot of time working on code that identifies the user(the GUI includes a requester program) and getting su/sudo to properly start/stop/interrupt programs on the users desktop. This still doesn't work completely right(for the GUI).
As for mount-points -I currently just mount everything under a subdir of /mnt. But I mount the device on a real directory and then create a link to it with the PRODUCT as part of its' path. This just needs to be changed to do it the other way so that the link would be the simple device name and the real mount point with the PRODUCT name. That way if there is an entry for thsi PRODUCT/part in the fstab, the direcxtroy could be left in place. I currently remove both the directory and the link, but this all easily changed and made configurable by Steve's code.

Steve, the main thing to get our code together is properly divide the functionality into main areas -I believe we've got most of what we need for the mounting and options code. You've worked out event detection for 2.6 and I've done it for 2.4. I think that pulling the two into a single set of bins will not be difficult.(Where my usb-hotmount gets called by hotplug, yours gets called by udev. BTW, about your question above (broken udev code) from what I understand you might should be using a udev.helper program instead of an entry in udev.rules. This avoids your package having to write to files installed by the distro. I use an /etc/rc.usbwatch file, but only as a 'flag' so that you can turn it off. This would serve to hook into the init scripts to figure out which kernel we are using and run the proper code.
My code which allows users to own/mount/unmount does use a new group and GID.
I had in mind to keep the GUI notification code separately so it could also be configurable. Remeber I have two going. Actually I also set it up using idesk -but refreshing the icons blinks the whole desktop -yuucck.
My icons are themeable, but not from config file. And I use different icons according to the file-system type and whether it is mountd or unmounted. I actually cut down the number of possibilties and theming in order to simplifiy the code at first. I really dont mind the Xlibs icons, but it would be nice to use nicer widgets for pop-up menus and notification windows.

Sorry if I get confusing -I've had a major surgery 2 weeks ago and still not doing very well, so it's hard to organize my thoughts well.
 
Old 04-25-2007, 07:14 PM   #48
rkelsen
Senior Member
 
Registered: Sep 2004
Distribution: slackware
Posts: 1,808

Rep: Reputation: 234Reputation: 234Reputation: 234
Quote:
Originally Posted by gnashley
You really need to have a way for the user to 'safely remove device' by unmounting all mounted partitions. Otherwise there may be data loss.
Which is why I have added the right-click option, "Prepare for Removal," which runs the 'sync' command. As long as you wait until the light on the USB device is off after doing this, there is very little risk of data loss.
Quote:
Originally Posted by gnashley
Sorry if I get confusing -I've had a major surgery 2 weeks ago and still not doing very well, so it's hard to organize my thoughts well.
Hey Gnashley, the most important thing is your health mate. Look after yourself first. I wish you a speedy recovery.

Last edited by rkelsen; 04-26-2007 at 03:37 AM.
 
Old 04-26-2007, 04:42 AM   #49
SCerovec
Member
 
Registered: Oct 2006
Location: Cp6uja
Distribution: Slackware x86 and ARM and Porteus
Posts: 655

Original Poster
Rep: Reputation: 45
Lightbulb Getting closer...

@gnashley
buddy, I wish You a fast health recovery.

Quote:
Originally Posted by gnashley
You really need to have a way for the user to 'safely remove device' by unmounting all mounted partitions. Otherwise there may be data loss. Since the udev or hotplug programs run as root it is no prblem to 'unmount -l' the partitions whnever the USB 'remove' ACTION is triggered. But even with sync mount option we can't know that the buffers are flushed. (Trying to unmount while the device is already being synced would probably hang things up as well.
I agree, there simple are flash-keys that are 'lit' all the time, so it's hard to tell when they are idling... There are the other ones without any light too. ;-)
Quote:
Steve, I purposely left holes in my code to merge some of your code in. I think the idea deserves some cooperative work and particularly testing.
1. We should discuss (vote?) the name options first.
2. The way of interoperation - use of .conf files is to be determined - shared or not?
3. The way of initialization
4. The places of deployment of the managers and files
5. The way of publishing

My suggestions (so far):
1.a. ears - Easy Access Removable Storages
1.b. departman - DEtachable PARTition MANager
1.c. OSmount - OS mount :-)

2.I would suggest separate udev.*.conf and hotplug.*.conf files in a subidir in /etc/ and a shared fstab.conf for the sake of simplicity and control

3. It should be initialized 'en-mass' some way, not by patching rc.local ...

4. The managers should reside on /usr/sbin and a log would be handy in /var/<progname>.log

5. We could publish on SFnet, on personal servers or LP.net or all of it together. We had (at least I) to learn some sort of cvs?
Quote:
Sorry if I get confusing -I've had a major surgery 2 weeks ago and still not doing very well, so it's hard to organize my thoughts well.
Just You recover in peace pall. Once You back in the saddle, we gladly come back on you :-) for this (kidding).
 
  


Reply

Tags
administration, automation, filesystems


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
scan hot plug drives support !! vinay_r99 Linux - Hardware 5 07-08-2008 01:10 AM
USB device hot plug failed sometime raytzer_liao Linux - Hardware 1 06-08-2006 01:31 PM
Beta testing Beta 8 -- Boot Loader screws up 1kyle Suse/Novell 0 03-27-2006 04:36 AM
How to turn off hot plug?? msulik1 Linux - Laptop and Netbook 1 02-07-2006 02:42 PM
USB Hot Plug Problems... reply2vinay Linux - Hardware 1 07-22-2005 09:44 AM


All times are GMT -5. The time now is 06:11 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration