Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
386 views
in Technique[技术] by (71.8m points)

systemd - Can't mount a permanently installed USB flash drive to the mount point of my choosing with Raspian 10

I want my Raspberry Pi 4B, running Raspian 10, to boot up with a permanently-inserted USB flash drive mounted to /srv/www. The flash drive will never be removed. I formatted the flash drive with an ext4 filesystem. I can manually mount the drive to /srv/www and perform normal file operations.

When I add an entry to /etc/fstab like this:

/dev/sda1  /srv/www  ext4  0  0

or like this:

UUID=651003ce-5261-4b00-9940-6207625a5334  /srv/www  ext4  0  0

the mount does not succeed when the system boots. I've been at this for hours, trying various suggestions for configuring systemd and see a variety of errors in system logs such as "/dev/sda does not contain a filesystem" but fsck tells me it does. Before I go spend more hours, is what I'm trying to do possible and where am I going wrong?

question from:https://stackoverflow.com/questions/65897159/cant-mount-a-permanently-installed-usb-flash-drive-to-the-mount-point-of-my-cho

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Unable to find a fstab-related solution, I solved the problem by placing these two lines in /etc/rc.local

sleep 5s
mount /dev/sda1  /srv/www

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...