LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   SUSE / openSUSE (https://www.linuxquestions.org/questions/suse-opensuse-60/)
-   -   Enabling rwx permissions on my removable USB hard disk? (https://www.linuxquestions.org/questions/suse-opensuse-60/enabling-rwx-permissions-on-my-removable-usb-hard-disk-486005/)

mejpark 09-22-2006 10:41 AM

Enabling rwx permissions on my removable USB hard disk?
 
Good afternoon folks,

I have a Freecom USB Network Drive, which is automatically mounted at /media/Network_Drive when I switch it on. I want to gain full access to this resource, but I don’t know how.

I tried changing the permissions using File Manager in Super User Mode, which gives me this error: Could not modify the ownership of file /blah/blah/blah You have insufficient access to the file to perform the change.

Surely I should be able to change the permissions as root? Please help!

Many Thanks,

mejpark

camorri 09-22-2006 10:54 AM

What file system type is the drive formatted to? If it is fat32 or NTFS that will not work. SU mode should be able to change file and directory permissions.

mejpark 09-23-2006 09:00 AM

Quote:

Originally Posted by camorri
What file system type is the drive formatted to? If it is fat32 or NTFS that will not work. SU mode should be able to change file and directory permissions.

Ahhh crap, yeah it's an NTFS. But I can read all the files, so surely I should be able to write and execute them aswell?

The mind boggles

stress_junkie 09-23-2006 09:19 AM

Linux mounts NTFS partitions as read only by default. You can force it to mount the partition as read write. Since this is automatically mounted when it is detected then you can use the remount option to change the mount characteristics (read only). You have to know the name of the raw device. It is probably /dev/sda1 but you can check it by reading the /proc/mounts file when the USB is plugged in and mounted.
Code:

root> cat /proc/mounts
rootfs / rootfs rw 0 0
udev /dev tmpfs rw 0 0
/dev/hda1 / reiserfs rw 0 0
proc /proc proc rw 0 0
sysfs /sys sysfs rw 0 0
...

You look for /media/Network_Drive in that list and see what the raw device is called. Then use that in the following instruction. In the following example I have used /dev/sda1 as the USB device.
Code:

root> mount -o remount,rw,gid=100 /dev/sda1 /media/Network_Drive
Now that you know the name of the raw device you can put an entry into /etc/fstab to mount the USB device as read write automatically.
Code:

/dev/sda1    /media/Network_Drive    ntfs    rw,gid=100    0  0
Now having told you how to do that I should say that you will almost certainly regret taking this course. The NTFS file system driver for Linux is not reliable for writing to the file system. You will almost certainly corrupt the file system if you write to it frequently from Linux.

A better solution would be to put a file system on the USB device that can be reliably used by Linux. If the USB device needs to be used in both Linux and in Windows then I would format the USB device with the FAT32 file system. Linux can reliably write to that kind of file system. If you don't have to use the USB device with Windows then I would put a journaling file system on there such as XFS. I won't write instructions for that unless you say that you want to take that advise.

MikeEnz 09-24-2006 04:14 AM

Quote:

Originally Posted by stress_junkie
A better solution would be to put a file system on the USB device that can be reliably used by Linux. If the USB device needs to be used in both Linux and in Windows then I would format the USB device with the FAT32 file system. Linux can reliably write to that kind of file system. If you don't have to use the USB device with Windows then I would put a journaling file system on there such as XFS. I won't write instructions for that unless you say that you want to take that advise.

Is there anyway of doing this without deleting the data on the disk? I have about 100 gig on the USB hard drive and I can't write to it!

camorri 09-24-2006 06:12 AM

Quote:

Is there anyway of doing this without deleting the data on the disk? I have about 100 gig on the USB hard drive and I can't write to it!
Yes, as long as you have some free space on the drive. Look to see how much of the drive is used, with files. As long as you have enough empty space to make the effort worth while, you can get a partitioning tool like Partition Magic, and shrink the esisting partition. That gives you free space.

You then make a new partition(s) as required, format with a linux supported file system Ie, reiser, ext2 , ext3 or the one of your choice. Make mount points, and mount the new file systems. Then you can copy any data to the new file systems you want linux to read and write to.

Make sure you back up your data on the NTFS first; you have been told.

mejpark 09-27-2006 09:22 AM

Quote:

Originally Posted by stress_junkie
Linux mounts NTFS partitions as read only ... Now having told you how to do that I should say that you will almost certainly regret taking this course. The NTFS file system driver for Linux is not reliable for writing to the file system. You will almost certainly corrupt the file system if you write to it frequently from Linux.

I'm using Novell SUSE 10.1. Does this OS have the same isses?

Quote:

Originally Posted by MikeEnz
Is there anyway of doing this without deleting the data on the disk? I have about 100 gig on the USB hard drive and I can't write to it!

Here, here! Mine has a capacity of 250 gigs!

mejpark

camorri 09-27-2006 10:39 AM

mejpark,

There is no reliable NTFS driver yet ( for any linux distro ) to write to NTFS drives. There are some that do it, but come with warnings, and do not guarantee the results. Is it an 'issue' ? That is for you to decide. My intention is to dump windoze all together, and I knew in advance about NTFS. I still share a partition with w98 on my main machine, but it is fat32. That works very well and has never given my any problems.

NTFS is propriatory code, Bills boys wrote it, they own it. The drivers that exist are basically reverse engineered drivers. Fat32 is a much simpler file system and was part of DOS, long before IBM gave it away to Bill and the boys.

mejpark 10-06-2006 07:13 AM

Okay, I've taken stress_junkie's advice and formatted the disk into several smaller 32 GB FAT partitions, but I have a new problem:

What should I put in /etc/fstab to allow normal users full rwx access to this partition? I tried the following otions and neither of these worked for me:

1st try:
/dev/hdb1 /mnt/projects vfat defaults 0 0
2nd try:
/dev/hdb1 /mnt/prpojects vfat noauto 0 0

I also tried changing the owner from root to michael like so:

# su -
# chown -R michael /mnt/projects
Operation not permitted.

please help me!

Thanks in advance.

camorri 10-06-2006 09:05 AM

Here is what works on my system with vfat partitions. These two partitions mount at boot time and regular users have full access. The lines are from my /etc/fstab file.

Code:

/dev/hda1 /mnt/win_c vfat umask=0,iocharset=iso8859-15,codepage=850 0 0
/dev/hda5 /mnt/win_d vfat umask=0,iocharset=iso8859-15,codepage=850 0 0

If you copy a line, you will need to edit the /dev/hdxx part, and the mount point for your file system. That should be it. Also make sure your mount point exists before you try to mount the partitions. You need to use mkdir if they don't exist first.

Let us know how it goes.

mejpark 10-10-2006 11:07 AM

That's great camorri (it worked like a charm)... Just out of interest, where did you find out the appropriate options to use?

Thanks again

camorri 10-10-2006 01:08 PM

I glad it worked for you. I went through a long learning curve, like most first time linux users, about 3 years ago. I found a thread on this board when I was figuring out how to mount a partition. I copied the options from there. Since then I spent some time reading the man pages ( boring I know ). Since then fstab is no longer either a mystery or difficult to figure out.


All times are GMT -5. The time now is 01:34 PM.