LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices


Reply
  Search this Thread
Old 08-13-2007, 08:26 AM   #1
peterbug
Member
 
Registered: May 2007
Location: Argyll, Scotland
Distribution: elive / Fedora 7
Posts: 32

Rep: Reputation: 15
second hard drive wont let me create or move files?


hey I've recently mounted my second hard drive onto sabayon linux, however when I try to move files on to my second hard drive I am told that I do not have permission to do this. how fix I change this, so that I can freely move files to and from the hard drive without running as root?
 
Old 08-13-2007, 10:06 AM   #2
dracolich
Senior Member
 
Registered: Jul 2005
Distribution: Slackware
Posts: 1,274

Rep: Reputation: 63
What filesystem is the disk formatted as? For fat/vfat it needs to be mounted with additional options to allow users to access it:

mount -t vfat ... -o users,umask=002

If it's ext2/3 you need to use chmod or chown on individual files and directories. I'm not sure, but I think ntfs options are handled the same as vfat.
 
Old 08-13-2007, 11:01 AM   #3
bigrigdriver
LQ Addict
 
Registered: Jul 2002
Location: East Centra Illinois, USA
Distribution: Debian stable
Posts: 5,908

Rep: Reputation: 356Reputation: 356Reputation: 356Reputation: 356
Also, inspect /etc/fstab or /etc/mtab to see if the partition is mounted read-only (ro) or read-write (rw). If it is read only, you will get the 'permission denied' message. You will have to remount the partition as rw in order to write to the partition.
 
Old 08-13-2007, 04:10 PM   #4
peterbug
Member
 
Registered: May 2007
Location: Argyll, Scotland
Distribution: elive / Fedora 7
Posts: 32

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by dracolich View Post
What filesystem is the disk formatted as? For fat/vfat it needs to be mounted with additional options to allow users to access it:

mount -t vfat ... -o users,umask=002

If it's ext2/3 you need to use chmod or chown on individual files and directories. I'm not sure, but I think ntfs options are handled the same as vfat.
its ext3 and in both mtab and fstab it is rw so that should be ok =]

you mean every file I take or use from it will have to be done through the CLI? I checked the properties and it says the owner of the drive is root, how do I change that to user?



just in case I'm missing something here is my mtab :

Code:
/dev/mapper/VolGroup00-LogVol00 / ext3 rw,user_xattr 0 0
proc /proc proc rw,nosuid,nodev,noexec 0 0
sysfs /sys sysfs rw,nosuid,nodev,noexec 0 0
udev /dev tmpfs rw,nosuid 0 0
devpts /dev/pts devpts rw,nosuid,noexec 0 0
/dev/sda1 /boot ext3 rw,user_xattr 0 0
/dev/sdb1 /media ext3 rw,user_xattr 0 0
tmpfs /dev/shm tmpfs rw 0 0
usbfs /proc/bus/usb usbfs rw,noexec,nosuid,devmode=0664,devgid=85 0 0
binfmt_misc /proc/sys/fs/binfmt_misc binfmt_misc rw,noexec,nosuid,nodev 0 0
and here is my fstab :

Code:
/dev/VolGroup00/LogVol00 /                       ext3    defaults,user_xattr 1 1
/dev/sda1               /boot                   ext3    defaults,user_xattr 1 2
/dev/sdb1               /media                   ext3    defaults,user_xattr   1   2
/dev/VolGroup00/LogVol01 swap                    swap    defaults        0 0
tmpfs                   /dev/shm                tmpfs   defaults        0 0

Last edited by peterbug; 08-13-2007 at 04:24 PM.
 
Old 08-14-2007, 08:57 AM   #5
dracolich
Senior Member
 
Registered: Jul 2005
Distribution: Slackware
Posts: 1,274

Rep: Reputation: 63
ext preserves the ownership and permissions of every directory and file. If the owner of a file is, say root:root with permissions of rwxr-xr-x, only root can save changes. Then the file next to it could be root:root with rwxrwxrwx (not likely but possible). So, if every file on that disk is owned by root:root, only root can change the ownership, and if the permissions are restrictive like rwx-r--r-- only root can save changes to the file.

You could chown -R root:users and then chmod -R 775 on the mount point, and if you want you can use your user's name instead of root. Or you can chmod -R 777 on the mount point to give everyone full access. I would use the chown option for security reasons. Don't forget the -R and make sure the disk is mounted first. And be extra careful that you execute it on the correct target. You don't want to chown the entire / or chmod 777 your entire /etc directory.
 
Old 08-14-2007, 09:42 AM   #6
jay73
LQ Guru
 
Registered: Nov 2006
Location: Belgium
Distribution: Ubuntu 11.04, Debian testing
Posts: 5,019

Rep: Reputation: 133Reputation: 133
If your second disk has another Linux OS, the most convenient solution is to use the same UID and GID on both systems. If not, simply use chmod -R and chgrp -R as explained elsewhere in this thread.

Last edited by jay73; 08-14-2007 at 02:02 PM.
 
Old 08-14-2007, 12:37 PM   #7
fusilier
LQ Newbie
 
Registered: Jun 2003
Posts: 6

Rep: Reputation: 0
dracolich is correct, however ensure the drive unmounted before making the permission changes on the mount point so that whomever you would like to have right permissions have them. Then remount the drive.
 
  


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
How to move installation to a new Hard Drive? mlitty Linux - General 26 09-22-2010 09:36 AM
Copying files from internal Hard drive to USB 2.0 Hard Drive is NOT Behaving tubatodd Ubuntu 4 02-19-2007 04:32 PM
How to move installation to a new Hard Drive? mlitty Linux - General 1 01-18-2007 08:34 PM
Need to create a script to move files from one directory to another mustang05 Solaris / OpenSolaris 4 06-16-2006 10:25 AM
can i move my hard drive to a different computer citrus Linux - General 5 04-12-2004 03:30 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware

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