External HDD with Ubuntu

Where Penguins and Daemons chill together in the warmth of the Sun.

Moderators: SecretSquirrel, notfred

External HDD with Ubuntu

Postposted on Tue Nov 25, 2008 11:05 pm

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
Dirge
Gerbil Jedi
 
Posts: 1525
Joined: Thu Feb 19, 2004 2:08 am
Location: New Zealand

Re: External HDD with Ubuntu

Postposted on Tue Nov 25, 2008 11:18 pm

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.
titan
Grand Gerbil Poohbah
 
Posts: 3276
Joined: Mon Feb 18, 2002 6:00 pm
Location: Great Smoky Mountains

Re: External HDD with Ubuntu

Postposted on Wed Nov 26, 2008 8:28 am

Are you mounting it at boot time with entries in /etc/fstab or are you hotplugging it once the OS is up?
notfred
Grand Gerbil Poohbah
 
Posts: 3646
Joined: Tue Aug 10, 2004 9:10 am
Location: Ottawa, Canada

Re: External HDD with Ubuntu

Postposted on Wed Nov 26, 2008 8:46 am

If you want to give your current user full access to the drive you need to do (in a terminal):
Code: Select all
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:
Code: Select all
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.
zamb
Gerbil
 
Posts: 12
Joined: Wed Nov 26, 2008 8:38 am

Re: External HDD with Ubuntu

Postposted on Wed Nov 26, 2008 9: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:
Code: Select all
sudo chmod go+w /media/disk


To change the ownership, making it writable by your account only:
Code: Select all
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:
Code: Select all
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...
(this space intentionally left blank)
just brew it!
Administrator
Gold subscriber
 
 
Posts: 36882
Joined: Tue Aug 20, 2002 9:51 pm
Location: Somewhere, having a beer

Re: External HDD with Ubuntu

Postposted on Thu Nov 27, 2008 2: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
Dirge
Gerbil Jedi
 
Posts: 1525
Joined: Thu Feb 19, 2004 2:08 am
Location: New Zealand

Re: External HDD with Ubuntu

Postposted on Fri Nov 28, 2008 12: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.
titan
Grand Gerbil Poohbah
 
Posts: 3276
Joined: Mon Feb 18, 2002 6:00 pm
Location: Great Smoky Mountains

Re: External HDD with Ubuntu

Postposted on Fri Nov 28, 2008 10: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.
(this space intentionally left blank)
just brew it!
Administrator
Gold subscriber
 
 
Posts: 36882
Joined: Tue Aug 20, 2002 9:51 pm
Location: Somewhere, having a beer

Re: External HDD with Ubuntu

Postposted on Fri Nov 28, 2008 2:54 pm

Thanks guys! I mean it :)
FDISK /MBR
Dirge
Gerbil Jedi
 
Posts: 1525
Joined: Thu Feb 19, 2004 2:08 am
Location: New Zealand

Re: External HDD with Ubuntu

Postposted on Fri Nov 28, 2008 5: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.
notfred
Grand Gerbil Poohbah
 
Posts: 3646
Joined: Tue Aug 10, 2004 9:10 am
Location: Ottawa, Canada


Return to Linux, Unix, and Assorted Madness

Who is online

Users browsing this forum: No registered users and 1 guest