LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   link two files in different partitions Operation not permitted (https://www.linuxquestions.org/questions/linux-general-1/link-two-files-in-different-partitions-operation-not-permitted-463571/)

osio 07-13-2006 03:42 AM

link two files in different partitions Operation not permitted
 
I would like to replicate my Firefox bookmarks in a partition to it can feed other boxes. The partition is a mounted vfat one (/etc/fstab reads: /dev/hda5 /mnt/common vfat user,defaults,umask=000 0 0)

Creating a hard link does work across partitions. I tried a symbolic link:

Quote:

$ ln -v -s ./.mozilla/firefox/9wter1xl.default/bookmarks.html /mnt/common/bookmarks.html
ln: creating symbolic link `/mnt/common/bookmarks.html' to `./.mozilla/firefox/9wter1xl.default/bookmarks.html': Operation not permitted
/mnt/common is drwxrwxrwx root root and /mnt/common/bookmarks.html doesn't exist yet.

Why is the operation not permitted?
Thank you.

raskin 07-13-2006 03:52 AM

/mnt/common is vfat, I guess? Good luck with symlinks.

osio 07-13-2006 03:55 AM

Yes, /etc/fstab mounts it as vfat.
Why, is there a problem with symlinks in vfat partitions?
Is there an alternative to symlink?

raskin 07-13-2006 08:44 AM

File is a named block of data. Symbolic link is a named block of data, containing name of another file and marked specially. First property is easily achieved on any FS, but the second fails on vfat. An alternative is maybe just copying script in .bashrc/.bash_logout (maybe you should better wrap running firefox in script: copy here - run - wait for finish - copy there)

Melsync 07-13-2006 09:20 AM

one solution
 
Sorry, what do you mean by 'wrap running firefox in script: copy here - run - wait for finish - copy there'?

I setup cron job that run hourly with this
rsync -ruv --modify-window=1 --delete-after /.mozilla/firefox/*.default/bookmarks.html /mnt/vfat/bookmarks.html

Is this what you mean?

raskin 07-13-2006 01:47 PM

Nearly. It's one of the options, one of the best.
I meant to write script so instead of launching FireFox directly you launch the script, which copies fresh bookmarks from shared drive before launching FireFox and copies them back later, after FireFox finishes. But your solution should work also, except when you run FireFox on two machines within an hour, which is probably unreal in your conditions, right? So don't bother.

osio 07-14-2006 03:30 AM

Understood. If one box wants fresh bookmarks, firefox has to restart. Thanks a lot.
Osio.

raskin 07-14-2006 06:44 AM

Well, and possibly rsync has to be run - or not??

osio 07-14-2006 08:27 AM

Yes, basically the croned rsync refreshes the bookmark but if the user does want to have the latest ones there and then, there is no other alternative than restarting Firefox. Then the script launching Firefox that you suggested should test whether the shared bookmarks.html is accesible (if the network, samba partition are available) before rewritting the home one.
I think it is the maximum sync that can be attained.

raskin 07-15-2006 08:50 AM

I guess that to refresh bookmarks you need both restart Firefox and copy bookmarks. Also, do you think about merging, not just copying over? If you have two Firefox instances with bookmarks newer than common carrier version - you'll run into trouble.

osio 07-15-2006 09:16 AM

merging bookmarks from different boxes or users
 
Quote:

Originally Posted by raskin
do you think about merging, not just copying over? If you have two Firefox instances with bookmarks newer than common carrier version - you'll run into trouble.

My problem is that I wouldn't know what to use to merge. The command 'diff', maybe?

Another problem is that I don't understand the structure of Firefox's bookmarks.html. It is not a simple <ul><li> thread.

raskin 07-15-2006 02:02 PM

You don't need complete understanding, I guess diff with adding diff'ed lines where they should be (before added in other file) will work, really. But that's some processing.

Matir 07-15-2006 11:09 PM

Have you thought about configuring firefox to use the same profile in all cases? There are a few howtos on this, but this one should get you started: http://www.ubuntuforums.org/showthread.php?p=1251810

osio 07-19-2006 01:54 PM

centralised mozilla profile
 
Yes, instead of merging, I decided to feed the profiles of different boxes from only one by editing .mozilla/firefox/profile.ini.

I hope it works.

IsaacKuo 07-19-2006 04:28 PM

Umm...why not just make the symbolic link go the other way? In other words, you store bookmarks.html on /mnt/common, and you link from ~/.mozilla/firefox/adsf789213/bookmarks.html to /mnt/common/bookmarks.html.

There's no problem with creating a symbolink link pointing TO a file on a fat32 partition.

However, I don't think there exists a pleasant solution to sharing firefox's bookmarks.html on multiple computers. Sure, you can point things to share bookmarks.html or even the entire profile directory--but then that means you can only run Firefox on one computer at a time. If you leave Firefox running on one computer, and then try and run Firefox on another computer, it forces you to choose a different profile.

Basically, Firefox just isn't suited to being run in a multi-computer environment. AFAIK, there aren't any web browsers suitable for sharing bookmarks in a multi-computer environment.


All times are GMT -5. The time now is 01:00 PM.