PDA

View Full Version : Can't copy files to USB flash drive



pnthrxs
15th July 2008, 12:46 AM
I am new to Linux, and did not realize trying to do something as simple as copy a file to a USB flash drive would be so difficult. When I attempt to copy anything to my flash drive, I get "Error while copying to 'disk-1'. The destination is read-only.
When I look at the properties of 4.0 GB Media, in the permissions tab, it says "The permissions of 'disk-1' could not be determined. When I try to cd disk-1, cd "4.0 GB Media", or cd sdb in terminal, there is no such file or directory.
This flash drive works without any effort at all on my Mac and My Windows box, so why doesn't it work with Linux?
The drive is mounted, I can open files from it, I can copy files from it, I just can't copy files to it. There seems to be no way to make it have read-write permissions.

Fedora 9 Kernel version 2.6.25-14.fc9.i686

pnthrxs

stevea
15th July 2008, 03:02 AM
Use the search tab - this has been asked and answered 100 times. The most probable answer in your case is that VFAT file systems to not have file ownership & permissions compatible with Linux, so the default mount will only let root wrte to the device.

Remount with options or use root privileges.

There are a few other possibilities.

pnthrxs
15th July 2008, 05:27 PM
I did use the search tab, and Google, and Dogpile, and Ask, and Lycos to try and find a clear and detailed answer to my question. Only after a couple of hours of research with no success, did I post a new thread here.

For my fellow noobs who would like a clear and detailed answer to this question, this is what worked for me in Fedora 9 kernel version 2.6.25-14.fc9.i686.

1. With the flash drive inserted in the USB port, run the mount command with no operators or arguments to see the list of mounted devices and determine the name of your flash drive. I have highlighted mine in blue.


[pnthrxs@localhost ~]$ mount
/dev/mapper/VolGroup00-LogVol00 on / type ext3 (rw)
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
devpts on /dev/pts type devpts (rw,gid=5,mode=620)
/dev/sda2 on /boot type ext3 (rw)
tmpfs on /dev/shm type tmpfs (rw)
none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
sunrpc on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw)
fusectl on /sys/fs/fuse/connections type fusectl (rw)
gvfs-fuse-daemon on /home/pnthrxs/.gvfs type fuse.gvfs-fuse-daemon (rw,nosuid,nodev,user=Scott)
/dev/sda1 on /media/disk type fuseblk (rw,nosuid,nodev,allow_other,blksize=4096)
/dev/sdb on /media/disk-1 type vfat (rw,nosuid,nodev,uhelper=hal,shortname=lower,uid=5 00)


2. Use the su command and root password to change to super user mode and enter the following command substituting /dev/sdb with the name of your device.


mount -o remount -w /dev/sdb

3. Exit terminal.

Now you should be able to copy files to your flash drive.

The man pages on mount are very long and cryptic, but with some patience and perseverance, you should be able to figure out exactly what this line of code does.

I believe there is a way to make this automatic by adding a line to the /etc/fstab file, but I will have to do more research on that one.

pnthrxs