LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu
User Name
Password
Ubuntu This forum is for the discussion of Ubuntu Linux.

Notices


Reply
  Search this Thread
Old 08-12-2010, 08:36 AM   #1
mfdarwin
LQ Newbie
 
Registered: Aug 2010
Posts: 7

Rep: Reputation: 0
Safely remove SD cards


I am running Ubuntu 10.04 on an old machine, leaving the new machine with Vista to my wife. I have hardly used windows, apart from work, since.

My problem occurs when downloading and editing photos. I can usually use UFRAW and import into GIMP, although not save from UFRAW. But then I wish to remove the SD card. I have tried safely removing and unmounting, I don't know why they are sometimes both there and sometimes just one, but trying to unmount gives

Unable to unmount USB0
umount: /media/usb0 is not in the fstab (and you are not root)

I was looking at other threads about logging in as root and I agree I shouldn't, but I also don't think it is good to just pull out the SD card or have to shut down the machine just to remove it.

I have had similar problems with copying music - I don't have root privileges.

I don't see why I need root privileges, and I don't want a terminal solution, and I don't really want to login as root for everything.

Any suggestions?
 
Old 08-12-2010, 11:08 AM   #2
pljvaldez
LQ Guru
 
Registered: Dec 2005
Location: Somewhere on the String
Distribution: Debian Wheezy (x86)
Posts: 6,094

Rep: Reputation: 281Reputation: 281Reputation: 281
You can unmount by using sudo umount /dev/sdXX or sudo umount /media/usb0. You just have to find the mount point (hint: try df -h). Sudo gives you temporary root privileges for just such an occasion.

EDIT: sorry, I just finished reading you don't want a terminal solution. Try making sure your user has control over external storage devices. See this.
 
Old 08-13-2010, 03:59 AM   #3
mfdarwin
LQ Newbie
 
Registered: Aug 2010
Posts: 7

Original Poster
Rep: Reputation: 0
Thanks for that. It works for me. Now how do I convince my son that this is better than Windows, or even explain why the unmount on the menu doesn't work?

After this success I have downloaded all my holiday photos. I then decided to put on the music track I wanted. But again I don't have access rights. I know I need to learn more, and I will, but it was very difficult with my neighbour watching 'the expert' having problems he does without problem.

My other thought is that if Ubuntu thinks everything I do is to be done by the root user, then perhaps I should always be logged on as root. Any comments?
 
Old 08-13-2010, 11:20 AM   #4
pljvaldez
LQ Guru
 
Registered: Dec 2005
Location: Somewhere on the String
Distribution: Debian Wheezy (x86)
Posts: 6,094

Rep: Reputation: 281Reputation: 281Reputation: 281
You typically don't want to run as a root user because you can do a lot more damage to your system as root. Since root has ultimate power, you could accidentally delete an important system folder. In Windows you typically run as a super user also and have the ability to destroy your system (just go mucking around in the registry sometime).

The real problem for most people moving to linux is the idea of permissions. Most problems result from your user not having sufficient permissions to read or write or execute a certain file. Linux maintains permissions based on the user who created the file. So if your son created a spreadsheet under his account, you won't be able to read it by default because your login is different and those are HIS files. So instead, what you have to do is create and use group permissions to allow users to do common things or to share files. There are groups like cdrom and audio which you need to be a part of to use those parts of the system. At home, I have a common directory setup where my wife and I share documents and things like mp3's. But each mp3 has to have permissions that allow me to read it as well as her. Fortunately, there are ways to make sure every file that gets created in a certain directory has a specific set of privileges.

Anyway, the Ubuntu documentation is really pretty good and of course you can also ask questions here. So I guess I'd start at the Ubuntu docs.

Last edited by pljvaldez; 08-13-2010 at 11:26 AM.
 
Old 08-13-2010, 02:23 PM   #5
mfdarwin
LQ Newbie
 
Registered: Aug 2010
Posts: 7

Original Poster
Rep: Reputation: 0
Thanks. Its not that my son and I want to share but I am trying to get him off Windows.

The mp3 problem is still confusing. It is MY mp3 file. It is MY usb connected player. Nobody else is involved. But it still won't let ME copy it without root user priveleges.
 
Old 08-13-2010, 03:29 PM   #6
pljvaldez
LQ Guru
 
Registered: Dec 2005
Location: Somewhere on the String
Distribution: Debian Wheezy (x86)
Posts: 6,094

