Slashdot Mirror


Building a Better 'Mobile $HOME'?

numbski asks: "As a systems administrator, I find myself moving from machine to machine to machine on a daily basis. I happen to be a FreeBSD/MacOS X nut, so on a given day I move from my 17" iMac at home, to my 12" Powerbook at work, to any one of my 16 FreeBSD Servers. That's not to mention any of the Win2k Servers that have Cygwin loaded. All of that said, there is a longing in me to have a simple $HOME that all of my systems use and understand. I've considered the Knoppix way of dealing with this problem using a USB key device from this previous Slashdot article, however I don't know how many systems I could get away with consistently having my USB device picked up and used correctly without scripting changes to fstab, not to mention the issue of choosing a filesystem that just about every OS will recognize: FAT32. Windows is going to be unhappy no matter what I'm afraid, as it doesn't understand symlinking. c:\Documents and Settings\$USER can't just be moved off to another volume. The one glimmer of hope I have is this article on ftpfs and webdavfs. Using these one should be able to set up a single, persistent home that follows you from machine to machine over the internet. I guess I would like to know how others have gone about setting up a mobile $HOME. I look forward to having all of my preferences, dotfiles, and bookmarks follow me around."

41 comments

  1. No good answer by Phexro · · Score: 4, Informative

    Unfortunately, you have two issues to deal with. First and foremost is simply getting access to your data, and the second (and harder) is making that data usable to whatever os/apps you may be using.

    For example, I use Konqueror on my Linux box(en), but use Mozilla on Mac OS X. How do you get bookmarks from one browser to work on the other?

    As for the first problem, NFS works enough for LANs, but I sure wouldn't want to use it over the public 'net.

    Coda seems promising, but I've never found a distro that actually supports it, and there's a fair amount of manual stuff you have to do to use it. I've never managed to get it working properly, but from what I understand, it's somewhat similar to CVS in that you have to update/commit. This has the advantage of working when disconnected.

    InterMezzo also has some promise, but I haven't played with it as of yet.

    USB keys seem like a better idea, until you realize that if you lose the little sucker, you're SOL. So, keep backups. Also, I keep a ridiculous amount of stuff in my home directory - multiple GBs - so being able to move a few hundred MB at a time just doesn't work for me.

    1. Re:No good answer by martinde · · Score: 3, Interesting

      An alternative to a true distributed filesystem is Unison , a user-space daemon that keeps filesystems automagically synced using rsync. I have not used it myself, but I saw reference to it nested somewhere in here and thought it looked interesting.

    2. Re:No good answer by evilad · · Score: 1

      I use it to sync a couple of desktops and a laptop to my server. Back when I had a job, I also had a couple of workside home directories in the loop.

      It's not Coda-formerly-AFS, not by any means, but it was far, far easier to set up. I've tried and failed with Coda several times, and found it impossible to screw up with Unison, nor even to lose files.

      With the addition of a frequent cronjob to synchronize, it provides pretty much all of the features I want. Conflicts aren't resolved; I receive an email informing me of the issue courtesy of cron, and run the gui utility to manually choose the direction of the overwrite. Quite frankly, I wouldn't trust it to be more automatic than that.

      Never send a cronjob to do the work of a mad engineer.

    3. Re:No good answer by buttahead · · Score: 1

      I agree that there is no good solution. I used to use rsync to keep 5 or 6 machines up to date with my latest changes to $HOME, but the following has got me as close to having a single home dir as I have ever been.

      I use NFS over CIPE tunnels to get around the roaming problems. That link is to a bit that I wrote up about doing this, but the short version is below:

      1) set up NFS so that one monster server has your home directory.
      2) For trusted networks, just use nfs to mount the server's home directory on all machines.
      3) for untrusted networks... like over the internet using your laptop or an office machine... use CIPE tunnels. The cipe config files can remain static as long as you know your public ips on both sides, but can also be setup to be programaticly changed. Then just fire up the tunnel and mount like normal NFS.

      I'm not sure how well windows supports CIPE or NFS, which is why I say there is no good solution.

    4. Re:No good answer by CompVisGuy · · Score: 1

      I had a go to make Unison work for me, but I'm afraid it didn't go too well. This was due to me being too lazy to persevere with the system than any fault with Unison.

      As the MOBILE $HOME topic crops up on /. on a regular basis, and you seem happy with your solution, is there any chance you would put together a step-by-step guide on setting up the solution you described, suitable for newbies as well as the more advanced user?

      --


      "The noble art of losing face will one day save the human race"---Hans Blix
    5. Re:No good answer by d^2b · · Score: 1
      Coda [cmu.edu] seems promising, but I've never found a distro that actually supports it, and there's a fair amount of manual stuff you have to do to use it. I've never managed to get it working properly, but from what I understand, it's somewhat similar to CVS in that you have to update/commit. This has the advantage of working when disconnected.
      Or, you could just use CVS over SSH like I do. This has its pluses and minuses. On the good side, it is low tech and robust. It requires no root level support on either end (assuming all your machines are SSH accessible). If I screw up and modify things in two different places, then CVS is happy to merge them. It works on dialup. On the the other hand, it requires I manually synch things. Once in a blue moon, I put this off till the next morning, then forget. Also, it does not deal well with binary files. For me, this is not an issue, but I can easily imagine people who care about things other than Perl, C, and TeX. It requires network access. I have talked to someone who uses a CF card as a portable CVS repository to get around this problem.
    6. Re:No good answer by evilad · · Score: 1

      Sadly, I'm a debian user, so my setup procedure consisted largely of running apt-get. The other parts were adding a crontab entry and writing a simplistic bash script to send me the email. Here's the step-by-step:

      1.#> apt-get install unison-gtk

      2. crontab -e
      55 * * * * ~/bin/unisonify

      3. vi ~/bin/unisonify

      [clip from here]
      #!/bin/bash
      MAXERR=0
      ERRMSG=/tmp/unierr.t xt

      unison default > $ERRMSG
      ERRLST=$?
      MAXERR=$(( $ERRLST || $MAXERR ))

      if [ $MAXERR -ne 0 ]; then
      mail -s "`uname -n` unison errors" $USER@localhost $ERRMSG;
      else
      rm -f $ERRMSG;
      fi

    7. Re:No good answer by CompVisGuy · · Score: 1

      Thanks for that. When I have some free time I'll try to finally sort out my 'mobile home'.

      I'm on OS X, so I'll just do apt-get as well... :-)

      --


      "The noble art of losing face will one day save the human race"---Hans Blix
  2. Have a macro create it on each system. by WGR · · Score: 3, Informative

    Why should $HOME be the same on each system. Why not have a expression in .login or Windows login.bat create a value that points to the Home location on each machine?
    For example on a Windows XP machine your login profile script would do
    set HOME="%HOMEDRIVE%\%HOMEPATH%"

    in Cygwin it would be
    export HOME="$HOMEDRIVE/$HOMEPATH"

    etc. depending on the OS.
    So you would use $HOME (or %HOME% in Windows) whenever you wanted the home location.

  3. My incarnation by Jahf · · Score: 4, Informative

    I'm about to implement a mobile $HOME at my home ... my plan is to use a main server to store the data. I'm plannint to use the Intermezzo fs for my laptops so that they can run connected to the network or not (Intermezzo caches data, so I can take my laptop on the road, continue to work on documents, and when I plug back into my home network it will populate my edits back to the server). For these machines and my linux desktop I'm planning to roam everything in $HOME so that I have a single install of custom fonts, Star Office, mozilla settings, etc.

    However, I'm giving up on having a roaming desktop between Windows boxes and my wife's iMac. For those I'm just using Samba / Netatalk to link to the documents and bookmark files but not roaming anything else. It's just not worth the hassle for me to try and make those systems any more portable.

    I did consider using the Unison service to do synchronization between Windows and Linux, but I think I'm happier with Intermezzo since I can afford the dedicated partition space on the Linux machines. I really do wish that Intermezzo could support the sharing of individual files, but then it would just be a synchronizer, not a filesystem.

    --
    It is more productive to voice thoughtful opinions (reply) than to judge (moderate) others.
  4. Heh... by Badge+17 · · Score: 1

    I like the Windows link... http://fsf.org

    Of course, in my browser at least, that should be http://www.fsf.org

  5. network fs homedirs only 99% good by Splork · · Score: 1

    the 1% of the time when there are network problems and you indavertantly left something you need in your "always accessable everywhere" network mounted home directory you're shit out of luck.

    even more so if whatever way you use to "mount" this network home directory blocks when the network/server is inaccessable.

    1. Re:network fs homedirs only 99% good by TMacPhail · · Score: 1
      even more so if whatever way you use to "mount" this network home directory blocks when the network/server is inaccessable.

      I've had this problem before. One night my ISP changed all my IP addresses (I use their dhcp) and in the morning everything had locked up on nfs read requests to the file server.

    2. Re:network fs homedirs only 99% good by Jahf · · Score: 1

      Hence the beauty of a caching network-based filesystem like Intermezzo. If it's offline, you use your cache. This requires hard drive space, but gives much more flexibility and still retains the good bits (except for no local space requirements) of other networked filesystem schemes.

      I believe NFSv3 supports caching, too, though I don't believe it has the same synchronization abilities as Intermezzo.

      --
      It is more productive to voice thoughtful opinions (reply) than to judge (moderate) others.
  6. Here's what I do - not very elegant by leehwtsohg · · Score: 2, Informative

    As was pointed out already, there are two problems here - one is having a universally readable piece of hardware, and the other is how to keep configuration across different systems.
    I solve the 2nd problem by having 2 directories, called .laptop and .desktop
    and a directory called .cur_dot that is linked on my laptop to .laptop, and on the desktop - .desktop (!) .kde is linked to .cur_dot/.kde
    dot files that need to be the same on both systems sit in .common_dot, and are linked correctly. So .tcshrc is linked to .common_dot/.tcshrc
    If I really wanted, I could trace down the various bookmark and cache files in .kde and place some of them in .common_dot.
    I can thus rsync my home directory easily, just taking care not to overwrite .cur_dot
    This can easily be extended to cover several systems. I wrote a couple of things to make life easier, but overall it is quite a pain to keep track of every new dot file that a program generates....

  7. Symlinking not needed by Anonymous Coward · · Score: 0

    c:\Documents and Settings\$USER can't just be moved off to another volume.

    Yes it can. You can try the tool "junction" from sysinternals.com if you need to link directories, but the proper way to do this would be to modify the registry and change your user profile directory. I don't have access to a Windows box right now, but the key should be something like "HKCU\Software \Microsoft\Windows\CurrentVersion \Explorer\Shell Folders" (or "User Shell Folders").

    1. Re:Symlinking not needed by stubear · · Score: 2, Informative

      Not only that but you can change the user's home folder through the User Properties in the MMC. You can set a local path or a path on a connected network drive.

    2. Re:Symlinking not needed by chrisseaton · · Score: 1

      Actually, you can just drag and drop the folder in Explorer, and it will set the registry for you.

      Don't just assume Windows is just at everything.

  8. I'm working on something like that by BroadbandBradley · · Score: 3, Informative

    but it's not a total solution.
    What I want to do is base it around Mozilla.
    The Plan is to keep the profile directory on a website, and use Mozilla Roaming profiles to log in from different machines.(doesn't work yet) If there's files I need I'll keep them in the profile directory. If all your machines are connected, and all your tools are browser based, then that's all you'd need.
    Here's to hoping that I can get ZillaVilla.com up and running sometime this century. if anyone has any feedback, contributions, Ideas, insight, whatever, don't hesitate to send them my way via ZillaVilla.com/forum

    1. Re:I'm working on something like that by TMacPhail · · Score: 1

      Watch out that some of the mozilla configuration in one operating system is sometimes incompatible with the mozilla configuration with another operating system. All the data files for e-mail, bookmarks, and such are all compatible though.

  9. CVS by DrewFish · · Score: 2, Informative

    I keep the inportant bits of my system in a CVS repository. It's not the most elegant, as it requires some work to "stitch" the checked out directory into all the places programs look for configuration info.

    Plusses: tolerant of transient network trouble; can keep per-machine mods (just don't check them in); one universal distributed set of vim tweaks, yeah!

    Minuses: each ~/.config file symlinked into the directory (ugg); per-machine mods requires a bit of a CVS dance sometimes; most probably unix-only

    A big caveat with this is that I've only used it with two systems, both running the same version of the same distro. So, umm..., there are most likely complications abound.

    1. Re:CVS by martinde · · Score: 1

      I have done this, even across windows machines. Of course, I'm not a typical windows user in that I tend to live in Cygwin when I use windows. Anyways, I have in my .bashrc
      if [ -n "$LINUX" ]; then ...
      fi
      and
      if [ -n "$WINDOWS" ]; then ...
      fi

      Plus a bunch of stuff that is common between machines. I also have some tests for "what domain am I on?" to set a couple of options. It works reasonably well. I have been toying with the idea of using replicated HOME dirs via Unison (as I mentioned in another thread) but have not bitten the bullet just yet. Part of the issue is whether or not I really want my entire home directory to be replicated, or just parts... I guess I haven't figured out my requirements yet so I haven't constructed a solution just yet.

    2. Re:CVS by Shaleh · · Score: 1

      a friend and former co-worker had an article in Linux Journal (or was it Mag?) about how to put $HOME into cvs.

      His approach is to break it up into functional groups and then checkout the groups he needs or fit the current location/use. Even all of his email lives in cvs. It is quite amazing.

      Having seen many a distributed homedir server die or disappear in my time, I would rather have to only depend on the network for setup. Personally I have been waiting for a project like arch or subversion to mature so I did not have to deal with the downsides of cvs like file/directory moving.

  10. An idea... by Ayanami+Rei · · Score: 3, Interesting

    1) In Win2K...
    Change the Logon path for yourself... run
    mmc.exe %SYSTEMROOT%\system32\lusrmgr.msc
    And find yourself, go to properties, then profile, then set the Logon path to the drive letter (and perhaps a safety-subfolder) that contains your user profile when the USB key is attached. AFAIK it supports UDF filesystems on zip-like things as well (you may need UDF tools like DirectCD if it doesn't work)

    2) In Unix...
    In FreeBSD and Linux, you should be able to create and write to UDF filesystems on anything that looks like a SCSI device (IE a USB flash disk). And OSX 10.1 is UDF-ready for reading and writing on arbitrary devices (incl. usb hard disks/flash disks). Set up your /etc/fstab file to recognize but not automagically mount /mnt/dongle (noauto), then configure your automounter to mount it when you access it. Make sure you add support for umass under FreeBSD, and usb-storage in Linux. Then, set up an auto.home NIS map and again use your favorite automounter to map /home/yourname to /mnt/dongle.

    --
    THIS THING CAN TURN ON A DIME, MACROSSZERO STYLE ALSO FUCK BETA, ~NYORON
  11. Perforce :-) by Will+Sargent · · Score: 1

    Admittedly I only have two machines to worry about, but since Perforce allows you two free clients, you can check in all your .zshrc and miscellaneous binaries into a Perforce repository. Mapping to my home directory is as simple as //users/wsargent/home/... //myclient/wsargent/...

    and I don't have to mess around with CVS directories.

  12. Used an online service instead by kriston · · Score: 2, Insightful

    Even at home, not just at work, I use several computers. I tried having a "mobile home" various ways, like the pathetic Netscape Roaming Profiles. I ended up settled on just using Yahoo to handle all my mail ("mail plus" product), address book, notepad, and file storage ("briefcase" product). I determined that all I really needed everywhere was the administrative office-keeping stuff (mail) and some files to download (briefcase). All the software development and systems administration stuff that had to be kept locally on a machine turned out to be very few things: a few dot-files (.emacs, .kermrc, .profile) and copy of Emacs 19.34b built to work from $HOME directory. I keep those files in Yahoo Briefcase.

    Another alternative is to use a hosting provider and access your files remotely from there--same results as using Yahoo but doesn't require a web browser

    Kris

    --

    Kriston

  13. CVS works for me by kuhneng · · Score: 2, Interesting

    I'm doing exactly what you're talking about using CVS.

    Everything I care about lives in huge CVS project, currently hosted on a laptop. In my case, this comes to 7GB, mostly in my photo gallery.

    For servers (Solaris) at work, everything shares one NFS mounted home directory, which has a checkout of everything but my photos (due to quota limits). My personal work machine (Win2k, yuck) has its own complete checkout, with a few partial checkouts to put configuration files where different programs want them. My home machine (OS X) has a complete checkout.

    This setup works for everything except bookmarks, where I find myself using IE on Windows, Netscape in Unix, and Safari on OS X. For bookmarks, I've moved to the "My Yahoo" service, which keeps everything online and accessable with one click from my home page.

    By the way, I'd strongly recommend configuring CVS to default to binaries unless told otherwise for this kind of config. It's a nasty surprise to realize that CVS just mangled all of your .xyz binary files trying to do linefeed conversion, just because you forgot to tell it otherwise.

  14. ftpfs and similar face-plants. by WasterDave · · Score: 1

    The big danger of ftpfs and similar jollies is that it has no way of file locking. Or writing to/reading from a random place in a file, but that's minor compared to the locking issue.

    I solved it by (warning, I'm turning into a fanboy now) buying an ibook and rsync'ing across to the server whenever practical.

    Dave

    --
    I write a blog now, you should be afraid.
  15. Windows by osd1000 · · Score: 1

    Actually, on Win2K you have NTFS reparse points, which you could in principle use to make your USB device available as C:\Documents and Settings\%USERNAME%

  16. Or even SUBST by Burb · · Score: 1
    You could always use the subst command to map a logical drive to a directory... yeah, I know it's not Linux, but it's occasionally useful.

    Map, say, T: to \\yourfiles\whereever

    Then use /cygdrive/t or whatever

    Excuse me, no manuals to hand, above could be wrong in detail.

    --

  17. VNC? by Gudlyf · · Score: 2, Insightful
    I know of many people (including myself) who set their "real" working environment on one system running a VNC server, then connect to that from home, the road, etc. via SSH. Not the fastest solution, but it works.

    Then if you're really ambitious, build a VNC client for all of the OS's you'll be working on and put them on a CD for portability.

    --
    Trolls lurk everywhere. Mod them down.
  18. CVS? by infernalC · · Score: 1

    I think the simplest solution is to set up an etc/ path under ~ on an up-al-the-time machine and then script a CVS checkout of that directory in one of your .whatever scripts. Then source everything in ~/etc/. Alias exit to do a CVS commit. You can make this stuff pretty painless with public key authentication (not interactive) and ssh.

    If need be, you could CVS all of ~/, but do whatever you think is best for your needs.

  19. Host it on MacOSX if that's in the mix by bill_mcgonigle · · Score: 1

    I've already tried hosting an OSX home directory over NFS, and it just doesn't work. Too many programs expect HFS+ functionality (resource forks, attributes, etc.). Since HFS+ is a functional superset of most other filesystems you should be able to host other OS's homes on an OSX machine (then share it out with Samba, NFS, etc.). With journaling now, it's not entirely suicidial either.

    --
    My God, it's Full of Source!
    OUTSIDE_IP=$(dig +short my.ip @outsideip.net)
  20. What I do by kruczkowski · · Score: 1

    I setup a server at my parents house. It's a simple SMB/web server. When I lived at home I just mapped to it.

    Now most of my files are still on the server, I just ssh into and copy them to the webserver.

    It works for a few files.

    For the bookmarks, I exported my IE bookmarks to a HTML page and posted that on my server. It helps when you own a domain for this.

    I guess a future project would be to script everything so my ibook at home would zip and ftp the file onto my server.

    Then the server would extract and merge the files on the server and zip them up and host them on the web site.

    That way when I see a new computer I can d/l the zip and be ready to go.

    I'm also looking into WebDAV calader. It would be nice to have a central calander.

    Here is some last minute advice if your going to setup a server. Don't put X. Don't put any fancy crap. I made a rule when I installed my server that only "mission critical" stuff was to be on it, not the latest kernel nor SMB. It works and has an uptime of 396 days!

    --
    hmm... for fun I enjoy launching DDoS attacks against 127.87.42.5
  21. Use CVS by jmason · · Score: 1

    Use a decent version-control system that can run over SSH. Create a repository on a central server, and "cvs checkout" onto every machine.

    Then pick the files you want to share (bookmarks, bashrc, cron jobs, scripts, your TODO list, ~/bin), move them to the "cvs checkout"'d directory and leave symlinks to them from the old locations.

    When you change them, do "cvs commit", and "cvs update" periodically on all machines.

    Hey presto -- works great... occasionally you may have to fix conflicts by hand after a "cvs update", but otherwise it's brilliant.

  22. What you're looking for... by Anonymous Coward · · Score: 1, Funny

    ...is a folder called "My Documents". Just double-click the icon on your desktop.

    Please feel free to concact us again anytime.

    Jason
    Agent 83832
    HP/Compaq Support

  23. NTFS Reparse Point by man_ls · · Score: 1

    Built into the NTFS filesystem are "reparse points", the ability to mount volumes as folder paths.

    This way, it would be *trivial* to mount your USB thumbdrive as C:\Documents and Settings\$USER\, just have it symlinked that way and make sure the drive is plugged in when you boot. Otherwise it might get messy.

    NTFS also supports hardlinking...not quite the same thing as symlinks, but rather close...The real trouble is that most of these things aren't supported using the default tool set, you must add it using third-party software. Such software (usually free) just calls the APIs to create hardlinks, reparse points, etc.

  24. symlinks to dotfiles mounted from elsewhere by QuietRiot · · Score: 1

    Make a SMB share somewhere containing all your dotfiles and things you want to get to from elsewhere. This may or may not work very well for other types of files/documents/etc.

    In each homedirectory on each real machine:
    $ mkdir ~/dotfiles
    $ cp (or mv) dotfiles to ~/dotfiles
    $ ln -s all the .* files in ~/ to the copies in ~/dotfiles

    (omit any files that are specific to the machine and which you don't want to use the master for)

    In a shell-login script (.profile or .login) DON'T MOVE THESE AS DESCRIBED ABOVE

    Put a master copy of your .bashrc, .vimrc, .muttrc, etc. onto the master SMB share.

    $smbmount [master homedir] on top of ~/dotfiles

    all the symlinks will then point to the mounted homedir.

    On logout, unmount the remote SMB directory (or directories, if you'd like to adapt the idea for other types of files) and rsync (or unionify, or codafy, cvs, etc.) any changes from the master back to ~/dotfiles. This way, if the next time you login to that machine, the master isn't availible, you've got at least a semi-current version of your files (via the symlinks). If you want to keep a file local, don't symlink it.

    Works under windows or uni*. Isn't nearly as complex as some other ideas mentioned. Isn't perfect, so lay off. Just popped into my head..... Adapt as needed, you're smart.

  25. rsync by jthomas2 · · Score: 1

    The answer is and always has been rsync. Having many copies of stuff around is both cheap & improves reliability - just rsync from time to time over ssh to keep your files up to date. crontab it & don't worry about your operating system.

    -Jay

  26. Self-certifying File System by notime · · Score: 1

    Take a look at http://www.fs.net ... There was an article in the ;login Dec 2002 issue

    "SFS is a secure, global network file system with completely decentralized control. SFS lets you access your files from anywhere and share them with anyone, anywhere."

    --
    Eric