1

Forgive me if I'm in the wrong Stack, this seemed like a more general Linux thing, so I posted here. Np if I need to take it elsewhere. Also I'm pretty new to Linux so please be patient.

Hardware= Raspberry Pi 3 OS= Raspbian Buster, apt-get update and upgrade applied Application= PLEX server, NAS and networked TimeMachine target

I have a 3 TB USB disk that I formatted gpt/EXT4 the issue that I'm having is that any file copied to it is instead taking up space on the internal SD card.

I have created the directory /mnt/nas and set that as the mount point for the drive at boot using fstab:

UUID=F00F00F00 /mnt/nas ext4 defaults,auto,users,rx,nofail 0 0,x-systemd.device-timeout=15

I get no errors- however, when I go to copy files I get some "no storage left" error because the files are trying to fill my SD card.

I have attached a screenshot showing that after transferring a large folder /mnt/nas has the same Free Space/Total Space as Filesystem. What am I doing wrong that files aren't making it onto the external disk?

Thanks in advance

enter image description here

  • 1
    The mount likely didn't happen. What says df /mnt/nas? Does it show the root FS or the NAS one? Is the UUID in fstab the right one? Iff the NAS has a different UUID that entry will be ignored. – xenoid Feb 7 at 23:30
1

As @xenoid suggested, it seems you've not actually mounted the USB drive that you've connected to your RPi. Perhaps the easiest way to confirm that is to check as follows:

$ lsblk --fs
NAME        FSTYPE LABEL       UUID                                 MOUNTPOINT
sda
└─sda1      exfat  SANDISK16GB 5B00-9E5C                            /home/pi/mntThumbDrv
sdb
└─sdb1      ext4   PASSPORT2TB 86645948-d127-4991-888c-a466b7722f05 /home/pi/mntPassport
sdc
└─sdc1      ext4   SANDISK8GB  e5cb39a9-b041-4339-92f5-4172201a4b1a /home/pi/mntBackupDrv
mmcblk0
├─mmcblk0p1 vfat   boot        5DB0-971B                            /boot
└─mmcblk0p2 ext4   rootfs      060b57a8-62bd-4d48-a471-0d28466d1fbb /

You can plug your USB disk into your RPi, and then run the command as shown above. You will get a similar output.

Let's decipher this:

The lsblk command lists block devices. I prefer it because it's simple to use, and easy to read. man lsblk will give you all the details.

As you can see, there are 5 columns in the output. Let's look in the NAME column at the one for sdb as this is likely to be similar to your drive. First know that the name sdb designates a device name that was assigned by the system, and is indicative of the media type. Immediately below sdb is the name of a partition; sdb1 in this case. So - partitions belong to devices. A device must have at least one partition to be usable, and it may have more than one. Subsequent partitions in this case would be called sdb2, sdb3, etc.

Your USB drive (the device) should have a NAME like sdb, sdc, etc. Since you've said you created a partition, and formatted it with the ext4 filesystem, you should also see a numbered partition listed immediately below the device. In the row for that partition, the FSTYPE column should show ext4.

The LABEL column may contain a string of characters that were assigned - perhaps by you when you formatted the drive. I'll assume you know how to change this label if you like. The UUID column will contain a UUID that may be used in your fstab entry.

And finally, the "payoff": the MOUNTPOINT column will tell you if your drive is mounted, and where the mount point is located in your RPi's filesystem. Based on your question, I believe the MOUNTPOINT column for your USB drive partition will be empty/vacant - indicating that it is not actually mounted. If this is the case, you are writing your files to /mnt/nas/ which is just another directory in your RPi's file system - until your USB is actually mounted there!

So, to answer your question:

What am I doing wrong that files aren't making it onto the external disk?

You have failed to mount the USB drive.

You may want to first try using the mount command to mount your drive manually; for example:

sudo mount /dev/sdb1 /mnt/nas

Once you've done that, try writing files as before & note the difference. Then, construct an entry in your /etc/fstab following the instructions in man fstab. You may also find this "how-to" on GitHub helpful.

Otherwise, or if you're still having problems, edit your question to include the output of your lsblk --fs command, and we'll go from there.

| improve this answer | |
  • 1
    I was able to mount using the mount command which tells me that something was off with my fstab entry. I then made incremental changes to suspect options using umount and mount -a (which calls on the the table iirc) to check if my changes worked. In the end, I had to delete the timeout option and set permissions to rw (were rx). New entry: UUID= F00F00F00 /mnt/nas ext4 defaults,auto,users,rw,nofail 0 0 Thank you very much. I wish there were more people like you on the internet. Very clear and detailed answer delivered in a kind way. – Matsumura_Fishworks Feb 10 at 2:26
  • 1
    When I'm on the RPi, everything works as expected. The issue that I now have is that If I'm connected to the RPi via SSH, VNC, or the directory (/mnt/nas) over AFP (can connect just fine and read just fine) I cannot write to the disk. I'm assuming this means I haven't mounted the disk with correct permissions. Should I start a new question? What’s the proper stack etiquette? – Matsumura_Fishworks Feb 10 at 2:28
  • @Matsumura_Fishworks: First, thanks for the kind words. Second, it would probably be best for you to start a new question. However, the issue is almost certainly permissions as you have guessed. Here's the thing: Once you begin sharing via Samba, a 2nd set of permissions and authentication comes into play. In addition to your Linux permissions and authentication, you now have Samba permissions and authentication. Look at this GitHub page; hopefully all will become clear once you read through that. – Seamus Feb 10 at 3:42

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.