Skip to content

Instantly share code, notes, and snippets.

@michalpelka
Forked from zebrajaeger/usbmount-headless.md
Last active April 23, 2023 12:52
Show Gist options
  • Save michalpelka/82d44a21c29f34ee5320c349f8bbf683 to your computer and use it in GitHub Desktop.
Save michalpelka/82d44a21c29f34ee5320c349f8bbf683 to your computer and use it in GitHub Desktop.
usbmount (also ntfs) for Raspberry PI 4b - Raspberry PI OS lite 32 (headless)

usbmount (also ntfs) for Raspberry PI 4b - Raspberry PI OS lite 32 (headless)

1. Install OS

Download and install "Raspberry Pi Imager" from https://www.raspberrypi.org/software/

Choose "Raspberry PI OS Lite 32" Press Ctrl+Shift+X

  • Maybe switch to save always

  • Change hostname

  • Activate ssh, copy your public key into the text field

  • Activate WiFI, choose SSID and password, choose country

  • Change timezone and keyboard layout

Choose SD-Card and flash

2. Install dependencies

sudo apt install git debhelper build-essential ntfs-3g

3. compile and install usbmount

cd /tmp
git clone https://github.com/rbrito/usbmount.git
cd usbmount
dpkg-buildpackage -us -uc -b
cd ..
sudo apt install ./usbmount_0.0.24_all.deb

4. edit configuration

4.1. usbmount

sudo nano /etc/usbmount/usbmount.conf

and change these keys to:

FILESYSTEMS="vfat ext2 ext3 ext4 hfsplus ntfs fuseblk"
FS_MOUNTOPTIONS="-fstype=vfat,users,rw,umask=000 -fstype=exfat,users,rw,umask=000"
VERBOSE=yes

4.2 udev

Create file:

sudo mkdir /etc/systemd/system/systemd-udevd.service.d
sudo nano -w /etc/systemd/system/systemd-udevd.service.d/00-my-custom-mountflags.conf

and add content:

[Service]
PrivateMounts=no

restart udev (or reboot instead):

sudo systemctl daemon-reexec
sudo service systemd-udevd restart

5. debug

tail -f /var/log/syslog

Appendix

Links to information i used

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment