VectorLinux
April 23, 2014, 06:56:14 pm *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: Visit our home page for VL info. To search the old message board go to http://vectorlinux.com/forum1. The first VL forum is temporarily offline until we can find a host for it. Thanks for your patience.
 
Now powered by KnowledgeDex.
   Home   Help Search Login Register  
Please support VectorLinux!
Pages: [1]
  Print  
Author Topic: file permission  (Read 728 times)
varaahan
Member
*
Posts: 52


« on: December 09, 2010, 04:34:13 am »

I have vector linux (live version) installed on to my hard disk.
VL is on /dev/hda and I have a vfat partition on /dev/sda.

My fstab is as follows:

/dev/hda1 / reiserfs    defaults        1 1
/dev/sda1       none   swap   sw   0  0

   devpts           /dev/pts         devpts       gid=5,mode=620   0   0
   proc             /proc            proc         defaults         0   0
   /dev/fd0         /mnt/floppy      vfat,msdos  noauto,users,suid,dev,exec 0 0
/dev/sr0        /mnt/dvd        iso9660 auto,users      0       0
/dev/sda2 /mnt/backup   vfat    auto,users,rw   0       0

The file permission for /mnt/backup is as follows:
drwxr-xr-x 41 root root 16384 1969-12-31 17:00 backup

AS root I can't change the permissions:

chmod command doesn't change the write attribute.

vector://home/sridhar
root:# chmod a+rwx /mnt/backup/
vector://home/sridhar
root:# ls -al /mnt
total 16
drwxr-xr-x 17 root root   416 2010-11-12 21:53 ./
drwxr-xr-x 20 root root   464 2010-12-09 09:38 ../
drwxr-xr-x 41 root root 16384 1969-12-31 17:00 backup/
drwxr-xr-x  2 root root    48 2010-11-12 09:33 cdrom/
drwxr-xr-x  2 root root    48 2010-11-12 09:33 cdwriter/
drwxrwxrwx  2 root root    48 2010-11-12 09:33 dvd/
drwxr-xr-x  2 root root    48 2010-11-12 09:33 dvdwriter/
drwxr-xr-x  2 root root    48 2010-11-12 09:33 floppy/
drwxr-xr-x  2 root root    48 2010-11-12 09:33 hd/
drwxr-xr-x  2 root root    48 2010-11-12 09:33 linux/
drwxr-xr-x  2 root root    48 2010-11-12 09:33 loop/
drwxr-xr-x  2 root root    48 2010-11-12 09:33 memory/
drwxr-xr-x  2 root root    48 2010-11-12 09:33 pendrive/
drwxr-xr-x  2 root root    48 2010-11-12 09:33 tmp/
drwxr-xr-x  4 root root    96 2010-12-07 20:25 vl-hot/
drwxr-xr-x  2 root root    48 2010-11-12 09:33 win/
drwxr-xr-x  2 root root    48 2010-11-12 09:33 zip/
vector://home/sridhar
root:#

As such I could not copy files to /mnt/backup.

How to change this and make /mnt/backup writeable?



Logged
bigpaws
Vectorian
****
Posts: 1834


« Reply #1 on: December 09, 2010, 10:23:13 am »

Your mount point from fstab is saying that the group users can write to the
disk.

Your permissions you set on your directory is that only root:root can
read and write.

Hence the conflict.

Change one or the other.

I did not see version of the livecd noted.

Bigpaws
Logged
nightflier
Administrator
Vectorian
*****
Posts: 3942



« Reply #2 on: December 09, 2010, 12:07:28 pm »

I have run into a similar problem before. I create a mount point and set permissions. However, after mounting, the permissions change.

One workaround: as root, make a sub-directory on the newly mounted partition, then change the owner of it to your normal user (or just set write permissions on it). This should allow normal user full access to this subdir.
Logged
haywire
Vectorian
****
Posts: 507


« Reply #3 on: December 09, 2010, 07:47:23 pm »

Thats kind of funny... You can't write to this directory but you can write to the subdir? Linux is funny sometimes. Grin
Logged
varaahan
Member
*
Posts: 52


« Reply #4 on: December 12, 2010, 07:42:15 am »

But that doesn't work.

I created a directory named new under /mnt/backup as root.
chmod to a+rwx.
chown to sridhar.

root:# ls -al /mnt/backup/new/
total 8
drwxrwxrwx 2 sridhar root 4096 2010-12-12 00:05 ./
drwxrwxrwx 3 root    root 4096 2010-12-12 00:05 ../


On mounting the partition , I get this:

root:# mount -t vfat /dev/sda2 /mnt/backup/new/
vector://home/vl
root:# ls -al /mnt/backup/new/
total 139812
drwxr-xr-x 42 root root     16384 1969-12-31 17:00 ./
drwxrwxrwx  3 root root      4096 2010-12-12 00:05 ../
-rwxr-xr-x  1 root root   3477239 2009-10-25 17:54 9780596006259-059600625X.zip*
drwxr-xr-x  4 root root     16384 2010-09-14 04:55 Adobe\ Reader\ 9\ Installer/
-rwxr-xr-x  1 root root  22282587 2009-10-25 18:07 Building_with_Earth_-_Gernot_Minke.rar*

Ownerships automatically changes to root.
Logged
bigpaws
Vectorian
****
Posts: 1834


« Reply #5 on: December 12, 2010, 08:03:07 am »

You left the users  as root.

You can that by using chgrp and to change all files use the -R switch.

chgrp users /dir to be changed use the -R if you want all files recursiely
to be chnaged.

Bigpaws
Logged
nightflier
Administrator
Vectorian
*****
Posts: 3942



« Reply #6 on: December 12, 2010, 03:20:54 pm »

Mount the partition first, then make the new folder. Something like this:
Code:
mount -t vfat /dev/sda2 /mnt/backup/
mkdir /mnt/backup/new
chown sridhar:sridhar /mnt/backup/new
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!