ntroduction: Continuing Windows users who install Linux like to maintain a Fat32 partition for data storage and swapping between Windows and Linux. Often they get “Permission denied” or similar messages when they try to write to the Fat partitions. This Tutorial shows how you set the user and group IDs in the file system table located at /etc/fstab to allow broad writeable access. The easy way is just to edit the fstab entries entries but if you’re from Windows Land you will be slaves to the GUI for a while. I do include fstab entries for advanced users who might browse here for reference.Scene Setting: The screenshot to left, Pic 1, shows my filesystem viewed in Yast’s Expert Partitioner, located at Yast –> System –> Partitioner. Yours will of course be different.
There are eleven partitions in this example on my primary drive, sda, and the Fat32 partition is highlighted in blue, partition sda3. We’re only concerned here with the Fat32 partition.
Mount Point: The files on the Fat32 partition will appear in a directory/folder of your choice once sda3 is mounted. For illustration I choose “fat32″ in the directory /mnt; this directory is conventionally used in Suse for locating mounts although there’s no compulsion to use it. So for illustration the mount point is /mnt/fat32.
Mounting using Yast: In Yast –> System –> Partitioner you highlight the Fat32 partition in Pic 1 and click “Edit”. The screen in Pic 2 opens up and there you insert into the panel for “Mount Point” the path to the directory of your choice; e.g. /mnt/fat32.
Then Click “Fstab Options” in Pic 2 to set ownership and other details. The screen in Pic 3 will open up. Activate the selection “Device Name”. If the line users,gid=users,umask=0002,utf8 is not in the slot for “Arbitrary option values” then type it in. This line gives ownership to root and read/write access to all users. These permissions are meaningless in Windows and do not carry across when viewed there. In Windows all files belong to all users.
From this point you click the appropriate “OK”, “Next” and “Apply” buttons to make it happen.
Permissions on the mount point: The mount point, /mnt/fat32, needs to have ownership=root and group=users. In openSUSE 10.3 that happens automagically but it doesn’t happen that way in openSUSE 10.2 or Suse 10.0, 10.1. You must make the necessary changes to the mount point (folder/directory) when the partition is NOT mounted.
Here are the extra steps needed in Suse 10.0, 10.1 and openSUSE 10.3.
- • Open a terminal and assume root privileges with command: su
- • Unmount the partition with command: umount /dev/sda3
- • Change ownership with command: chown -R root:users /mnt/fat32
- • Change permissions with command: chmod 775 /mnt/fat32
Just for completeness, you could do the last three steps in a GUI using Konqueror or Nautilus. First unmount the partition. Then Navigate to the folder /mnt/fat32 and change the ownership and permissions as shown for Konqueror on the left in Pic 4.
Here is the entry in fstab for the mount:
/dev/sda3 /mnt/fat32 vfat users,gid=users,umask=0002,utf8=true 0 0
Bug in Yast Partitioner in openSUSE 10.3: Sometimes in 10.3 the line in fstab for the mount lists the device by device ID rather than by device path as emphasised in red in Pic 3. Why? It is because even though you choose “Device name” in Pic 3, you get “Device ID” transferring through to fstab. That’s a bug in Yast Partitioner but only in 10.3. You can fix that by editing the entry in fstab and changing it to look like the line directly above. You can edit fstab directly with this command in a terminal:
For KDE use kdesu kwrite /etc/fstab
For Gnome use gnomesu gedit /etc/fstab
I will remove this bug work-around when and if it’s fixed. Please let me know if you discover it’s fixed before I do.
But I want Privacy From Others: In this case you make the mount point in the territory of the chosen user, say at /home/michael/fat32. It’s a standard folder with no special permissions, owned by “michael” with default permissions drwxr-xr-x. Do that first. You can mount the partition in Yast using the new mount point (/home/michael/fat32) instead of the one shown in Pic 2 and these “Arbitrary options” instead of the ones shown in Pic 3: uid=michael,gid=users,utf8=true.
Now the Fat32 partition will be writeable by Michael and readable by all users. If you want absolute privacy you can make a directory within fat32 that is “forbidden” to all users but Michael. Note that you cannot make the directory fat32 forbidden to other users, only directories under directory fat32. Here is the entry in fstab for the fat32 partition under these more restricted circumstances:
/dev/sda3 /home/michael/fat32 vfat uid=michael,gid=users,utf8=true 0 0
That’s all folks. Hope it helps.
Posted by raghupathy in Windows.
I’ve been asked this question many a times:
Why can’t we create a folder by name CON? Although it seems a wonder or magic that we can’t create a folder by that name, in reality, it is not so. It has a definite reason, and in fact, a folder
can be created using that reserved name.Gone are the days when computers had only CUI OS, that is,
Character User Interface Operating Systems, like
MS-DOS. When I joined my first computer course nine years ago,
Windows 95 was ruling. You could see
Windows 98 here and there. We were in 8th standard, and working on a computer was like a dream coming true. Microsoft’s Paint Brush was the only known (for us) GUI software and was the greatest means of entertainment. The instructors taught us only
MS-DOS commands and how to
Shut Down the computer. Remembering such weird names as DIR, CD, MD, RD, CHKDSK, FDISK, VER, ATTRIB, REN, DEL etc. along with their syntax and usage was a great accomplishment. But I had a problem understanding this: DOS has a separate dedicated command for every action; literally every action, except…
creating a file!
Yes, we used COPY CON filename to create a file with name filename. Anyone can say that it is a form of COPY command. So, why was creating a file different than all other commands? I didn’t understand it, till I found out how to print using DOS, almost four years later.
DOS uses different names for the attached devices, I learnt. PRN was one such name. TYPE filename would display the contents of a file and TYPE filename > PRN would print it instead of displaying. Curiosity brings many hidden matters out. PRN would surely mean Printer and will redirect the output to the printer instead of console. Console (monitor) is the implicit default output device, and it can be bypassed if needed. So, how to put it explicitly? There must be some means to do that. Yes, there is! TYPE filename > CON performs exactly same function as TYPE filename. These special names for the devices really mean something special for the operating system and those names can not be used as folder or file names: CON, PRN, NUL, COM1 to COM9, LPT1 to LPT9, which stand for CONsole, PRiNter, NULl, serial COMmmunication ports, Line PrinTer ports.
The time has changed and Operating System can also be fooled! But still, many people think that it is not possible to create a folder by name CON. Using the path of network drive, these special names can also be used as folder names! Here is how:
- Goto DOS
- Type MD \\.\C:\CON. The folder will be created. You can check it in Windows Explorer also, but you can’t access it
- To delete the folder, type RD \\.\C:\CON
In short, use the network path syntax instead of absolute path syntax.
Now on to the practical aspect of this. Why can’t we create it directly but using the network path syntax? The answer is simple. A computer can have only one default console, printer, null etc. So, if it is accessed from a network, theoretically, the console should belong to another node in the network. Since that node may not have a device which can be referred using the name CON, it will no longer be considered as a reserved name. Hence, the folder can be created.
The next time when someone asks the question why we can’t create a folder by name CON, say with confidence that it is not true…