Personal computing discussed

Moderators: renee, SecretSquirrel, notfred

 
Dirge
Gerbil Jedi
Topic Author
Posts: 1620
Joined: Thu Feb 19, 2004 3:08 am

External HDD with Ubuntu

Wed Nov 26, 2008 12:05 am

Hi I get this error "Operation not supported by backend" when I try to copy files to my newly formatted USB HDD.

I am running Ubuntu 8.04 and have formatted the drive with Ext3.

Why would only the root user be given access to this drive... is there something I have done wrong when using GParted to format the drive? Why don't I have permission to write to my newly formated drive and how can I change this?
FDISK /MBR
 
titan
Grand Gerbil Poohbah
Posts: 3376
Joined: Mon Feb 18, 2002 7:00 pm
Location: Great Smoky Mountains
Contact:

Re: External HDD with Ubuntu

Wed Nov 26, 2008 12:18 am

You need to make sure that the user has permission to mount the drive. Post your /etc/fstab so we can see what it has to say.
The best things in life are free.
http://www.gentoo.org
Guy 1: Surely, you will fold with me.
Guy 2: Alright, but don't call me Shirley.
 
notfred
Maximum Gerbil
Posts: 4610
Joined: Tue Aug 10, 2004 10:10 am
Location: Ottawa, Canada

Re: External HDD with Ubuntu

Wed Nov 26, 2008 9:28 am

Are you mounting it at boot time with entries in /etc/fstab or are you hotplugging it once the OS is up?
 
zamb
Gerbil
Posts: 15
Joined: Wed Nov 26, 2008 9:38 am

Re: External HDD with Ubuntu

Wed Nov 26, 2008 9:46 am

If you want to give your current user full access to the drive you need to do (in a terminal):
sudo chown username:username /PATH/TO/USBDRIVE

(Where username is the login name you use to log-in to your system, and /PATH/TO/USBDRIVE is where your USB drive is mounted. Here's an example from my system:
sudo chown zamb:zamb /media/40GB

(zamb is my login name, and /media/40GB is where my 40GB USB drive is usually mounted.)

You need to do this once!
Hope this helps.
(sudo will ask for your password.)
Ziyad.

EDIT: A little late! Didn't see the date. Sorry.
 
just brew it!
Administrator
Posts: 54500
Joined: Tue Aug 20, 2002 10:51 pm
Location: Somewhere, having a beer

Re: External HDD with Ubuntu

Wed Nov 26, 2008 10:09 am

By default, the root folder on the new drive will be writable only by root.

There are a number of ways you can deal with this. Assuming you are hot-plugging it, and it is auto-mounting itself as /media/disk, any of the following should work (do this with the drive mounted) --

To make it writable by anyone:
sudo chmod go+w /media/disk


To change the ownership, making it writable by your account only:
sudo chown myaccountname:mygroupname /media/disk


To create a subfolder that is writable by your account, while leaving the root folder of the drive writable only by root:
sudo mkdir /media/disk/myfolder
sudo chown myaccountname:mygroupname /media/disk/myfolder


There's probably a way to do this through the GUI as well, but I've never bothered to figure out how since I'm comfortable with the CLI...
Nostalgia isn't what it used to be.
 
Dirge
Gerbil Jedi
Topic Author
Posts: 1620
Joined: Thu Feb 19, 2004 3:08 am

Re: External HDD with Ubuntu

Thu Nov 27, 2008 3:46 pm

Hey guys thanks for all your support. Yes I am hot plugging the external drive and I like the idea of changing ownership. Coming in the most part from a Windows world it seems kinda weird not being given appropriate permissions when I formatted the drive.

Is there any advantage to creating a subfolder that is writable by your account, while leaving the root folder of the drive writable only by root? I heard someone mention this was the nix way of doing things as it provided more security. Is this true?

Would I encounter any problems with this method if I later upgraded to Ubuntu 8.10 and changed to a different user account. I assume if it was in the same group I would be alright. What about using the drive with a different distro? I am guessing it wont work without changing ownership again.
FDISK /MBR
 
titan
Grand Gerbil Poohbah
Posts: 3376
Joined: Mon Feb 18, 2002 7:00 pm
Location: Great Smoky Mountains
Contact:

Re: External HDD with Ubuntu

Fri Nov 28, 2008 1:05 am

The way Linux views storage space is different from Windows and Mac. It's all one contiguous file system as far as Linux is concerned. For simplicity's sake, that's what it is, but it is not equivalent to JBOD. If the external drive is being mounted to the root (/)directory, then what the person told you is true. There does not really have to have a subdirectory on it. The thing is to be sure that the external drive is mounted to the appropriate location within the Linux directory structure (e.g. /mnt/usbdrive).

My guess as to why the drive was owned by root is that it was created by root; GParted was run with the root account. In which case, what the distro had done was reasonable as that's how Linux is supposed to work; automatically set the permission according to who created it.
The best things in life are free.
http://www.gentoo.org
Guy 1: Surely, you will fold with me.
Guy 2: Alright, but don't call me Shirley.
 
just brew it!
Administrator
Posts: 54500
Joined: Tue Aug 20, 2002 10:51 pm
Location: Somewhere, having a beer

Re: External HDD with Ubuntu

Fri Nov 28, 2008 11:48 am

Dirge wrote:
Is there any advantage to creating a subfolder that is writable by your account, while leaving the root folder of the drive writable only by root? I heard someone mention this was the nix way of doing things as it provided more security. Is this true?

If the drive will be used by more than one user, you may want to do things this way so that each person can have their own subfolder with the appropriate permissions. If you will be the only user, then there is probably not a big advantage to doing things this way.

Would I encounter any problems with this method if I later upgraded to Ubuntu 8.10 and changed to a different user account. I assume if it was in the same group I would be alright. What about using the drive with a different distro? I am guessing it wont work without changing ownership again.

If you are in the same group, and the group permissions allow writing, it will still work.

Also note that Linux user IDs (as stored internally in the file system) are just numbers; IIRC the first user created on an Ubuntu system is user ID 1000. If you do another fresh install, the first user created will get the same numerical user ID (and so will effectively be the same user as far as attached storage devices are concerned), even if the name is different.
Nostalgia isn't what it used to be.
 
Dirge
Gerbil Jedi
Topic Author
Posts: 1620
Joined: Thu Feb 19, 2004 3:08 am

Re: External HDD with Ubuntu

Fri Nov 28, 2008 3:54 pm

Thanks guys! I mean it :)
FDISK /MBR
 
notfred
Maximum Gerbil
Posts: 4610
Joined: Tue Aug 10, 2004 10:10 am
Location: Ottawa, Canada

Re: External HDD with Ubuntu

Fri Nov 28, 2008 6:48 pm

just brew it! wrote:
Also note that Linux user IDs (as stored internally in the file system) are just numbers; IIRC the first user created on an Ubuntu system is user ID 1000. If you do another fresh install, the first user created will get the same numerical user ID (and so will effectively be the same user as far as attached storage devices are concerned), even if the name is different.
And also a quick find/chown command can easily switch the files that belonged to the old userid to the new userid.

Who is online

Users browsing this forum: Google [Bot] and 1 guest
GZIP: On