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."
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.
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.
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.
I like the Windows link... http://fsf.org
Of course, in my browser at least, that should be http://www.fsf.org
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.
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. .laptop and .desktop .cur_dot that is linked on my laptop to .laptop, and on the desktop - .desktop (!) .kde is linked to .cur_dot/.kde .common_dot, and are linked correctly. So .tcshrc is linked to .common_dot/.tcshrc .kde and place some of them in .common_dot. .cur_dot
I solve the 2nd problem by having 2 directories, called
and a directory called
dot files that need to be the same on both systems sit in
If I really wanted, I could trace down the various bookmark and cache files in
I can thus rsync my home directory easily, just taking care not to overwrite
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....
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").
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
"The Most Fun Possible on 4 wheels" is at SunBuggy in Las Vegas
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) In Win2K...
/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.
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
THIS THING CAN TURN ON A DIME, MACROSSZERO STYLE ALSO FUCK BETA, ~NYORON
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.
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
I'm doing exactly what you're talking about using CVS.
.xyz binary files trying to do linefeed conversion, just because you forgot to tell it otherwise.
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
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.
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%
Map, say, T: to \\yourfiles\whereever
Then use /cygdrive/t or whatever
Excuse me, no manuals to hand, above could be wrong in detail.
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.
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.
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)
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
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.
...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
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.
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.
.* files in ~/ to the copies in ~/dotfiles
.login) DON'T MOVE THESE AS DESCRIBED ABOVE
.bashrc, .vimrc, .muttrc, etc. onto the master SMB share.
In each homedirectory on each real machine:
$ mkdir ~/dotfiles
$ cp (or mv) dotfiles to ~/dotfiles
$ ln -s all the
(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
Put a master copy of your
$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.
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
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