GhostBSD Mounting Options
GhostBSD lacks a direct /run/media/username/mountpoint
equivalent. The best options:
- User Directory: Mount at
~/.calibre/mnt/device
for full control.
/media/username
(Manual Setup):
mkdir -p /media/$USER
chown $USER:$USER /media/$USER
chmod 700 /media/$USER
mount -t msdosfs /dev/da0s1 /media/$USER/device
/mnt/username/device
: Similar to /media
, more traditional for FreeBSD.
autofs
(Advanced): Can automate mounting but may be overkill.
Best for Calibre: ~/.calibre/mnt/device
(avoids permission issues, user-specific, no system changes).
Automating Mounting & Unmounting
1. Identify Device
Plug in the eBook reader and check:
dmesg | tail
ls /dev/da*
Use libmtp
/mtpfs
for MTP devices.
2. Create Mount Directory
mkdir -p ~/.calibre/mnt/device
chmod 700 ~/.calibre/mnt/device
3. Mount Script
Create /usr/local/bin/mount-ebook.sh
:
#!/bin/sh
USER="<your_username>"
MOUNTPOINT="/home/$USER/.calibre/mnt/device"
DEVICE="/dev/da0s1"
mkdir -p "$MOUNTPOINT"
chown "$USER:$USER" "$MOUNTPOINT"
mount -t msdosfs -o noatime,uid=$(id -u $USER),gid=$(id -g $USER) "$DEVICE" "$MOUNTPOINT"
exit 0
sudo chmod +x /usr/local/bin/mount-ebook.sh
4. Unmount Script
Create /usr/local/bin/unmount-ebook.sh
:
#!/bin/sh
MOUNTPOINT="/home/<your_username>/.calibre/mnt/device"
if mount | grep -q "$MOUNTPOINT"; then
umount "$MOUNTPOINT"
rmdir "$MOUNTPOINT"
fi
exit 0
sudo chmod +x /usr/local/bin/unmount-ebook.sh
5. Configure devd
for Auto-Mounting
Edit /etc/devd.conf
:
notify 100 {
match "system" "DEVFS";
match "subsystem" "CDEV";
match "type" "CREATE";
match "cdev" "da[0-9]s1";
action "/usr/local/bin/mount-ebook.sh";
};
notify 100 {
match "system" "DEVFS";
match "subsystem" "CDEV";
match "type" "DESTROY";
match "cdev" "da[0-9]s1";
action "/usr/local/bin/unmount-ebook.sh";
};
Restart devd
:
sudo service devd restart
6. Test
- Plug in the eBook reader → Mounts to
~/.calibre/mnt/device
- Unplug it → Unmounts automatically
7. Configure Calibre
If not detected, go to: Preferences → Miscellaneous → Customize Device Detection, add:
~/.calibre/mnt/device