Since about a week or so I’ve been running Ubuntu and Windows Vista in dual boot. I’ve had Windows Vista for a longer time already and after trying Ubuntu from the LiveCD I decided it was time to install it for real. When doing this stuff you really need to plan how you’re going to use your available hard disk space. What I wanted to achieve was to be able to access all my personal files from both Ubuntu as well as Vista. By personal files I mean the files that are stored in Documents, Music, Videos, Pictures, etcetera. Both Vista and Ubuntu have these folders built in.
I decided to create a FAT32 partition to hold these personal folders. I knew I could then change the location of the personal folders in Vista to this FAT32 partition and create symbolic links to these folders in Ubuntu. This way it looks like you’re just browsing your Documents folder while you’re actually on the Documents folder on the FAT32 partition. This all seemed to work out great. I had my personal folders in my ‘/home’ folder on Ubuntu and in Vista I could reach them via Username -> Documents.
But ofcourse things can never be as easy as they seem. After doing this I didn’t have write access to some of my personal folders in Ubuntu. The folders that were linked to personal folder in Vista were read only, all the other folders on the FAT32 partition adhered to rules I had set in /etc/fstab. I participated in a couple of forum threads about this, but nobody ever seemed to be able to provide a solution. I still don’t really know what’s causing this problem but I have found a way to fix it. The answer is really quite simple but it’s not something you’d expect.
We’ll start off by linking Vista’s personal folders to the ones on the data partition. You can do this by right clicking on of the personal folders, going to the tab that says ‘Location’ and change the location listed there. In my case I’m pointing my Documents folder to ‘E:\Walter\Documenten’ as you can see in the following image:
There are also folders that Vista doesn’t have natively while I do want them in my Personal folder. In my case for instance that’s a ‘Webs’ folder. It’s the one where all my web development projects are in. To have it show up in your personal folder you can just make a new shortcut to it. You can even pick a nice icons for it. See below:
Here’s what my data partition looks like in Vista after changing the location of my personal folders to it. The folders actually get the same icons:
If I reboot into Ubuntu now and go to my data partition (I’m assuming you already mounted your FAT32 partition correctly) I’m seeing something really odd. The folders that have been linked to from my personal folders in Vista are locked. The non Vista native folders like the ‘Webs’ folders aren’t. See the two images below:
If we type the ‘ls -al’ command in the terminal for the folder that you mounted your data partition to (in my case it’s located at ‘/data’) we can see what the locks mean:
The folders appear to be read only. This wasn’t the case before we did our thing in Vista. As a matter of fact it’s not supposed to be possible since FAT32 partitions don’t support file and folder permissions and so should be mounted according the rules you set in ‘/etc/fstab’. We’ll fix this strange behaviour later. First we’ll set up symbolic links to these folders from our ‘/home’ folder. To be able to do that we’ll first delete Ubuntu’s native personal folders that have similar names. In my case I needed to delete ‘Pictures’, ‘Documents’, ‘Videos’ and ‘Downloads’. See the two images below for a before and after shot of my ‘/home’ folder (/home/waltervos in my case).
Now we’ll set up the symbolic links. First off open up a terminal as root: press ALT + F2 and type ‘gksu gnome-terminal’. You’ll be prompted to enter your password. The syntax for symbolic links that we’ll be using is ‘ln -s [TARGET] [LINK FOLDER]‘. In my case, to make a link to my ‘Downloads’ folder I had to enter the following: ‘ln -s /data/Video /home/waltervos/’. This creates a link to ‘/data/Video’ in the ‘/home/waltervos’ folder with the same name as the target folder. See the image below for all the commands I used:
This made my ‘/home’ folder look like so:
Unfortunately the file permissions remain the same. We still can’t write to some of the folders. To fix this strange bug (feature?), all you really need to do is chmod the misbehaving folders in their original location like so (execute these in a terminal as root as we did when creating symbolic links earlier):
chmod 0775 -R /data/Documents
chmod 0775 -R /data/Pictures
chmod 0775 -R /data/Video
chmod 0775 -R /data/Music
Do this for every misbehaving folder and the problem is solved. Once again, what’s strange about this is that FAT32 partitions aren’t supposed to support file and folder permissions. The above commands aren’t supposed to work! See the image below for a before and after shot:
If we reboot into Vista now we’ll see that some things have changed. We lost the icons on the personal folders that Vista and Ubuntu have in common now, and there is a double Documents folder now. You can delete the one that’s empty.
This is what you’ll end up with. Your personal folders are now accessible under Ubuntu and Vista in their default location. Unfortunately you have lost the pretty icons in Vista because of this and I haven’t found a way to do something about that yet. It’s really not that big of a deal I think.
Please do post your thoughts on this article in the comments. Do you know why this is happening? Did this walkthrough help you out?












