0

I added a 256 GB USB stick , mounted in :

/mnt/mydisk

I setup all my docker to have they files stored in the USB stick:

e.g:

docker create --name=transmission \
-v /mnt/mydisk/Download/Deluge/ConfigTransmission:/config \
-v /mnt/mydisk/Download/Deluge/:/downloads \
-v /mnt/mydisk/Download/Deluge/Data:/watch \
-e PGID=1000 -e PUID=1000 \
-e TZ=Europe/Dublin \
-p 9091:9091 -p 51413:51413 \
-p 51413:51413/udp \
lsioarmhf/transmission

although it's seems I don't have enough space downloading a light linux iso...

Not sure what's happening

NAME        MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sda           8:0    1 234.4G  0 disk 
├─sda1        8:1    1  31.5K  0 part 
├─sda2        8:2    1 234.4G  0 part 
└─sda3        8:3    1     8K  0 part 
mmcblk0     179:0    0  59.5G  0 disk 
├─mmcblk0p1 179:1    0   256M  0 part /boot
└─mmcblk0p2 179:2    0  59.2G  0 part /

UPDATE:

I think I used this for the mount :

sudo apt install exfat-fuse 
sudo mount /dev/sda2 /mnt/mydisk

and I add the device to /etc/fstab (something like UUID=THEUUID /mnt/mydisk xfat defaults,auto,users,rw,nofail 0 0)

although, it's seems the fstab file changed, as nothin is listed any more

sudo nano /etc/fstab
Binary file /etc/fstab matches
# a swapfile is not a swap partition, no line here
#   use  dphys-swapfile swap[on|off]  for that

When I try to manually mount :

pi@raspberrypi:~ $ sudo mount /dev/sda2 /mnt/mydisk
FUSE exfat 1.3.0
WARN: volume was not unmounted cleanly.
fuse: mountpoint is not empty
fuse: if you are sure this is safe, use the 'nonempty' mount option
  • 1
    It looks your USB stick is not mounted anywhere. Can you add the commands you used to mount it? – matteol Nov 24 '19 at 9:01
  • I updated my post but seems like something went wrong with the fstab folder – Kevin Nov 24 '19 at 9:26
  • So if I understand when I reboot my USB key wasn't mounted anymore, everything I did was save on the SDCard, what should I do ? I assume I can mount the USB in a another path, copy everything to the Usb then mount the USB in the original path again, not sure how to recovery the fstab file though – Kevin Nov 25 '19 at 14:29
1

You probably have a corrupted /etc/fstab file, so the mount failed and the data was written on the SD card. To correct the problem execute the following steps.

Replace the content of /etc/fstab with the following, using the UUIDs you get from blkid

proc            /proc           proc    defaults          0       0
PARTUUID=6c586e13-01  /boot           vfat    defaults          0       2
PARTUUID=6c586e13-02  /               ext4    defaults,noatime  0       1

Temporarily mount the USB stick on a different directory e.g. /mnt/tempUSB

sudo mkdir /mnt/tempUSB
sudo mount /dev/sda2 /mnt/tempUSB

and move the content from /mnt/mydisk to the USB stick

mv /mnt/mydisk/* /mnt/tempUSB

unmount the stick, disconnect it, and delete the temporary directory

sudo umount /mnt/tempUSB
sudo rm /mnt/tempUSB

Add the new line to /etc/fstab

UUID=THEUUID /mnt/mydisk xfat defaults,auto,users,rw,nofail 0 0

save /etc/fstab and check the update was successful

cat /etc/fstab

the output should have 4 lines, with the filesystems /proc, /boot, /, and /mnt/mydisk. Connect the USB stick and mount it using the content of /etc/fstab sudo mount -a Now you should be able to write on it.

To check if the setup is correct you can write a new file in /mnt/mydisk, unmount the stick, connect to another PC and check if the new file is there.

| improve this answer | |
  • since good thank you very much, didn't check the USB yet but seems to be mounted anyway , thanks again – Kevin Nov 25 '19 at 21:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.