|
|
|
date: Sat, 26 Jul 2008 21:53:46 +1200,
group: uk.comp.os.linux
back
Mounting and writing to second hard drive...
ITMA - if any one of you is old enough to remember?
I have 2 x 200GB hard drives in my desktop computer:
(1) one is formatted for Linux and contains my root, swap and Home
partitions with LinuxMint installed.
(2) the other is formatted with Ext3 for one partition only.
I can mount (2) by going in to Computer and clicking on Mount but I cannot
write to the drive.
Questions>
(a) What do I do to have the drive mount at boot?
(b) What do I do to gain permanent permission to write to the drive?
What I intend to do is to use this drive to hold pictures, audio files and
backups of my Home directory in appropriate folders.
As usual, your advice would be much appreciated.
And the weather hasn't improved in New Zealand since my last email. It is
now "bucketing" down, the wind has increased markedly, and I'm going to tuck
myself up in bed :-)
Zed
--
zed
date: Sat, 26 Jul 2008 21:53:46 +1200
author: zed
|
Re: Mounting and writing to second hard drive...
On 2008-07-26, zed 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.
If you can't write to it as root, execute dmesg to see if you can find
out why, if a filesystem is corrupt then it's often mounted as
read-only, or if you have an ext3 disc that was unmounted cleanly and
then mount that as ext2, I think it would only mount that read-only
too.
> 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.
--
Blast off and strike the evil Bydo empire!
http://youtube.com/user/tarcus69
http://www.flickr.com/photos/tarcus/sets/
date: Sat, 26 Jul 2008 11:11:35 +0100
author: Ian Rawlings
|
Re: Mounting and writing to second hard drive...
zed writes:
>ITMA - if any one of you is old enough to remember?
>I have 2 x 200GB hard drives in my desktop computer:
>(1) one is formatted for Linux and contains my root, swap and Home
>partitions with LinuxMint installed.
>(2) the other is formatted with Ext3 for one partition only.
>I can mount (2) by going in to Computer and clicking on Mount but I cannot
>write to the drive.
>Questions>
>(a) What do I do to have the drive mount at boot?
Put a line in /etc/fstab
/dev/hdb1 /extra ext3 rw 1 5
(assuming that one partition is on drive hdb and is the first partition.
Show us what
fdisk -l /dev/hdb
says.
>(b) What do I do to gain permanent permission to write to the drive?
How did you try to write the drive in the first place.
>What I intend to do is to use this drive to hold pictures, audio files and
>backups of my Home directory in appropriate folders.
>As usual, your advice would be much appreciated.
>And the weather hasn't improved in New Zealand since my last email. It is
>now "bucketing" down, the wind has increased markedly, and I'm going to tuck
>myself up in bed :-)
>Zed
>--
>zed
date: Sat, 26 Jul 2008 16:13:19 GMT
author: Unruh
|
Re: Mounting and writing to second hard drive...
My apologies for the delay in replying - life got in the way of my
interests.
Ian Rawlings wrote:
> On 2008-07-26, zed 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.
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'
Try `chown --help' for more information.
zed-desktop disk # chown --recursive zed: /Backups/zed/
chown: cannot access `/Backups/zed/': No such file or directory
zed-desktop disk # cd /media/disk/Backups
zed-desktop Backups # chown --recursive zed: /backups
chown: cannot access `/backups': No such file or directory
zed-desktop Backups # chown --recursive zed: /Backups
chown: cannot access `/Backups': No such file or directory
zed-desktop Backups #
Obviously I'm not understanding the correct sequence of commands. So any
help would be appreciated.
[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 :-)
--
zed
date: Thu, 31 Jul 2008 09:24:54 +1200
author: zed
|
Re: Mounting and writing to second hard drive...
zed wrote:
> My apologies for the delay in replying - life got in the way of my
> interests.
>
> Ian Rawlings wrote:
>
>> On 2008-07-26, zed 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
date: Wed, 30 Jul 2008 23:11:35 +0100
author: Will Kemp
|
Re: Mounting and writing to second hard drive...
zed writes:
>My apologies for the delay in replying - life got in the way of my
>interests.
>Ian Rawlings wrote:
>> On 2008-07-26, zed 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.
>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:
I am afraid you did not look very carefully. The syntax of chown is
chown username[.groupname] file1 [file2 ...]
where [..] indicates optional material and username is the login name of
the user you want to own the files.(zed in your case I believe)
YOu never told chown what username you wnated to change the files to.
Note that if the partition is a FAT partition, it knowns nothing about
usernames, and you cannot chown anything.
>zed-desktop disk # chown /media/disk/zed
>chown: missing operand after `/media/disk/zed'
>Try `chown --help' for more information.
>zed-desktop disk # chown --recursive zed: /Backups/zed/
>chown: cannot access `/Backups/zed/': No such file or directory
>zed-desktop disk # cd /media/disk/Backups
>zed-desktop Backups # chown --recursive zed: /backups
>chown: cannot access `/backups': No such file or directory
>zed-desktop Backups # chown --recursive zed: /Backups
>chown: cannot access `/Backups': No such file or directory
>zed-desktop Backups #
>Obviously I'm not understanding the correct sequence of commands. So any
>help would be appreciated.
>
>[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 :-)
>--
>zed
date: Wed, 30 Jul 2008 23:40:14 GMT
author: Unruh
|
Re: Mounting and writing to second hard drive...
Unruh wrote:
> zed writes:
>
>> My apologies for the delay in replying - life got in the way of my
>> interests.
>
>> Ian Rawlings wrote:
>
>>> On 2008-07-26, zed 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.
>
>> 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:
>
> I am afraid you did not look very carefully. The syntax of chown is
> chown username[.groupname] file1 [file2 ...]
> where [..] indicates optional material and username is the login name of
> the user you want to own the files.(zed in your case I believe)
> YOu never told chown what username you wnated to change the files to.
>
> Note that if the partition is a FAT partition, it knowns nothing about
> usernames, and you cannot chown anything.
You *can* change the ownership of the directory it's mounted on though.
--
http://SnapAndScribble.com
date: Thu, 31 Jul 2008 08:45:14 +0100
author: Will Kemp
|
Re: Mounting and writing to second hard drive...
On 2008-07-30, zed wrote:
> There is only one user - zed.
.. and root, plus a few others, but I take it that the only user that
needs to access the drive is "zed".
> zed-desktop disk # chown /media/disk/zed
If that's the right path to the disc directory then try;
chown -R zed /media/disk/zed/.
Do the following though so we know what filesystem is on it as this
changes things, as someone else has said, if it's a vfat filesystem or
other old ms-dos style filesystem, it can't handle file ownership.
mount | grep zed
Post the results.
Also, try leaving the disc disconnected until you are logged in to the
desktop, then plug it in and see if it mounts it correctly and lets
you write to it. I'm assuming it's USB or firewire.
--
Blast off and strike the evil Bydo empire!
http://youtube.com/user/tarcus69
http://www.flickr.com/photos/tarcus/sets/
date: Thu, 31 Jul 2008 12:24:32 +0100
author: Ian Rawlings
|
Re: Mounting and writing to second hard drive...
In article <W3ekk.415$hR4.241@newsfe24.ams2>,
Will Kemp wrote:
>Unruh wrote:
>
>> Note that if the partition is a FAT partition, it knowns nothing about
>> usernames, and you cannot chown anything.
>
>You *can* change the ownership of the directory it's mounted on though.
It's true FAT and VFAT know nothing about usernames and all files on
the partition will (appear to) be owned by the same user. By default
they take the username of the user who mounts it. In most usages this
will be root, but hal-based automounters may set it to be the current
desktop user.
But you can specify which username to use with "mount -o uid=whoever
/dev/whatever /whereever".
Nick
--
Serendipity: http://www.leverton.org/blosxom (last update 6th June 2008)
"The Internet, a sort of ersatz counterfeit of real life"
-- Janet Street-Porter, BBC2, 19th March 1996
date: Thu, 31 Jul 2008 11:57:21 +0000 (UTC)
author: Nick Leverton
|
Re: Mounting and writing to second hard drive...
On 2008-07-31, Nick Leverton wrote:
> will be root, but hal-based automounters may set it to be the current
> desktop user.
Hence my suggestion to him that he unplugs it and plugs it in when
he's logged into the desktop, it may be that he's leaving it plugged
in all the time and when restarting, it's not being mounted because
it's not told to mount.
--
Blast off and strike the evil Bydo empire!
http://youtube.com/user/tarcus69
http://www.flickr.com/photos/tarcus/sets/
date: Thu, 31 Jul 2008 13:28:51 +0100
author: Ian Rawlings
|
Re: Mounting and writing to second hard drive...
Thank you for your prompt response.
Ian Rawlings wrote:
> On 2008-07-30, zed wrote:
>
> > There is only one user - zed.
>
> .. and root, plus a few others, but I take it that the only user that
> needs to access the drive is "zed".
I must learn to be more precise. You are correct in the assumption that the
user requring access is zed.
> > zed-desktop disk # chown /media/disk/zed
>
> If that's the right path to the disc directory then try;
>
> chown -R zed /media/disk/zed/.
That command, with the deletion of /zed/ at the end did the trick.
> Do the following though so we know what filesystem is on it as this
> changes things, as someone else has said, if it's a vfat filesystem or
> other old ms-dos style filesystem, it can't handle file ownership.
> mount | grep zed
> Post the results.
zed@zed-desktop ~ $ mount | grep zed
gvfs-fuse-daemon on /home/zed/.gvfs type fuse.gvfs-fuse-daemon
(rw,nosuid,nodev,user=zed)
> Also, try leaving the disc disconnected until you are logged in to the
> desktop, then plug it in and see if it mounts it correctly and lets you
> write to it. I'm assuming it's USB or firewire.
Again, I apologise for my impreciseness. The drive is an IDE in the
computer.
Regards
--
zed
date: Fri, 1 Aug 2008 05:39:35 +1200
author: zed
|
Re: Mounting and writing to second hard drive...
Will Kemp wrote:
> 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?
zed: means set the user to zed and set the group to zed's group.
--
A.B.
comp.os.linux.advocacy may contain traces of nuts.
date: Sat, 02 Aug 2008 00:47:39 +0100
author: Arthur Buse lid
|
Re: Mounting and writing to second hard drive...
Arthur Buse wrote:
> Will Kemp wrote:
>
>> 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?
>
> zed: means set the user to zed and set the group to zed's group.
Ah! So it does. I've only ever used a '.' between user and group in
chown. (And i probably haven't looked at the chown man page in well over
10 years.)
--
http://SnapAndScribble.com
date: Sat, 02 Aug 2008 06:49:46 +0100
author: Will Kemp
|
Re: Mounting and writing to second hard drive...
In article <yZ6kk.2952$nu6.1616@edtnps83>,
Unruh wrote:
> I am afraid you did not look very carefully. The syntax of chown is
> chown username[.groupname] file1 [file2 ...]
The preferred form seems to be
chown username[:groupname] file1 [file2 ...]
for some reason nowadays.
"man" is your friend.
--
Paul Martin
date: Thu, 7 Aug 2008 10:02:14 +0100
author: Paul Martin
|
Re: Mounting and writing to second hard drive...
On 7 Aug 2008, Paul Martin verbalised:
> The preferred form seems to be
>
> chown username[:groupname] file1 [file2 ...]
>
> for some reason nowadays.
Usernames can contain dots, but not colons. :)
> "man" is your friend.
POSIX is your friend. :)
date: Thu, 07 Aug 2008 22:13:19 +0100
author: Nix
|
Re: Mounting and writing to second hard drive...
In article ,
Nix wrote:
> POSIX is your friend. :)
Trust the computer. The computer is your friend.
--
Paul Martin
date: Fri, 8 Aug 2008 00:24:14 +0100
author: Paul Martin
|
|
|