Thanks, I had this issue and this should solve it.
12 August 2008 at 15:55Thanks for the comment Omicron, let me know how it works out!
12 August 2008 at 15:59Thanks for this. I’ll give it a try when I have time and let you know how I get on.
13 August 2008 at 15:51Thank for the comment! Looking forward to hearing from you Simeon!
14 August 2008 at 08:11FAT file systems (including FAT32) do support read-only permissions for files, but it seems unlikely that Windows would set that. The FAT file systems have several other file and directory flag bits, but they don’t map directly to Unix permissions. Perhaps Vista is setting one of that is handled strangely by the Linux FAT filesystem code.
15 August 2008 at 02:38I suspect there is a simpler explanation.
You may have put the wrong thing in /etc/fstab
typod
It may have been misdocumented or changed in mount(8)…
What options _did_ you put in /etc/fstab ?
something such as
LABEL=/Documents /home/username/docs vfat umask=000,mode=777 0 0
???
And if you reboot the system (without booting into Vista)
What ‘permissions’ do the files show as?
I.E. maybe it’s not Vista.. maybe it just happens whenever
15 August 2008 at 02:57the filesystem remounts
a simple “-o umask=00″ is what you want. Try that when mounting the partition. This issue goes way back; not just a Vista thing at all.
15 August 2008 at 04:10“-o umask=000″ uggh…. it’s a typo night for sure..
15 August 2008 at 04:11I suspect these folders were set to read only so that the custom icons did appear. Specifically, referring to http://support.microsoft.com/default.aspx?scid=kb;en-us;812003
• Windows may also store customization information in a hidden Desktop.ini file in the folder. In this case, Windows sets the read-only attribute on the folder to instruct Windows to look for the Desktop.ini file. The read-only attribute does not prevent you from performing common file and folder tasks (such as copy, move, delete, and rename), but the read-only attribute can cause problems for some older programs.
Although, Vista is not called out in ‘Applies To’…
15 August 2008 at 04:21I see a couple of people have already pointed the root cause of your problem, that Vista (like XP before it) will set the read-only bit on directories it shows customized views of. There’s more details and instructions for how to fix it on the Microsoft side of things (rather than using chmod on Linux) at http://support.microsoft.com/kb/326549 , using the old-school attrib command. They say it’s not a bug, “this behavior is by design”. It’s certainly not an Ubuntu problem, Ubuntu is just paying attention to the read-only properties on the FAT32 directories like it’s supposed to.
15 August 2008 at 04:53Speaking of typos… No, this isn’t a typo, it’s clearly deliberate:
“I used Video instead of Video’s because I didn’t know how to write and apostrophe in the terminal”
The plural of “video” is “videos”. It does not have an apostrophe in it.
The word “and” is a conjunction, not an article (which is what “a” and “an” are). Some people gloss over the final “d” in “and”, e.g. “John an’ Mary went to her parents’ house”, which leads others to “hypercorrect”, as if “an” were always a nonstandard form of “and”. It is not.
(See how I worked in that apostrophe after the “s” in “parents’”? That’s an example of a possessive plural. The “s” makes “parent” plural, and the trailing apostrophe shows the ownership of the house by the parents.)
15 August 2008 at 04:54Well done The Monster. That thing about “video’s” definitely needed to be said. It annoyed me the first time I read it, but considering this article might be a livesaver for me, I decided to brush over it… this time.
Still haven’t had time to try it, but I will!
15 August 2008 at 05:29Monster and Simeon: It is quite likely that Walter is ESL (Documents is “Documenten,” after all), and thus, the apostrophe may be a carryover from his native tongue, in which it may actually be correct. (I woud suggest German, but there is no need for an apostrophe there, either. Dutch maybe? Of course, it could also just be confusion over the rules of English…)
15 August 2008 at 05:44Many borrowed words in Dutch *do* have the apostrophe as part of the word. This is because adding an s to pluralize it would otherwise change the vowel length.
Some examples:
baby’s
video’s
pagina’s
Do a google search for dutch grammar apostrophe.
15 August 2008 at 06:38To prevent accidents when creating symbolic links using ln (or when copying or moving files using cp and mv, as they have a similar syntax), you should add a trailing slash to the target directory, i.e.
ln -s /data/Video /home/waltervos/
Now if the target directory does not exist, ln will tell you so, instead of silently creating a symlink called waltervos in /home/
15 August 2008 at 08:33Wow, a lot of comments to respond to. Thanks!
First off, regarding the apostrophe thing: I’m Dutch and in my installation the folder was called Video’s. Thinking about it, that would be wrong in English. I’ll take it out. It’s clutter anyway.
Regarding my fstab file, the line that refers to my FAT32 partition is as follows:
/dev/sdb1 /data vfat defaults,utf8,rw,gid=1001,umask=002 0 0
Because there’s more users on this system I couldn’t use the uid parameter. I created a new group with all the users in it instead and used the gid parameter. Regarding nawcom’s umask suggestion, different fstab rules won’t make a difference. I tried them all. As I explained in the post some folders on the partition do listen to fstab, others don’t. That’s the essence of the post.
To RJ Bergeron and Greg Smith: Thanks for the suggestions, I’ll look into it!
Douglas: thanks for your suggestion, I’ll edit the post (not the screens though).
15 August 2008 at 09:15What if the problem was the filename itself ? Back in the days those folders were actually named “My Documents.{A_SERIES_OF_HEX_VALUES}” that were never displayed (the values mapped to CLSID in the registry). If you wanted to have a “Control Panel” folder on your desktop you just add to create an empty folder an rename it to add the right value. (Sample here : http://www.onecomputerguy.com/desktop.htm#control1)
15 August 2008 at 10:39The first flaw is - why FAT32?
A stable NTFS release http://www.ntfs-3g.org/ already exists.
15 August 2008 at 11:11Hey Nero,
I’ll try that out some other time. I don’t think it will fix this particular problem right out of the box though.
@Cro: the problem was in Ubuntu, not in Vista. I’m not sure I understand how your comment relates to this issue.
15 August 2008 at 11:43What do you mean by “Ubuntu doesn’t really seem to support it [NTFS] too well”?
Ubuntu was one of the first distributions who provided reliable NTFS read/write support using the NTFS-3G driver. I use it all the time over a year and never had problems.
15 August 2008 at 12:28Another solution:
15 August 2008 at 12:38use ext2 or ext3 as filesystem for the personal folders.
To read and write ext2 or 3 on Vista install ext2ifs (search google).
This solution works for me since Ubuntu 7.04 with XP SP1/SP2 and Vista.
Hey Fodoro,
perhaps I was too easy to conclude that. From googling around I saw some forum threads about problems with it. Perhaps I should take it out of the post. As several people already mentioned though, it probably won’t change this behaviour.
@no_use_for_a_name: Did you use the same scheme as I did? Linking personal folders in Vista to that partition? If so, I might try it out some time.
15 August 2008 at 13:01Robert, when I write in German, I use German rules of spelling, punctuation, and grammar. When I write a shell script, I adhere to the its rules, and those of the flavor of Unix I’m writing for. That my native tongue is English doesn’t mean I should try to unmount a filesystem, because that is not the correct spelling in any dialect of Unix, even though it is correct in English.
At least Walter has the excuse that the apostrophe is correct in Dutch. And his English is far better than my Dutch (I’m only able to read Dutch to the extent that it is similar to English and German). I see those two errors pretty much every day in the writings of people whose first language is English.
The problem with using an apostrophe in a file/directory name is that the same character is considered a single quote mark, and has special meaning to the shell. Similar problems exist with whitespace characters. If you simply must have these characters in a pathname, you have to either quote or “escape” (precede by a backslash) it:
mkdir “/home/monster/pix/Monsterette 1’s Wedding Pictures”
cp /media/sdcard2/001823.jpg /home/monster/pix/It\’s\ a \Girl
And you have to remember to do one of those things every time you want to manipulate those odd-named files and directories.
For those of you who want Linux to read and write NTFS partitions, or for Windows to read and write ext[23], I have to say it’s a really bad idea. I dual-boot my laptop (Ubuntu and XP Home) and use a FAT32 that both OSes can read and write to, because I don’t trust Microsoft not to do something to screw up NTFS to where the Linux code suddenly starts trashing things, or do something to Windows itself to make the ext* drivers running on it do likewise. They’ve been caught deliberately making software written by others have problems on their OSes.
But FAT32 is a standard that they really can’t mess up, as digital cameras, flash memory devices, and cell phones use it. If they did anything funky with it, suddenly Windows might not be able to handle those devices even on machines that have never been graced with a Linux distro that could take the blame.
15 August 2008 at 14:46and, being human, I’m capable of errors as well:
I adhere to
15 August 2008 at 14:48theits rules,EXT2FS would be a a bad idea here. Ext2FS is a Windows Explorer-like program (or at least the last version I used was). Only the program reads/writes files to/from the EXT2/3 file system, it does NOT allow other Windows programs access to the partition, thus for the purposes of Mr. Vos, Ext2FS is insufficient
15 August 2008 at 15:02Please ignore/delete my previous comment…. it no longer applies. Sorry!
15 August 2008 at 15:06(Off-topic. Sorry. But I vote we make The Monster write all his/her posts in Dutch from now on.)
15 August 2008 at 16:02It’s kind of funny, I keep hearing Linux guys whine and cry about how they are ALL about the security of the OS… and yet here we have all Linux users advocating using FAT32 instead of NTFS.
15 August 2008 at 21:19Dan zal ik niet kunnen zeggen veel.
(Misschien dat was het punt.)
16 August 2008 at 00:11@Walter Vos
I moved the Documents and Settings Folder on XP to the ext2 Partition. But for Vista I didn’t. I’ll try it when I boot Vista the next time.
You are right there should be a difference. I will see how (if) it works.
@JSG
16 August 2008 at 13:57Not everyone is a “Masturbating Monkey” (c) by Torvalds
Ok, I moved the Documents Folder to my ext3 Partition.
dna@meuder:/media/data$ ls -la
drwxr-xr-x 4 dna dna 4096 2008-08-16 15:04 Documents
dna@meuder:/media/data/Documents/My Games$ ls -la
drwxr-xr-x 21 dna dna 4096 2008-08-16 15:04 Age of Empires 3
dna@meuder:/media/data$ cat /etc/fstab
UUID=LONGID /media/data ext3 defaults 0 2
So, hm. I can’t tell if this is the correct/best/optimal way. But for me it works. I have only one reason for Windows, and this is gaming. Work happens on my system with Ubuntu so my personal files are in my /home.
16 August 2008 at 14:30Don’t blame me for loosing files or patience.
One last word, maybe this is also relevant. I moved (Verplaatsen) the documents folder not Doel zoeken.
@no_use_for_a_name: thanks for your input! ‘Doel zoeken’ means browse for target. I presume you entered the location manually? That’s the only difference I think.
So you’re saying that you did the same as I did in Vista and had no permissions trouble in Ubuntu (or whatever linux) afterwards? That’s great news! I don’t know how well ext3 support is in Vista though.
Btw: kinda funny to see so Dutch in the comments
16 August 2008 at 15:07@The Monster: that’s pretty accurate actually! Which translator did you use?
16 August 2008 at 15:08I used Google’s Language Tools.
16 August 2008 at 21:19Then I took the output and sent it through a second pass reversed, to convert back to English, to see how badly it wpuld be mangled. Seeing only one word changed, I thought it might not be truly horrific, like a “Yo’ mama” joke.
Simeon: livesaver? I’m not having a go at you, I just hope you can see the irony in the whole thing.
Talking about somebody else’s typos then making one of your own. Classic!
Take care guys!
Ps. for those who don’t realize: it’s “lifesaver”.
17 August 2008 at 12:05[...] had een stuk geschreven over een rare bug (of misschien wel een feature?) in de samenwerking tussen de besturingssytemen Windows Vista en [...]
21 August 2008 at 07:49