First off, to get that off my chest: I am not using Gnome, KDE, XFCE or any "desktop manager" (well, not quite true, I use some bits of XFCE, but it's easier to assume I'm not).
So automounting is always a little tricky for me, and I often use pmount
to mount external drives and flash cards.
Now, I have tried to add an external drive as a backup to one of my git-annex repositories. I zero'd the drive, added a GPT partition (I wanted labels), formatted it as ext4
and then gave it to my user:
cfdisk /dev/sdd
mkfs -t ext4 /dev/sdd1
mount /dev/sdd1 /mnt
chown anarcat /mnt
umount /mnt
Now, at this step I would have assumed the drive would be seen by the webapp, but that wasn't the case. Maybe I wasn't patient enough? In any case, at some point I got tired and went to the commandline to add the drive as a remote. I did the following:
mkdir -p /media/ata-WDC_WD15EADS-00P8B0_WD-WMAVU0748851-part1
mount /dev/disk/by-id/ata-WDC_WD15EADS-00P8B0_WD-WMAVU0748851-part1 /media/ata-WDC_WD15EADS-00P8B0_WD-WMAVU0748851-part1
cd /srv/mp3
git annex remote add backup /media/ata-WDC_WD15EADS-00P8B0_WD-WMAVU0748851-part1/mp3
git init /media/ata-WDC_WD15EADS-00P8B0_WD-WMAVU0748851-part1/mp3
git annex sync
git annex copy --to backup
So that worked, and the webapp was now seeing backup
as yet another repository, but not quite removeable. So failed. Scratching that, I stopped the assistant, and trashed the repository:
rm -rf /media/ata-WDC_WD15EADS-00P8B0_WD-WMAVU0748851-part1/mp3
git remote rm backup
But now, oddly enough, the webapp would see the external drive after being restarted, and I was able to add that drive.
What am I doing wrong? how is the assistant finding those drives? --anarcat
It doesn't make sense for the git-annex assistant to try to somehow detect and mount drives. Every OS has its own way to do that.
The assistant simply detects drives that have been mounted by the OS.
There is absolutely no problem with manually setting up a git repository on a removable drive and using it with the assistant. This is identical to what the assistant would set up for an external drive (except perhaps being a non-bare repository). The assistant simply detects if any git remote whose url is a directory is inside a mount point when it sees a new device be mounted.
Fair enough, I guess. However, I must say that it seems that git-annex doesn't actually detect properly externally mounted hard drives. For example, here I have an annex in /srv/foo that is part of my system hard drive (but in a separate /srv partition). Then I made a backup annex in /backup/srv/foo that is on an external hard drive, yet the webapp sees those two repos as under its control - as in, i can choose both in the "switch repository" menu.
Another drive I was able to add using the "add external drive" tool in the webapp doesn't show up in that list (and that's fine too!).