Rep: Reputation: 281Reputation: 281Reputation: 281
It's possible that you don't have the correct permissions for the mount point. Can you tell me what the mount point is? For example, it may be mounted at /media/usb0 or something like that. Once you find it, can you post the output of ls -al /media (if it's mounted at /media/usb0, otherwise, just change /media to the directory immediately above the mount point).
 
Old 08-14-2010, 04:23 AM   #7
mfdarwin
LQ Newbie
 
Registered: Aug 2010
Posts: 7

Original Poster
Rep: Reputation: 0
This is my output

drwxr-xr-x 12 root root 4096 2010-08-13 09:29 .
drwxr-xr-x 22 root root 4096 2010-07-25 11:30 ..
lrwxrwxrwx 1 root root 6 2010-04-05 10:53 cdrom -> cdrom0
drwxr-xr-x 2 root root 4096 2010-04-05 10:53 cdrom0
lrwxrwxrwx 1 root root 7 2010-04-05 10:53 floppy -> floppy0
drwxr-xr-x 2 root root 4096 2010-04-05 10:53 floppy0
lrwxrwxrwx 1 root root 4 2010-06-13 17:01 usb -> usb0
drwxr-xr-x 7 root root 4096 1970-01-01 01:00 usb0
drwxr-xr-x 2 root root 4096 2010-06-13 17:01 usb1
drwxr-xr-x 2 root root 4096 2010-06-13 17:01 usb2
drwxr-xr-x 2 root root 4096 2010-06-13 17:01 usb3
drwxr-xr-x 2 root root 4096 2010-06-13 17:01 usb4
drwxr-xr-x 2 root root 4096 2010-06-13 17:01 usb5
drwxr-xr-x 2 root root 4096 2010-06-13 17:01 usb6
drwxr-xr-x 2 root root 4096 2010-06-13 17:01 usb7

The SD card I inserted showed up on the desktop as usb0
 
Old 08-16-2010, 11:08 AM   #8
pljvaldez
LQ Guru
 
Registered: Dec 2005
Location: Somewhere on the String
Distribution: Debian Wheezy (x86)
Posts: 6,094

Rep: Reputation: 281Reputation: 281Reputation: 281
It looks like the directory permissions for usb are okay. But usb0 doesn't have write permissions. See this line
Code:
drwxr-xr-x 7 root root 4096 1970-01-01 01:00 usb0
The leading "d" means it's a directory and then the next three letters tell you the permissions for the file owner (in this case "root") as being "rwx" (read, write, & execute). The second set of three letters are "r-x" mean that the group (in this case the "root" group) has only read and execute permissions. The third group of three is also "r-x" and these are the permissions for everyone else (i.e. not the owner of the file or in the designated group).

Are you trying to add the music file to the SD card or to something else?

Again, I'd say that you probably need to do some reading up about permissions in linux. This is one of the important parts of the *nix model that makes it more secure than a Windows system. General users just don't have permission to go mucking around in other peoples' files or system files. I think the key thing you need to do is figure out what group you need to add your user to in order to have appropriate permissions for removable devices.
 
Old 08-18-2010, 07:04 AM   #9
mfdarwin
LQ Newbie
 
Registered: Aug 2010
Posts: 7

Original Poster
Rep: Reputation: 0
"General users just don't have permission to go mucking around in other peoples' files or system files."

This is my gripe!

I don't have permission to copy MY file to MY USB device.
 
Old 08-19-2010, 11:19 AM   #10
Skaperen
Senior Member
 
Registered: May 2009
Location: center of singularity
Distribution: Xubuntu, Ubuntu, Slackware, Amazon Linux, OpenBSD, LFS (on Sparc_32 and i386)
Posts: 2,684
Blog Entries: 31

Rep: Reputation: 176Reputation: 176
If I was logged in as a non-root non-admin user when inserting removable media that gets automounted, I should be able to request it be unmounted to be safe to remove without needing to do sudo or any other means that required entering the root or admin password. Whatever it was that did the mount clearly has that access as some underlying point. It should be able to accept my request for the unmount, at least if I am the same user as originally got it mounted (even if I log out and log back in). Allowing a different user to unmount while logged in on the main console should also be possible if an administration preference or the original mounter allows it. If the mount was done by a console user but no user is currently logged in to the console, a drop down option where the reboot/shutdown is should also be able to do it. Of course, if there are active opens on that media, the unmount should be blocked or deferred (with an option to kill processes that are blocking it, if you are root, admin, or own all the relevant processes).

Do you see any reason why it shouldn't work this way?
 
Old 08-20-2010, 02:57 AM   #11
mfdarwin
LQ Newbie
 
Registered: Aug 2010
Posts: 7

Original Poster
Rep: Reputation: 0
I think that is exactly my point.

If it sees it when I plug it in why can't it immediately let me remove it?
Why won't it let me copy to it?
Why do I have to use sudo to remove it?

I'm the only user and only want to copy MY files.

It is now working fine. But I am logged in as root and may end up staying as root!
 
Old 08-20-2010, 09:32 AM   #12
Skaperen
Senior Member
 
Registered: May 2009
Location: center of singularity
Distribution: Xubuntu, Ubuntu, Slackware, Amazon Linux, OpenBSD, LFS (on Sparc_32 and i386)
Posts: 2,684
Blog Entries: 31

Rep: Reputation: 176Reputation: 176
If you are logged in as a non-root user on the graphical console, this should work, already. It does for me. In the non-root user desktop, right click on the device icon. The pop-up menu should have a couple means to ask for the media to be unmounted or made removable. I just don't remember what they are. The issue I run into is that I do a lot from a command line. And I log in as root very frequently just because the people that have created these tools neglected to make command line equivalents.
 
Old 08-21-2010, 03:42 AM   #13
mfdarwin
LQ Newbie
 
Registered: Aug 2010
Posts: 7

Original Poster
Rep: Reputation: 0
I agree it should work.
Maybe I should re-install as I didn't notice a problem with previous versions, although I was still using windows with experimenting.
 
  


Reply



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
safely remove hardware bhanuma_nagadeep Linux - Hardware 4 08-20-2008 03:12 PM
how do I (safely) remove gnome? sunpascal Linux - Newbie 1 02-12-2006 09:24 AM
How to safely remove linux :( TRUSTpunk Linux - Newbie 11 01-07-2005 12:55 AM
How to remove old kernels safely satimis Fedora 11 08-21-2004 08:06 AM
How do I safely remove old kernels? Amerist Linux - General 4 11-02-2002 10:56 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu

All times are GMT -5. The time now is 11:52 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
Open Source Consulting | Domain Registration