2

I've decided to go with the dedicated home/data partition way of doing things for my first multiboot configuration, and for that reason have a bunch of symlinks linking to where I've mounted that partition. Everything works fine in the terminal, but when I use the GUI, it just opens up another window without having followed the link.

Example: I click on the symlink named "Documents" in my home folder which should link to the "Documents" folder on my dedicated partition, but another window of my home folder pops up instead.

Also, when I'm saving a file for the first time and would like to navigate somewhere by way of the symlinks, the symlinks are treated as files rather than directories. When I click on one to follow it, the name of the file-to-be-saved is changed to the name of the symlink.

I made the symlinks using terminal with ln -s, and I've managed the same procedure in Mint 17 without any problems with the GUI.

Additional info provided to comment questions:

XDG_CURRENT_DESKTOP=Unity

The symlinks are absolute links.

One thing I've noticed is that the first time I open Files (right after I log in), all the links work. As soon as I follow one (unless I open in a new tab), they all stop working. I can rename a symlink and then it starts working, but only until I follow it again. Something definitely changes once I follow the symlink, because when I go back the symlinks are no longer arranged alphabetically with the other directories, they're arranged alphabetically with the other files. When I rename one, that seems to make it behave like a directory again because it moves to be alphabetically in line with the other "regular" directories.

Maybe somebody knows of a file or something that gets modified once I change the name of a symlink or follow it...?

$ ls -l
total 48
drwxrwxr-x 1 funkyrailroad funkyrailroad  13 Mud  1 15:54 backup
lrwxrwxrwx 1 funkyrailroad funkyrailroad  41 Mud  1 15:18 Desktop -> /mnt/temp/SnowLeopard/localadmin/Desktop/
lrwxrwxrwx 1 funkyrailroad funkyrailroad  43 Mud  1 15:18 Documents -> /mnt/temp/SnowLeopard/localadmin/Documents/
lrwxrwxrwx 1 funkyrailroad funkyrailroad  42 Mud  1 20:44 Downloads -> /mnt/temp/SnowLeopard/localadmin/Downloads
lrwxrwxrwx 1 funkyrailroad funkyrailroad  39 Mud  1 15:19 eBooks -> /mnt/temp/SnowLeopard/localadmin/eBooks
lrwxrwxrwx 1 funkyrailroad funkyrailroad  45 Mud  1 15:21 Google Drive -> /mnt/temp/SnowLeopard/localadmin/Google Drive
drwxrwxr-x 1 funkyrailroad funkyrailroad   2 Mud  5 20:55 made in terminal
lrwxrwxrwx 1 funkyrailroad funkyrailroad  38 Mud  1 15:21 Music -> /mnt/temp/SnowLeopard/localadmin/Music
lrwxrwxrwx 1 funkyrailroad funkyrailroad  41 Mud  1 15:21 Pictures -> /mnt/temp/SnowLeopard/localadmin/Pictures
lrwxrwxrwx 1 funkyrailroad funkyrailroad  38 Mud  1 21:01 Public -> /mnt/temp/Ubuntu/funkyrailroad/Public/
-rw-rw-r-- 1 funkyrailroad funkyrailroad 401 Mud  1 21:03 steps
-rw-rw-r-- 1 funkyrailroad funkyrailroad 406 Mud  1 17:32 steps~
lrwxrwxrwx 1 funkyrailroad funkyrailroad  40 Mud  1 20:54 Templates -> /mnt/temp/Ubuntu/funkyrailroad/Templates
lrwxrwxrwx 1 funkyrailroad funkyrailroad  39 Mud  1 21:00 Videos -> /mnt/temp/SnowLeopard/localadmin/Movies

I've mounted the data partition by editing fstab. It's nonjournaled hfs plus formatted because I want mac os x to be able to read it, and for lack of forethought I named the directory where it'll be mounted "temp". I used to access it by its UUID, but I must have done something weird and that partition no longer has a UUID, at least it doesn't show one when I run blkid, so I go by its /dev/sdax name. The relevant entry in /etc/fstab is:

/dev/sda3 /mnt/temp hfsplus rw 0 2

I've got the exact same setup on my Mint partition (and in the meantime my Zorin as well), and I can follow the symlinks with the GUI no problem. The messup with the UUID also affected my other setups, which still seem to work, so I'm tempted to think that the problem is elsewhere...

Marty Fried
  • 18,466
  • That's exactly how I've been doing it for years, and I can't tell the difference between the link and a directory using nautilus or the terminal or any other apps. What GUI are you using that does not work? – Marty Fried Dec 02 '14 at 22:23
  • Are the links relative or absolute? – muru Dec 03 '14 at 03:23
  • @MartyFried I ran env and saw XDG_CURRENT_DESKTOP=Unity. – funkyrailroad Dec 04 '14 at 04:26
  • @muru Absolute links. – funkyrailroad Dec 04 '14 at 04:27
  • But you said you used ln -s, which is a symbolic link. That is what you want, anyway. – Marty Fried Dec 04 '14 at 06:36
  • I'm not sure I follow your logic @MartyFried, you're right it's a symbolic link, which according to my understanding should bring you to the linked directory when you click on it, but when I click it using the GUI, it's not followed. However when using cd in terminal, it works fine. – funkyrailroad Dec 04 '14 at 11:38
  • Logic? You have said in multiple places "absolute links". I simply wanted to set the record straight, that they are, in fact, symbolic links. And I added that symbolic links are the type you should use. Other than that, all I've said is that I use symbolic links exactly like you, and it works as expected everywhere. So, I don't know what's different with your system. Have you tried creating the links using Nautilus? Right-click on a directory, choose "Make Link", then copy (and rename) that link to where you want it. – Marty Fried Dec 04 '14 at 17:49
  • One thing just occurred to me... are you the owner of the directories that you are linking to (and the owner of the link)? If not, the links won't work. – Marty Fried Dec 04 '14 at 18:24
  • post ls -l That shows me my links. – oldfred Dec 05 '14 at 18:29
  • @MartyFried By absolute links I mean the link is of the form /dir1/dir2, and doesn't contain any directions relative to the location of the link, like ../../dir3 for example does. I tried making the links by left clicking, and the same problem persists. I double checked the ownership, and that all checks out too. I added more specific details about the behavior in the post above, any further suggestions/things to try out are much appreciated. Thanks. – funkyrailroad Dec 05 '14 at 18:36
  • Did you check the ownership of the link, or of the actual directory that the link is point at? Both matter. But I'm creating an answer, so I can get more detailed. – Marty Fried Dec 05 '14 at 20:31
  • @oldfred ls -l has been posted. – funkyrailroad Dec 06 '14 at 07:47
  • Do not know what issues your HPS+ format causes. Most users use ext4 or NTFS and both of them work (but probably not with a Mac) with correct settings in fstab. I always keep each folder at the top level of the data partition to make it easier to link. I do not see any advantage to linking desktop & templates? Not sure what format may work with both Mac & Linux? I see many threads on issues of trying to see even flash drives, but do not have a Mac. – oldfred Dec 06 '14 at 16:12

1 Answers1

0

I'm not sure if this is going to be an answer, but after reading and some comments, I have more ideas, and it's too much for a comment.

Since I don't really know exactly how much you know about mounting drives, I may get too remedial at times, so forgive me if I seem to be talking down to you. I just don't want to assume too much.

First of all, you don't mention anything about how you are mounting the partitions. There are a few ways to do it, but if you don't explicitly mount it, using either the mount command, or an entry in the file /etc/fstab, then it will still show up in Nautilus, and get mounted automatically the first time you click on it; you will then see an icon to the right, the triangle over a line symbol, indicating that it's mounted (in /media/your_user_name/volume_label). This might be contributing to what you have described, although it's hard to interpret exactly what you describe.

Now, I am going to describe how I do this, which works the way you desire. I mount all my partitions in /mnt/xxxxx. This is owned by root, which is OK, but the directories I create, I set the owner:group to myself. One of the directories I created is named /mnt/shared (because I first did this to share the data files with a Windows partition I used to have, and also other distros I was trying out).

In this shared directory, I mounted an ext4 partition (used to be NTFS until I ditched the Windows installation) containing directories such as "Documents", "Downloads", "Music", "Pictures", etc. I labelled the partition "shared" (I label all partitions the same as the directory they mount in), and I use the label rather than the UUID to mount the partition; to me, this makes it easier, and even though there is some remote possibility I might label another partition with the same label, it has never happened, and for my personal system, I don't worry about it. Anyway, in /etc/fstab, I have an entry that says:
LABEL=shared /mnt/shared ext4 defaults,user_xattr 0 3

