Symlink Advice


Recommended Posts

OK, I've got Windows 7 on one HDD and Kubuntu 9.10 on a different HDD. I'm trying to get my Firefox profile in Kubuntu to use the places.sqlite bookmarks in my Windows 7 Firefox profile.

Both profiles are for Firefox 3.5.5 and have a places.sqlite file which stores history, bookmarks, etc

Can I write a symlink in the Kubuntu Firefox profile that would make it utilize the places.sqlite file in the Windows 7 Firefox profile?

If so, any guidance or hints as to what the syntax would look like?

Link to comment
https://www.neowin.net/forum/topic/848486-symlink-advice/
Share on other sites

I'm sure you've got a good reason for doing so, but wouldn't xmarks be better? Used to be called FoxMarks

Anyway...

First you need to have your Win7 partition mounted.

Second, the command would look something similar;

ln [options] source destination

ln -s /path/to/source/places.sqlite /path/to/destination/places.sqlite

Edit:

Careful doing this, as when you open Firefox it copies places.sqlite to places.sqlite-journal and zeroes the .sqlite file. And does vice versa when closing.

So if Firefox crashes in Windows and you don't re-open it, when you switch to Kubuntu the file will essentially be empty.

Edited by YaZoR
Link to comment
https://www.neowin.net/forum/topic/848486-symlink-advice/#findComment-591885838
Share on other sites

ln [options] source destination

ln -s /path/to/source/places.sqlite /path/to/destination/places.sqlite

Thanks for the speedy response! I'm currently using Xmarks and it works fine - I'd just rather not have to rely on something having an internet link to sync my bookmarks on the same computer.

I'll try doing the link when I get home! Thanks for the Caution too!

Link to comment
https://www.neowin.net/forum/topic/848486-symlink-advice/#findComment-591885892
Share on other sites

It does work for me, 2 Linux and one windows. But sometime, new file are created with the wrong permissions. chmod 777 -R is needed sometime.

Elv13, thanks for the confirmation and advice but I have no clue where I'd put that in the syntax below, but feel free to educate me further.

Ok, here's what I'm thinking I'll need to do to get my Linux profile to use my Windows places.sqlite file (little confused on which is 'source' and which is 'destination' :unsure: ). Can one of you Linux veterans give it a look and let me know if I've got it right? Do I need to use sudo for this?

Open terminal

# Get to the right directory

cd /home/<me>/.mozilla/firefox/<profile>.default

# Rename the original file for backup in case I screw it up

rename places.sqlite bak_places.sqlite

# Create the symbolic link so linux profile uses windows profile places.sqlite

ln -s /media/NTFS_Windows_7/Users/<me>/AppData/Roaming/Mozilla/Firefox/Profiles/<profile>.default/places.sqlite places.sqlite

Link to comment
https://www.neowin.net/forum/topic/848486-symlink-advice/#findComment-591902620
Share on other sites

You can share the complete .mozilla folder between different OSes (windows and Linux, in this senario). But when one operating system create a new file, it will set the write permissions to itself. In both windows and Linux, only the current user can write in his/her personal files. The "chmod" command is the linux command to ajust permissions. You will have to give read and write permissions to those files. The "safe" line would +rw, but most peoples give "every" rights to file when they have those kind of problems. "777" is the short command to "everything for me", "everything to my user group" and "everything for everyone else". Its binary:

1 = read, 1 = write and 1 = execute. So:

7 = 111 = read, write and execute

6 = 110 = read and write

5 = 101 = execute and read

4 = 100 = read only

3 = 011 = write and execute (you will never see this one)

2 = 010 = write

1 = 001 = execute

Link to comment
https://www.neowin.net/forum/topic/848486-symlink-advice/#findComment-591903418
Share on other sites

# Rename the original file for backup in case I screw it up

rename places.sqlite bak_places.sqlite

No such command rename (unless you have it aliased). To rename you use the move command (mv). But you don't want to rename it you want to copy it (cp) to another filename so you have the original

# Create the symbolic link so linux profile uses windows profile places.sqlite

ln -s /media/NTFS_Windows_7/Users/<me>/AppData/Roaming/Mozilla/Firefox/Profiles/<profile>.default/places.sqlite ./places.sqlite

I'd put a ./ infront of the destination link for best practice since you've cd into it. Simply means 'current directory'

Link to comment
https://www.neowin.net/forum/topic/848486-symlink-advice/#findComment-591904080
Share on other sites

UPDATED - Open terminal

# Get to the right directory

cd /home/<me>/.mozilla/firefox/<profile>.default

# Rename the original file for backup in case I screw it up

cp places.sqlite bak_places.sqlite

# Create the symbolic link so linux profile uses windows profile places.sqlite

ln -s /media/NTFS_Windows_7/Users/<me>/AppData/Roaming/Mozilla/Firefox/Profiles/<profile>.default./places.sqlite places.sqlite

Link to comment
https://www.neowin.net/forum/topic/848486-symlink-advice/#findComment-591904388
Share on other sites

I'd put a ./ infront of the destination link for best practice since you've cd into it. Simply means 'current directory'

No, for symlink it is better to avoid relative path. "./" will not be converted, it will stay as it is, so if the symlink is interpreted the wrong way, it will brake, and it will not will full path.

Salgoth:

ln -s /media/NTFS_Windows_7/Users/<you>/AppData/Roaming/Mozilla/ /home/<you>/.mozilla

Don't mess with profiles, its much easier to share the whole thing.

Link to comment
https://www.neowin.net/forum/topic/848486-symlink-advice/#findComment-591905310
Share on other sites

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.