LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Hardware (https://www.linuxquestions.org/questions/linux-hardware-18/)
-   -   Diskette Permissions & Saving (https://www.linuxquestions.org/questions/linux-hardware-18/diskette-permissions-and-saving-502603/)

Tux-O-Matic 11-17-2006 04:00 PM

Diskette Permissions & Saving
 
I realize that a diskette contains no permissions; however, I ran into a few problems in saving.
Alright, so I finally mounted my floppy to /mnt/floppy (I even created an alias for mounting it). However, in my own account I don't have permissions to change the floppy. When I changed to root, I tried
Quote:

chmod a+r+w+x /mnt/floppy
but that didn't work. Then I tried
Quote:

chmod 0666 /mnt/floppy
That didn't work either. I tried chmod once more, this time read and write separately:
Quote:

chmod 0222 /mnt/floppy
chmod 0444 /mnt/floppy
Nothing still worked. So I decided to copy the directory I needed directly as root. I tried cp <whatever the directory was>, I couldn't copy it--the output was:
Quote:

ommitting directory <dir>
//"dir" is the last directory in the path
So then I used the GUI. I supposedly copied the file (it showed it in the GUI, and showed it in the command line), and so I typed:
Quote:

umount /mnt/floppy
and then
Quote:

umount -a
just to make sure. The command line didn't complain both times except to to say the second time that /mnt/floppy was already unmounted. But when I was going to do the file trasnfer on a Windows machine, the file didn't exist.

The funny thing was, I copied files earlier, and unmounted the floppy in the same way, but when I remounted and checked the floppy, the files weren't there, so I did it again, and they stuck.
From what I see, I need to mount and remount the floppy twice in order for a file to stick and be saved. Is that true or am I doing anything wrong. I appologize for the length of this message

David the H. 11-18-2006 10:25 AM

chmodding doesn't work for FAT filesystems. You have to use the umask mount option to simulate them. "mount -t auto -o rw,umask=111 /dev/fd0 /mnt/floppy" should give you 666 permissions on the files. You can also use "uid=username" and "gid=groupname" to designate a user and group respectively.

As for files not showing up, under the default mount config data will sometimes stay in a write buffer for a while before actually getting written to the disk. Perhaps you aren't giving it enough time to complete the transaction before you're unmounting it. Try using the "sync" option to force the files to copy directly.

You may want to read up on mount options in "man mount", especially the fat filesystem options.

Regarding cp, it can only copy empty directories by default. You have to use "cp -R" to recursively copy a whole directory structure. Again I suggest you read the man page.


All times are GMT -5. The time now is 11:02 PM.