简体   繁体   中英

Raspberry Pi 4 / mount network at boot

I need access to a network drive with my Pi 4 (latest Buster). This also works via the terminal with the following command:

sudo mount -t cifs -o username=xxx@root.lan,password=xxxxxx //xxshr9.root.lan/daten /home/pi/mnt

Now I want the whole thing to run automatically when I start it. Unfortunately, this does not work. I have tried the following ways so far without success:

  • Insert the above command in the "/etc/rc.local".
  • Create a service that calls a.sh file.
  • I have also added the following line to "/etc/fstab":

//xxshr9.root.lan/daten /home/pi/mnt cifs username=xxx@root.lan,password=xxxxxx 0 0

Does anyone have any ideas?

I have found the solution. I had to activate the function under "raspi-config" so that the Pi only boots when the network is loaded.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM