uk.comp.os.linux
[Top] [All Lists]

Re: Mounting and writing to second hard drive...

Subject: Re: Mounting and writing to second hard drive...
From: Will Kemp <will@xxxxxxxxxxxxxxxx>
Date: Wed, 30 Jul 2008 23:11:35 +0100
Newsgroups: uk.comp.os.linux


zed wrote:
My apologies for the delay in replying - life got in the way of my
interests.

Ian Rawlings <news06@xxxxxxxxxxxxx> wrote:

On 2008-07-26, zed <zed@xxxxxxxxxx> wrote:

I can mount (2) by going in to Computer and clicking on Mount but I
cannot write to the drive.
What user are you trying to write to the drive as?  Chances are the
drive's directory will be mounted as root, so if you are not trying to log
in as root then you won't be able to write to it.  to fix this, run a
terminal and cd to the drive's directory, then use "sudo chown <your user>
." and you should be able to write to it.  I don't know ubuntu though and
know it has some limits about root access, so running the command as root
might be slightly different but you get the idea.

There is only one user - zed.

The drive owner was /root as you suggested.  So I logged in as /root and
then created three directories: Backups, Music, Pictures, as it is my
intention as <zed> to use this drive to do Backups and keep my Music and
Pictures on it.

A minor technical point... There is no such user as "/root" - it's just "root" - /root is a directory. I'm not just being pedantic, it's important to get this stuff straight, as a slash in the wrong place in future can mean something won't work.

I then looked at Chown in the book "A Practical Guide to Linux - Commands,
Editors, and Shell Programming" - most of which is beyond me :-( and typed
the following into a terminal:

zed-desktop disk # chown /media/disk/zed
chown: missing operand after `/media/disk/zed'

Really, there's a missing operand before `/media/disk/zed'

I guess it should be:

chown zed /media/disk/zed

You're got to tell chown who you want it to change ownership to.

Try `chown --help' for more information.
zed-desktop disk # chown --recursive zed: /Backups/zed/

That's getting closer. But what's the ":" doing in there?

chown: cannot access `/Backups/zed/': No such file or directory

Where is this directory you want to change ownership of? Obviously not in /Backups (which doesn't exist).

zed-desktop disk # cd /media/disk/Backups

Ah. Maybe it should have been

chown -R zed /media/disk/Backups

?

zed-desktop Backups # chown --recursive zed: /backups
chown: cannot access `/backups': No such file or directory

If the directory name starts with a capital "B", it's a capital "B". But it's not the "b" that's wrong, it's the "/". You're just groping around here, aren't you? ;-)

zed-desktop Backups # chown --recursive zed: /Backups
chown: cannot access `/Backups': No such file or directory

If you're trying to change ownership of the directory you're currently in, then it's not "/Backups", it's (i guess) "/media/disk/Backups"

Alternatively, as you're already in the directory, it can be referred to as "." - yes, just a single dot.

So you could either have done

chown -R zed /media/disk/Backups

or

chown -R zed .

Because you're actually *in* the directory you're trying to change ownership of.

Obviously I'm not understanding the correct sequence of commands.  So any
help would be appreciated.

It's not the sequence of commands you're not understanding, it's the filesystem naming conventions.

[snip]
Questions>

(a) What do I do to have the drive mount at boot?
Add it to your fstab, however if it's USB then it may well not get mounted
automatically as I know on my system, USB discs are not available until
after all the filesystems have mounted, so you will either have to run
mount -a as root, or add the mount commands to a script that runs well
after the system startup has happened.


I'll leave this portion until I've changed the ownership :-)

Good idea! ;-)



--
http://SnapAndScribble.com

<Prev in Thread] Current Thread [Next in Thread>