[SOLVED] Mount USB at boot (reboot) and copy file
I am trying to mount a usb immediately after the boot and copy two files on my system.
At the moment I made the folllwing steps:
- creation of the directory /mnt/usb.
creation the following script startup with the following code for the user "pi"
sudo mount /dev/sda1 /mnt/usb -o uid=pi,gid=pi
sudo cp /mnt/usb/interfaces /etc/network/interfaces
sudo cp /mnt/usb/resolv.conf /etc/resolv.conf
if [ -f /mnt/usb/interfaces ]; then
sudo mv /mnt/usb/interfaces /mnt/usb/interfaces.done
if [ -f /mnt/usb/resolv.conf ]; then
sudo mv /mnt/usb/resolv.conf /mnt/usb/resolv.conf.done
Insetion of the script to the crontab file by adding the following row:
The problem is that it does not work.
In the past I made a similar thing on my Raspberry but I cannot find out how to make it.
Note that, of course, we can use different usb stick with the files to be copied on the system.
Eng. Silvano Bertoldo, PhD
- All Categories
- 105 Announcements & News
- 55 Product News - New Product/Product Change Notice/ End-of-life
- 186 Welcome Developers!
- 55 Unboxing & Project Sharing
- 50 Tech Updates
- 693 UP Products
- 11 UP 7000
- 1 UP Squared i12
- 10 UP Xtreme i12
- 11 UP Squared Pro 7000
- 1 UP Element i12 Edge
- 19 UP Squared V2
- 59 UP 4000
- 24 UP Xtreme i11
- 35 UP Squared 6000
- 60 UP Squared Pro
- 143 UP Xtreme
- 837 UP Squared
- 1.4K UP Board
- 89 UP Core Plus
- 222 UP Core
- 3 UP Xtreme Lite
- 44 UP AI Edge
- 216 Starter Kits & Peripheral