So, after booting, if all goes well, I will have a directory /mnt/shared/ containing all my directories in that partition. Make sure you are the owner of this new folder, and if not, use the sudo chown your_name:your_name.

So next, I right-click on the /mnt/shared/Documents directory from Nautilus, and choose "Make link", which will create a file in the same directory called "Link to Documents". Next, I cut and paste that link into my home directory, where the normal "Documents" folder resides. Assuming there are no important files or folders already in Documents (if there are, they should be moved temporarily to a temp folder), I then delete the Documents folder, and immediately rename "Link to Documents" to "Documents". Doing this together will keep the special icon for the folder. You should then have a new Documents folder, that is actually a link to /mnt/shared/Documents.

Repeat this for other folders, such as Music, Pictures, etc.

Edit1 after new information about HFS+
I haven't ever needed to dual-boot with OSX, so I'm not an expert on the details, although it's not that different except for the filesystem.

There's some discussion elsewhere on AskUbuntu; the question was for journalled, but the answers were not, mostly.

It might be worth seeing if you can get it mounted using the mount command first, although what I do is keep the editor open for /etc/fstab, make a change, then run the command mount -a, which not only mounts the entries, but gives an error if there is one, which is helpful. I think this is very useful. Sometimes, you'll need to unmount one or more partitions before running it, but for most, if it gives an error that it's already mounted, it doesn't matter.

Since it works in Mint, though, and I assume you are using the same methods, have you installed the hfsprogs? sudo apt-get install hfsprogs
ext3 Also, using the volume label instead of device name will make it much more clear when editing, and less error-prone in use, in case a drive gets mounted differently.

My example fstab entry will, of course, be different than your, especially because of the different filesystems. Also, the final column is somewhat arbitrary.

About the separate folders for each OS... In case you missed this detail, what I do is to mount just the data, not the entire home directory. So, for example, on Linux, each distro would have its own home directory, but the data folders would be shared. So the OS-dependent stuff goes into the same partition as everything else, and the data folders have no OS-dependent data at all. This is why I don't mount a separate home directory like many people suggest; I can easily reuse my data directories for any version, any OS, with no problems.

I read that recent OSX version can read/write to NTFS partitions, by the way, so it's possible to use NTFS and read/write everywhere.

One more thing... have you checked the ownership and permissions of /mnt/temp/SnowLeopard/localadmin? If you're not sure, you can run ls -alF /mnt/temp/SnowLeopard/localadmin, (or ll /mnt...) and post the results. You should see yourself as the owner of the directories that you are linking to. You should be able to see the same information by doing ls -L in your home directory; the uppercase 'L' shows the info on the link targets rather than the links.

Let me know if you need more information, or have questions. Also, let me know if it solves you problems. :-)

Marty Fried
  • 18,466
  • I'm definitely still a beginner, so don't worry about "talking down." Worst case scenario, you'll confirm something I've read up on somewhere else.

    As for the mounting, I've done it pretty much the way you've described. Differences are that it's nonjournaled hfs plus formatted because I want mac os x to be able to read it, and for lack of forethought I named the directory where it'll be mounted "temp". I used to access it by its UUID, but I must have done something weird and that partition no longer has a UUID, at least it doesn't show one when I run blkid, so I go by its /dev/sdax name.

    – funkyrailroad Dec 06 '14 at 08:17
  • The relevant entry in /etc/fstab is/dev/sda3 /mnt/temp hfsplus rw 0 2

    I notice that your fourth column is also different, but as I've mentioned before I've got the exact same setup on my Mint partition (and in the meantime my Zorin as well), and I can follow the symlinks with the GUI no problem. The messup with the UUID also affected my other setups, which still seem to work, so I'm tempted to think that the problem is elsewhere...

    – funkyrailroad Dec 06 '14 at 08:17
  • Somewhat unrelated, I have a separate folder for each OS in my /data partition because I read about problems with configuration/preference files with programs of different versions, so I'm just playing it safe for now. Once I get it to work, I was going to free myself up to change it around a bit. – funkyrailroad Dec 06 '14 at 08:19
  • @funkyrailroad: I added some more information to my answer after reading your comments. Hope they help. Unfortunately, I have no experience dual-booting OSX. – Marty Fried Dec 06 '14 at 20:07
  • Sorry, I was without internet for a bit so I just reinstalled and everything works now... no idea what I did, but I hope I don't do it again. Thanks again. – funkyrailroad Dec 14 '14 at 22:41