Slackware This Forum is for the discussion of Slackware Linux.
|
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.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
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.
|
 |
03-08-2006, 05:00 PM
|
#1
|
Member
Registered: Mar 2006
Posts: 30
Rep:
|
Missing "Safely Remove"
I dug through this forum in hopes to get my ipod running. I got it, and everything is working fine. Does anyone know how to add the command "Safely Remove" to the menu that pops up when I right click the sda2 icon in X? I've been running the eject command from the "run command" dialogue and that works fine. I know i'm being picky, this is more of a learning experience. Here is the line from my fstab file, maybe the issue lies here.
Code:
/dev/sda2 /mnt/ipod vfat noauto,users,rw,umask=1000 0 0
also, I get an error during my shudown script that says something like "warning! no last line in fstab file" (not word for word!) Maybe thats another clue.
|
|
|
03-08-2006, 05:26 PM
|
#2
|
LQ Newbie
Registered: Feb 2006
Distribution: Slackware
Posts: 11
Rep:
|
I'll assume you are using KDE...
An easy way for you to 'Safely remove' your IPOD is to create a desktop link to it. To do this, right click, new, link to device. In the device tab, make sure you have switched it to /dev/sda2 (your IPOD). Then, all you have to do when you want to mount it is click your shortcut, and right click it and press 'Unmount' to safely remove it.
About the 'No final line.'. I used to get this message to. Just add a blank line at the end of your /etc/fstab file.
|
|
|
03-08-2006, 05:28 PM
|
#3
|
Senior Member
Registered: Oct 2003
Location: lost in the midwest...
Distribution: Slackware
Posts: 1,098
Rep:
|
in a terminal, you can use umount /dev/sda2. i use rox filer, and that offers the ability to unmount drives such as flash drives and such...don't know if thats something you're interested in.
|
|
|
03-08-2006, 06:05 PM
|
#4
|
Member
Registered: Mar 2006
Posts: 30
Original Poster
Rep:
|
Yeah, use that command. It works great for my flash drive, but my ipod requires a "safely remove" command such as eject.
|
|
|
03-16-2006, 11:23 PM
|
#5
|
Member
Registered: Mar 2006
Posts: 30
Original Poster
Rep:
|
Under KDE the eject command works fine logged on as root, but when i try to eject from another user, it wont do it. I've been typing the eject command the "run command" box. Now as a regular user I have to open the terminal, su, then eject. This works fine, but is there a way to grant that right to my users?
|
|
|
03-16-2006, 11:33 PM
|
#6
|
Member
Registered: Aug 2005
Location: Bay
Distribution: Zenwalk, OpenBSD, Slackware
Posts: 167
Rep:
|
Install Linux on it, maybe that requirement will go away.
Joking.
Change your 'users' to 'user' in /etc/fstab.
Last edited by sweetnsourbkr; 03-16-2006 at 11:35 PM.
|
|
|
03-17-2006, 12:27 AM
|
#7
|
Amigo developer
Registered: Dec 2003
Location: Germany
Distribution: Slackware
Posts: 4,928
|
All that eject does is run 'unmount' and then try to open the door of the device in question. Of course your iPod has no door...
However, since USB transfers are cached, sometimes unmounting the device will take awhile -until everything is written to the device. So, if you create a shortcut for the unmount command, you should have it run in an xterm so you can see the output and know for sure that it's 'safe' to remove.
|
|
|
03-17-2006, 01:55 PM
|
#8
|
Member
Registered: Mar 2006
Posts: 30
Original Poster
Rep:
|
unmounting is no problem. The bottom line is that after a standard umount /dev/sda2, the ipod itself still says "Do Not Disconnect." As root, running the eject command removes that message from the ipod. Here is a bit of info that might help. My system labels the icon "Hard Disk (sda2)."
|
|
|
03-17-2006, 03:46 PM
|
#9
|
Senior Member
Registered: Nov 2002
Location: Stockton, CA
Distribution: Slackware 11 - kernel 2.6.19.1 - Dropline Gnome 2.16.2
Posts: 1,132
Rep:
|
I believe the eject command also syncs all data transfers. Handy, since USB transfers are usually done async.
Regardless, the eject command is needed to get the "Do Not Disconnect" message to go away on the iPod.
A simple method for doing this as a user is to make eject SUID. This has security implications, so doi so at your own risk.
Another method would be to configure custom UDEV rules so that the iPod (the whole thing, not just the data partition) has the proper permissions to allow users to eject it.
I use the first method, but the second is probably a better choice. I just haven't bothered with coming up with the rule.
|
|
|
03-17-2006, 04:30 PM
|
#10
|
Member
Registered: Mar 2006
Posts: 30
Original Poster
Rep:
|
Awesome. where do i change udev rules?
|
|
|
03-17-2006, 04:42 PM
|
#11
|
Senior Member
Registered: Nov 2002
Location: Stockton, CA
Distribution: Slackware 11 - kernel 2.6.19.1 - Dropline Gnome 2.16.2
Posts: 1,132
Rep:
|
Create a file for custom udev rules:
/etc/udev/rules.d/local.rules
Changing eject to SUID is easier (if you don't want to bother creating a rule), though:
Code:
chmod +s /usr/bin/eject
|
|
|
03-18-2006, 10:55 AM
|
#12
|
Member
Registered: Mar 2006
Posts: 30
Original Poster
Rep:
|
In an attempt to learn what I'm doing rather than just following code I pick up from this site, I have to ask what exactly that line means (chmod +s). Could you break it down for me?
|
|
|
03-18-2006, 12:37 PM
|
#13
|
Senior Member
Registered: Nov 2002
Location: Stockton, CA
Distribution: Slackware 11 - kernel 2.6.19.1 - Dropline Gnome 2.16.2
Posts: 1,132
Rep:
|
A great way to learn what it means is:
It's a fairly straight forward read.
To sum it up, "chmod" is the "change mode" AKA "change permissions" command. The "+" means "add the following permissions". The "s" means "set user ID" AKA "make it SUID". The final part, "/usr/bin/eject" is the file/program that is being changed.
If you don't know what SUID means, it means that after running this command, any time /usr/bin/eject is run, it is run as root. That is why the permission error goes away. That is also why this can be viewed as a security hazard. If running a program SUID, someone may be able to exploit a flaw in the program to spawn a new shell. That shell would of course be a root shell.
Using UDEV to set appropriate permissions would avoid this possible issue. I am pretty sure that would be all that's needed, though it depends on your system. If you are running HAL, you may also need to tweak an .fdi file.
Myself, I just use the SUID solution.
Bonus tip: The eject command included with Slackware tends to throw an error (deprecated SCSI I/O control). This can be solved by compiling the newest eject from source and copying it over the stock version.
The only issue that I have had so far is that sometimes, after extended writes to the iPod, the eject will still fail. Not sure if this is a sync issue or what. In my experience, though, this means that FAT formatted iPods are better suited to Linux that HFS+ formatted iPods. I say this because there are more correction tools for FAT. If the HFS+ filesystem becomes corrupt due to early unplugging, you end up only being able to mount the iPod read-only.
|
|
|
03-19-2006, 10:59 PM
|
#14
|
Senior Member
Registered: Jul 2005
Distribution: Slackware
Posts: 2,012
Rep: 
|
Somewhat related to this is the little light on the usb thumb drive. Does anybody here know how to turn those off? eject doesn't work.
|
|
|
All times are GMT -5. The time now is 06:56 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|