0

I have a dual-boot Windows 8.1 and Ubuntu 14.04 machine. Currently, I have one ext4 partition that is being used as my '/home' mount point in Ubuntu, and one NTFS partition that I am using to redirect 'My Documents' and such on Windows. This way both OS's are automatically using these partitions for file storage "under the hood".

My question is this: is there a reasonable way to make both OS's automatically use the same partition for file storage, without butting heads, and continuing this "under the hood" behavior? Preferably I would like to have this partition contain one folder named 'Ubuntu' and another folder named 'Windows', with the 'Ubuntu' folder acting as the mount point for '/home' and the 'Windows' folder containing my redirected profile folders, like in my current setup.

Is this possible? I'm guessing the format would have to be exFAT or something of the sort. Would there be any downsides (such as speed loss) from using this approach? And if this is not very reasonable, is there another setup that would give similar effects?

EDIT: Also, would it be reasonable to have a third folder on this partition for my Dropbox files (with each OS's dropbox program pointing to this same folder), so there is only one copy of my dropbox files on my disk?

lcdavis13
  • 43
  • 1
  • 1
  • 10

1 Answers1

1

Depends. Not for the whole of /home, if you need Unix-permissions for group. Given the current state of ext driver support in Windows, we would have to use FAT/NTFS for such a common partition, and they don't support Unix permissions. So applications like SSH and GnuPG will have trouble.

I do it in a bit more complex way: symlink ~/Documents and other such folders to their Windows equivalent on an NTFS partition. Permissions on these folders don't really matter much. Helps if you want to have Dropbox sync them. Of course, none of these are located on the partition containing Windows, but on a separate NTFS partition.

A better approach will be to change the locations of these folders. From the Arch Wiki, add these to ~/.config/user-dirs.dirs:

XDG_DESKTOP_DIR="$HOME/Desktop"
XDG_DOWNLOAD_DIR="$HOME/Downloads"
XDG_DOCUMENTS_DIR="$HOME/Documents"
XDG_MUSIC_DIR="$HOME/Music"
XDG_PICTURES_DIR="$HOME/Pictures"
XDG_VIDEOS_DIR="$HOME/Videos"

Replace $HOME/<blah> with your desired location.

On my laptop, all such folders are common to both Windows and Debian (and Arch), and I don't face problems, except with Dropbox. Dropbox occasionally replaces perfectly good files with their older versions and says it's a conflicted copy.

Both ways require that the partition be automounted. Especially in the case of the XDG variables, the partition needs to be mounted before they're read, or they will reset to $HOME. See How to automount NTFS partitions? for guides on automounting NTFS partitions. The most preferable way to do so is editing /etc/fstab - any other option will mount after the partitions listed in that file are mounted.

muru
  • 197,895
  • 55
  • 485
  • 740
  • Finally tried this (changing the locations through user-dirs.dirs), and it doesn't work :( The locations reverted to /home after a reboot and it acts all glitchy. I will try to figure it out and update with a solution. – lcdavis13 Sep 03 '14 at 18:35
  • ----Before reboot: XDG_DOWNLOAD_DIR="/media/myName/myDrive/Ubuntu/Downloads" XDG_DESKTOP_DIR="/media/myName/myDrive/Ubuntu/Desktop" ----After reboot: XDG_DOWNLOAD_DIR="$HOME/" XDG_DESKTOP_DIR="$HOME/" ----There are other directories in there too, but these are the only ones I changed. – lcdavis13 Sep 04 '14 at 16:59
  • @user258887 oh, so they get reset to $HOME? Maybe this will help: http://askubuntu.com/a/212118/158442 – muru Sep 04 '14 at 17:04
  • Tried adding "Hidden=true" to the autostart script per their suggestion, didn't change anything. – lcdavis13 Sep 04 '14 at 17:12
  • @user258887 How are you mounting the drive? It's possible that if the mount is ready (and the directories aren't present) when these values are read, they get reset to $HOME. – muru Sep 04 '14 at 17:14
  • Yeah, I just tried redirecting the Desktop to a folder in the native partition and it worked. The second partition isn't mounting on startup, I just never realized this because I've replaced my Nautilus shortcut with a link to the 2nd partition...how do I make it automatically mount before the Desktop gets loaded? – lcdavis13 Sep 04 '14 at 17:18
  • @user258887 That depends on how your mounting it now. The simplest way might be to add an entry to fstab. – muru Sep 04 '14 at 17:20
  • I'm not auto-mounting it at all, it's just getting mounted when I open it. Ubuntu is reading it as an external drive. – lcdavis13 Sep 04 '14 at 17:22
  • Oh. Still: see http://askubuntu.com/questions/46588/how-to-automount-ntfs-partitions - I recommend editing fstab, any other method will only mount after fstab entries are processed. – muru Sep 04 '14 at 17:24
  • This works now after adding my partition to fstab! Thank you so much. Sorry for being a noob. – lcdavis13 Sep 04 '14 at 17:45
  • @user258887 Nah. It's my fault for assuming that you had automount set up already. I didn't realise that till you said you hadn't. I'll update the answer with that link. – muru Sep 04 '14 at 17:46