Skip to content

Instantly share code, notes, and snippets.

@daedric
Last active September 9, 2018 18:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save daedric/3c436e069d925a03f183f12b69022434 to your computer and use it in GitHub Desktop.
Save daedric/3c436e069d925a03f183f12b69022434 to your computer and use it in GitHub Desktop.
#!/usr/bin/bash
set -e
# Stop dropbox first !
dd if=/dev/zero of=dropbox-volume bs=1M count=3072
mkfs.ext4 dropbox-volume
sudo mount dropbox-volume Dropbox2
sudo chown $USER Dropbox2
sudo chown $USER Dropbox2/lost+found
rsync --partial --progress --recursive --remove-source-files Dropbox/ Dropbox2/
mv Dropbox Dropbox.old
sudo umount Dropbox2
mv Dropbox2/ Dropbox/
# Now we can mount the volume on the final destination.
sudo mount dropbox-volume Dropbox
# you can start dropbox now. fstab for automatic mounting is not covered
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment