LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices

Reply
 
Search this Thread
Old 03-08-2006, 05:00 PM   #1
drummerdan
Member
 
Registered: Mar 2006
Posts: 30

Rep: Reputation: 15
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.
 
Old 03-08-2006, 05:26 PM   #2
Patz2009
LQ Newbie
 
Registered: Feb 2006
Distribution: Slackware
Posts: 11

Rep: Reputation: 0
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.
 
Old 03-08-2006, 05:28 PM   #3
detpenguin
Senior Member
 
Registered: Oct 2003
Location: lost in the midwest...
Distribution: Slackware
Posts: 1,091

Rep: Reputation: 45
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.
 
Old 03-08-2006, 06:05 PM   #4
drummerdan
Member
 
Registered: Mar 2006
Posts: 30

Original Poster
Rep: Reputation: 15
Yeah, use that command. It works great for my flash drive, but my ipod requires a "safely remove" command such as eject.
 
Old 03-16-2006, 11:23 PM   #5
drummerdan
Member
 
Registered: Mar 2006
Posts: 30

Original Poster
Rep: Reputation: 15
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?
 
Old 03-16-2006, 11:33 PM   #6
sweetnsourbkr
Member
 
Registered: Aug 2005
Location: Bay
Distribution: Zenwalk, OpenBSD, Slackware
Posts: 167

Rep: Reputation: 30
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.
 
Old 03-17-2006, 12:27 AM   #7
gnashley
Amigo developer
 
Registered: Dec 2003
Location: Germany
Distribution: Slackware
Posts: 4,749

Rep: Reputation: 461Reputation: 461Reputation: 461Reputation: 461Reputation: 461
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.
 
Old 03-17-2006, 01:55 PM   #8
drummerdan
Member
 
Registered: Mar 2006
Posts: 30

Original Poster
Rep: Reputation: 15
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)."
 
Old 03-17-2006, 03:46 PM   #9
shilo
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: Reputation: 49
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.
 
Old 03-17-2006, 04:30 PM   #10
drummerdan
Member
 
Registered: Mar 2006
Posts: 30

Original Poster
Rep: Reputation: 15
Awesome. where do i change udev rules?
 
Old 03-17-2006, 04:42 PM   #11
shilo
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: Reputation: 49
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
 
Old 03-18-2006, 10:55 AM   #12
drummerdan
Member
 
Registered: Mar 2006
Posts: 30

Original Poster
Rep: Reputation: 15
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?
 
Old 03-18-2006, 12:37 PM   #13
shilo
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: Reputation: 49
A great way to learn what it means is:

Code:
man chmod
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.
 
Old 03-19-2006, 10:59 PM   #14
tuxdev
Senior Member
 
Registered: Jul 2005
Distribution: Slackware
Posts: 2,011

Rep: Reputation: 110Reputation: 110
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.
 
  


Reply


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
"Xlib: extension "XFree86-DRI" missing on display ":0.0"." zaps Linux - Games 9 05-14-2007 03:07 PM
Video Card Nvidia Driver Xlib: extension "GLX" missing on display ":0.0". HELP! badgerbox76 Linux - Newbie 35 03-08-2007 02:27 AM
Video Card Nvidia Driver Xlib: extension "GLX" missing on display ":0.0". badgerbox76 Linux - Games 13 01-11-2006 04:47 PM
Can't "Safely Remove" usb stick: KDE, SUSE 10.0 m29389 Suse/Novell 8 11-15-2005 11:35 PM


All times are GMT -5. The time now is 03:24 AM.

Main Menu
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