LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   setting permission (https://www.linuxquestions.org/questions/linux-newbie-8/setting-permission-519272/)

SVwander 01-14-2007 04:17 PM

setting permission
 
Okay, I give up! When I reinstalled Ubuntu somehow I lost permission to delete files on my usbdisk. I have researched and found I can use chmod to change the permissions for the ubsdisk but nothing I have tried works. Can someone walk me through it?
I have used this command:
sudo chmod rwx /media/usbdisk/PHOTOS_1

it didn't work so I tried it with a - before the rwx but I read that counters the permission. Anyway, can someone show me how to correctly form the command. Later I will look at how to apply permission to read write and execute using gedit.

Tim

PatrickNew 01-14-2007 04:24 PM

Well, I'm not sure, but I think you need a + before the rwx, but the best solution is to use 777, the octal combination for the same thing.

uselpa 01-14-2007 04:25 PM

Try
Code:

sudo chmod ug=rwx /media/usbdisk/PHOTOS_1

SVwander 01-14-2007 04:39 PM

Quote:

Originally Posted by uselpa
Try
Code:

sudo chmod ug=rwx /media/usbdisk/PHOTOS_1

tim@tim-desktop:~$ sudo chmod ug=rwx /media/usbdisk/PHOTOS_1
Password:
chmod: changing permissions of `/media/usbdisk/PHOTOS_1': Read-only file system
tim@tim-desktop:~$

I think it is still read only. All I need to do is delete the files off that usbdisk. I am using Nautilus 2.16.1 and refreshing after the command in the terminal. I am RESISTING the urge to go to XP to delete those files!

Tim

PatrickNew 01-14-2007 05:29 PM

try one last thing, change it to
Code:

chmod 777 /media/usbdisk/PHOTOS_1/*
That will act on each item separately, instead of changing the general permissions of the folder.

SVwander 01-14-2007 05:42 PM

Quote:

Originally Posted by PatrickNew
try one last thing, change it to
Code:

chmod 777 /media/usbdisk/PHOTOS_1/*
That will act on each item separately, instead of changing the general permissions of the folder.

Well, I am still not there. It is still claiming it is a read only disk. I have pasted my the output below and the error message when trying to delete the files.


tim@tim-desktop:~$ chmod 777 /media/usbdisk/PHOTOS_1/*
chmod: changing permissions of `/media/usbdisk/PHOTOS_1/01120001.JPG': Read-only file system
chmod: changing permissions of `/media/usbdisk/PHOTOS_1/01120002.JPG': Read-only file system
chmod: changing permissions of `/media/usbdisk/PHOTOS_1/01120003.JPG': Read-only file system
chmod: changing permissions of `/media/usbdisk/PHOTOS_1/01120004.JPG': Read-only file system
chmod: changing permissions of `/media/usbdisk/PHOTOS_1/01120005.JPG': Read-only file system




tim@tim-desktop:~$ ls -l /media/usbdisk
total 168
-rwx------ 1 tim tim 18183 2006-12-18 19:18 checking2.QIF
-rwx------ 1 tim tim 98304 2006-12-27 12:25 Jackie76a.doc
-rwx------ 1 tim tim 33783 2006-12-27 11:34 jackie76.wp
drwx------ 2 tim tim 4096 2006-12-22 10:56 PHOTOS_1
-rwx------ 1 tim tim 11237 2006-12-26 11:20 timesaddress.ldif

Error while deleting.
"/media/usbd...cking2.QIF" cannot be deleted because it is on a read-only disk.

stress_junkie 01-14-2007 05:50 PM

Quote:

im@tim-desktop:~$ sudo chmod ug=rwx /media/usbdisk/PHOTOS_1
Password:
chmod: changing permissions of `/media/usbdisk/PHOTOS_1': Read-only file system
tim@tim-desktop:~$

I think it is still read only. All I need to do is delete the files off that usbdisk. I am using Nautilus 2.16.1 and refreshing after the command in the terminal. I am RESISTING the urge to go to XP to delete those files!
According to your error message from the chmod command you are correct in believing that the file system on the USB disk is mounted read only. That could be due to it being formatted with the NTFS file system. Generally Linux will mount NTFS file systems as read only. It's a pity that you didn't include that error message in your original post. That information would have helped the people who read your post to better understand the problem.

I don't know if Ubuntu has the latest NTFS driver that allegedly can reliably write to NTFS file systems without corrupting them. Generally you want to use Win FAT32 file systems to store files that will be accessed by both Linux and Windows. If Windows would not be used then a Linux file system is the best choice.

How did the files get on this disk? Did you use Windows to put the files there?

You can try to use the disk as is, presumably with an NTFS file system. In that case you would do something like this. This example has the USB file system mounted at /mnt/usb1.
Code:

mount -o rw,gid=100,mode=777 /dev/sda1 /mnt/usb1
That should do the trick. However if you have an NTFS file system on the USB drive you are playing with fire. You would be better off reformatting the USB file system either with Win FAT32 or with a Linux file system like ext3.

alinuxfan 01-27-2007 07:51 AM

I am getting the same error after I did a fresh install. I cut a whole folder of pictures and pasted them onto my computer while updates were being installed with synaptic and now after the updates, something messed up my ability to mount as a writable drive

I put the files on my stick so that I could re-install my system...
and now with a fresh install I can't read the disk.

SVwander 01-28-2007 08:27 AM

Quote:

Originally Posted by alinuxfan
I am getting the same error after I did a fresh install. I cut a whole folder of pictures and pasted them onto my computer while updates were being installed with synaptic and now after the updates, something messed up my ability to mount as a writable drive

I put the files on my stick so that I could re-install my system...
and now with a fresh install I can't read the disk.

Keep at it. It took me several tries before I was able to move those files but the instructions above will get you there.

gonzojd7 01-28-2007 11:04 AM

Read only problem?
 
Try posting a printout of your mounted systems with the usb stick in.

Use this command in a shell/terminal:

$mount

The output should tell you how your usb is mounted,

/dev/sda1 n /mnt/usb type vfat (rw)

If it states (ro) at the end then you need to edit the fstab to make it (rw)

Then post the results here. It may be possible that the usb stick is mounted ro (read only). If it is then you just need to edit the line in fstab and have it read rw.

sample line in fstab

/dev/sda1 /mnt/thumb vfat defaults,user,rw 0 0

Let me know how you make out ? :Pengy:


All times are GMT -5. The time now is 04:58 AM.