Thursday, July 16, 2015

Moving default folders such as Pictures and Documents, etc. to the new partition

So I have set up my computer to dual boot into Ubuntu and Windows 8.1.  Then I partitioned my hard drive so I could have a shared data partition between Ubuntu and Windows.  Now, I want to change the default folders on both operating systems (like My Documents and My Pictures on Windows) to be on this new partition so I can use files from both places easily.  It was pretty easy and took about 15 minutes in Windows 8.1 despite my having delayed doing this for several days because surely it'd be hard. It appears to be essentially the same in Windows 7 if you have that.  I had three user accounts that I all directed to the same folders.  Otherwise it would have just been a few minutes.  I didn't redirect the desktop as I think this allows me to have different things saved on each one, and I only save temporary files on the desktop.  There was one conflict where I had the same file in each download folder, and Windows asked me what to do about it (replace, add, etc.) so I think if you try this after you have a lot of files it would still work.  I did this when my computer was essentially empty.

Okay, how to do this in Ubuntu?  It appears Windows always mounts the drive so it's visible, but in Ubuntu it doesn't and you have to configure it manually.  Here is a file showing all the commands and responses I got.

Next, how do I change the folders?  That first link I provided wanted me to make some sort of links, but this changing of a configuration file seems more permanent and unlikely to confuse programs like LibreOffice.  I couldn't find the  .config folder though and it was hidden.  Ctrl+H did the trick. I changed the file from $home/Downloads to media/Data/Downloads first to test it.  It didn't show up at first, but this older tutorial says I need to either log off and on again, or kill and restart Nautilus first.  My computer needed rebooting for some updates anyway, so I tried that first.  It worked!

I wondered if Ubuntu would politely accommodate the files from both the original default folder and the new folder like Windows did, so I put two documents in the default: one that had a duplicate and one that did not.  Then I went back to the configuration file and changed everything except the desktop.  Templates and Public did not have folders in Windows, so I added those to the data partition in case they are important for Ubuntu (I don't know yet).  This time I tried the killall nautilus in the terminal and it worked (much faster than rebooting or logging on and off).  Ubuntu did not move the files over, which makes sense since it wasn't particularly automated.  So if you already have a bunch of files, you'll need to move them manually.

I next noticed that there are two sets of links to documents, downloads, music, pictures, etc. in the files browser.  The top set (about the Data, Windows8_OS, and Computer partitions) go to the newly set folders.  The bottom set goes to the old /home ones.  I deleted the folders from /home, but then those lower links just gave an error for a missing directory.  I discovered you can right click on them and remove them.  No more confusion or errors.  I then tried saving something from LibreOffice to see where it goes as default.  It goes to /home/Claire which would have been annoying anyway I think.  I opened LibreOffice Writer and went to Options>LibreOffice>Paths and edited where "My Documents" is.  I tried installing another program afterwards (DigiKam for photo management) and it automatically went to my new Pictures folder.  Success!

I only have one Ubuntu user account right now so I just did this once.  I assume it'll work okay if I create another account, but so far I'm just using one account.

No comments:

Post a Comment

Comments and suggestions welcome.