LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 03-04-2008, 09:37 AM   #1
Jinouchi
Member
 
Registered: Jul 2007
Location: WI, USA
Distribution: Debian, Lenny
Posts: 111

Rep: Reputation: 19
Permissions - Can't change on mountpoints


Yesterday I decided that I just couldn't take gaving a 3GB HDD anymore and found a 25GB that I could erase and use. That's what I'm using now. I copied my entire old hard disk to this one and now for some reason only the root user can write to my external storage devices. I've tried using chmod and chown logged in as root, but the best I can get are rwxr-xr-x permissions. chmod 777 /mountpoint doesn't give me fullpermisions. I've treid editing the fstab/mtab files but that didn't help (I'm not very esperienced with that so I may not have done it correctly(most likely). With my 3GB HDD I could access them just fine as a non-root user.

My question: How do I change the permissions/ownership of my external storage devives?

Subquestion: how should I have copied my hdd over to have maintained all original permissions?
 
Old 03-04-2008, 10:36 AM   #2
weisso5
Member
 
Registered: Oct 2007
Location: New York City
Distribution: Gentoo, FC
Posts: 133

Rep: Reputation: 16
Hello Jinouchi,

When copying directories you always want to make sure you use the -p (--preserve) flag. This will: ( from man cp)

-p same as --preserve=mode,ownership,timestamps

--preserve[=ATTR_LIST]
preserve the specified attributes (default: mode,ownership,time-
stamps), if possible additional attributes: links, all


Regarding Permissions:
Here is a great links to a very simple explanation for permissions:
Permissions:
http://www.tuxfiles.org/linuxhelp/filepermissions.html
Owner/Group:
http://www.tuxfiles.org/linuxhelp/fileowner.html

Please post if you are having any more problems.
 
Old 03-04-2008, 01:25 PM   #3
Jinouchi
Member
 
Registered: Jul 2007
Location: WI, USA
Distribution: Debian, Lenny
Posts: 111

Original Poster
Rep: Reputation: 19
Thank you for those URLs and the -p option.

Here's what happened when I tried chown again:
(I've condensed it to show only the dir I'm trying to change and replaced my username with "*****")
Code:
# dir -l /media
drwxrwxrwx  2 ***** root     4096 2008-03-03 15:59 TOSHIBA
# mount /dev/sda1 /media/TOSHIBA
# dir -l /media
drwxr-xr-x  4 root root    16384 1969-12-31 18:00 TOSHIBA
# chown ***** /media/TOSHIBA
chown: changing ownership of `/media/TOSHIBA': Operation not permitted
# chown -fv ***** /media/TOSHIBA
failed to change ownership of `/media/TOSHIBA' to *****
With chmod, it says it works, but it stays the same.

Code:
# dir -l /media
drwxr-xr-x  4 root root    16384 1969-12-31 18:00 TOSHIBA
# chmod -fv 777 /media/TOSHIBA
mode of `/media/TOSHIBA' changed to 0777 (rwxrwxrwx)
# dir -l /media
drwxr-xr-x  4 root root    16384 1969-12-31 18:00 TOSHIBA
My only (far out) idea is that, becuase I did a partial install of Debian to format the disk how I wanted, the "root" user is not THE root user, but A root user, the root user of the previous install. I don't know if that's possible, but I don't know why else it would deny access to the root user. (In the partial install, I didn't get far enough to enter root password though.)

I've also tried using sudo for chmod/chown, but the same thing happens. When I try to use the Nautilus GUI when logged in as root, after I check the box it un-checks it 1/2 second later.

Should I just try erasing this drive and using the -p option you mentioned to re-copy my old drive onto this one? Or is there a change I can make to the fstab/mtab to fix this? I'll try to do some more research on my own too.
 
Old 03-04-2008, 03:35 PM   #4
weisso5
Member
 
Registered: Oct 2007
Location: New York City
Distribution: Gentoo, FC
Posts: 133

Rep: Reputation: 16
Let's start this copy all over again, just to make sure you aren't having a bigger issue. Please follow these steps:

Code:
shell# mke2fs /dev/sda1
shell# mount /dev/sda1 /mount/mountpoint
shell# cp -axp * /foo/bar /mount/mountpoint

Report back on any problems.

-weisso
 
Old 03-05-2008, 10:55 PM   #5
Jinouchi
Member
 
Registered: Jul 2007
Location: WI, USA
Distribution: Debian, Lenny
Posts: 111

Original Poster
Rep: Reputation: 19
Thanks! Everything works fine except... it doesn't automount the swap partition. How do I do this/tell it to do so at boot?
 
Old 03-06-2008, 08:22 AM   #6
Jinouchi
Member
 
Registered: Jul 2007
Location: WI, USA
Distribution: Debian, Lenny
Posts: 111

Original Poster
Rep: Reputation: 19
ok, I got the swap mounted, but why didn't it do it at boot?
 
Old 03-06-2008, 09:35 AM   #7
weisso5
Member
 
Registered: Oct 2007
Location: New York City
Distribution: Gentoo, FC
Posts: 133

Rep: Reputation: 16
to auto-mount the drive you need to make an entry in your fstab file, here is an example:


Code:
# <fs>                  <mountpoint>    <type>          <opts>          <dump/pass>

# NOTE: If your BOOT partition is ReiserFS, add the notail option to opts.
/dev/sda2               /boot           ext2            noauto,noatime  1 2
/dev/sda4               /               ext3            noatime         0 1
/dev/sda3               none            swap            sw              0 0
/dev/sdb1               /mnt/mountpoint  ext2            defaults        1 2
-weisso

Last edited by weisso5; 03-06-2008 at 09:36 AM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
NFS issues - mountpoints within mountpoints Gort32 Linux - General 1 08-12-2006 11:01 AM
Are these good mountpoints cheetahman SUSE / openSUSE 9 04-14-2005 11:21 AM
Suse : Why double mountpoints ? CloudBuilder Linux - Newbie 3 11-06-2003 12:12 PM
No Mountpoints defined Zvezda Linux - General 0 12-22-2001 11:54 AM
Linux 7.1 mountpoints Wolfie2001 Linux - Newbie 4 10-11-2001 01:09 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 09:42 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