1

I have ubuntu 12.04 installed in my internal HDD. Is it possible to carry my desktop in my pendrive and use in my office computer and synchronize with my computer when I am back at home.

Jorge Castro
  • 71,754
Namshum
  • 1,765

1 Answers1

1

I do something similar, and just use rsync to keep the pendrive up to date or to update one of the computers. rsync works best because with the right switches it will back everything up without overwriting the same file each time, or overwriting newer files with an older version.

To backup (for example) your Documents directory to the Pendrive first give the pendrive a label (volume name) and make a target directory such as 'Documents' on it. By giving the pendrive a label it will be easily found under the /media directory. Next issue the following command:

rsync -av ~/Documents/ /media/yourlabelname/Documents/

This command will backup up everything in your home Documents onto the pendrive. To reverse the process and update the files on another comptuer, simply reverse the rsync command eg:

rsync -av /media/yourlabelname/Documnets/ ~/Documents/

It's easy enough to put both of these commands into very short bash scripts and execute one each time by typing the name of the bash script. If the scripts are in ~/bin then they will get included in the executable path.

Note that if the USB drive is formatted FAT then the volume name is normally limited to capitals only, even if you typed the volume name in lowercase when you created it. Because bash is completely case sensitive you must get the volume name and directory name exactly right or the rsync commands will fail to work.

fabricator4
  • 8,375
  • I rename my pendrive and created folder "Documents" but it shows and error sending incremental file list rsync: mkdir "/media/Manuranjan/Documents" failed: No such file or directory (2) rsync error: error in file IO (code 11) at main.c(605) [Receiver=3.0.9] rsync: connection unexpectedly closed (9 bytes received so far) [sender] rsync error: error in rsync protocol data stream (code 12) at io.c(605) [sender=3.0.9] – Namshum Sep 22 '12 at 14:05
  • 1
    Either the pendrive is not not mounted correctly, or there's an error in capitalisation. Remount the drive and check your syntax. After you change the volume name you must remount the drive to get it on the correct mount point. – fabricator4 Sep 22 '12 at 21:15
  • Thanks! The error was due to capitalisation of the usb device label – Namshum Sep 30 '12 at 09:09
  • Thankyou, I've added information to the answer to make it clearer for anyone else using this that Linux is very case sensitive, and that FAT volume names can be upper case only. – fabricator4 Sep 30 '12 at 09:36