Skip to content

Instantly share code, notes, and snippets.

@mustafaturan
Last active June 27, 2022 20:09
Show Gist options
  • Save mustafaturan/8f153ed45fc1c534b400aed36b8e934f to your computer and use it in GitHub Desktop.
Save mustafaturan/8f153ed45fc1c534b400aed36b8e934f to your computer and use it in GitHub Desktop.
Mount SSD with Fstab User Write Permissions
# Create the folder to mount drive 
sudo mkdir /mnt/storage

# Set user/group perms to write
chown -R pi:pi /mnt/storage

# find the driver properties
sudo blkid

# get ids
id -g pi
id -u pi

# edit fstab to include the driver to load automatically on startup
sudo vim /etc/fstab

# Modify/Add the following line according to your driver information
# PARTUUID=<> /mnt/storage <FILESYSTEM> users,defaults 0 0
PARTUUID=<PARTUUUID from blkid> /mnt/storage exfat users,defaults,uid=1000,gid=1000 0 0

# Try it out by mounting all drivers from the fstab file definition
sudo mount -a

# Follow the error messages to fix otherwise revert!

# Set SE
chcon -Rt svirt_sandbox_file_t /mnt/storage
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment