External USB drives out of disk space when copying files via Samba
Hi,
I have two external USB drives connected to a laptop running Ubuntu Server 14.04 (no GUI). The drives are 1TB and 3TB in size respectively. Both have been formatted as "ext2" (as far as I can tell). I have entries in /etc/fstab that seem to mount the drives properly when I boot up the server. However, I am trying to copy files onto the 3TB drive from a Windows machine (via Samba share) and I get a message saying there isn't enough space yet I only have about 12GB of data on the drive. I suspect something is not mounted or formatted properly because when I run sudo lsblk /dev/sda2 it shows a size of 1.4T on the drive that should be 3TB (although this does not explain why I'm not able to copy more than 12GB of data). Any help to guide me in resolving this situation is greatly appreciated. I am definitely a Linux newbie, but am pretty comfortable with entering commands and following instructions. Thanks! |
What do the commands "df" (disk free space) and "fdisk -l" report when run in a terminal? (You may have to run the fdisk command as root.)
Also, what are the relevant entries in your /etc/fstab? This information should be enough to get the troubleshooting started. Please be kind enough to surround any terminal output with "code" tags for readability; they become available when you click the "Go Advanced" button to the right of the "Post Quick Reply" button at the bottom of the reply window. |
Thanks frankbell for helping out. Below is the requested output.
Here is some additional information that might be of use: the server in question has 4MB of RAM and a single hard drive of 100GB on which Linux was installed and partitioned according to a scheme recommended here: http://ubuntuserverguide.com/2013/02...r-edition.html. Not knowing anything about the best way to partition a drive for a server installation, I decided to follow that scheme because it was simple to follow an easy to understand. Here is the output of "df": Code:
Filesystem 1K-blocks Used Available Use% Mounted on Code:
WARNING: GPT (GUID Partition Table) detected on '/dev/sdb'! The util fdisk doesn't support GPT. Use GNU Parted. Code:
/etc/fstab: static file system information. |
Almost seems like a disk quota.
|
There is no 3TB drive shown in your fdisk -l output, and neither sda or sdb are mounted in your df output. What happens if you run "mount -a" as root? If there's no error, post the output of "df -h" again.
|
I apologize for the confusion...the 3TB drive is actually 2TB. Looking at the output of fdisk -l, it seems to be on /dev/sda1
|
Just rebooted my server and ran fdisk -l again and now the 2TB drive seems to be on /dev/sdb1...I'm not sure what this means, but it would seem like my fstab entries are not mapping the same devices to the same locations every time?
Output from fdisk -l after reboot: Code:
Disk /dev/sda: 100.0 GB, 100030242816 bytes |
It's normal for drives to change names, especially usb drives, fstab has nothing to do with it. Windows does the same thing. That's why your fstab entries use UUID instead of device name.
Anyway, you didn't post what I had asked for, but looking at your fstab a little closer it appears the mount entries for those two drives have been commented out. So they're not being mounted, and anything you write to any directory on this machine will go to the 100G drive, which is why it's running out of space so quickly. |
@suicidaleggroll: thanks, I just noticed that the stuff was indeed commented in fstab and now I recall why...when I had those lines uncommented, I was getting errors when my server booted up. But I guess that does explain why it was defaulting to the 100G drive.
As you requested, I ran "mount -a" as root as got no errors. Then ran "df -h" again and here is the ouptut: Code:
Filesystem Size Used Avail Use% Mounted on My question is, what is the proper way to do what I am trying to do...I simply want my USB drives to automatically be mounted when the server starts? |
What errors were you getting on boot?
|
These are not the exact errors I was getting, but the same type of message:
Code:
[ 19.096698] usb 2-4: device descriptor read/64, error -110 That said, what seems to be happening now is that my mount points are not going to the correct devices. For example /mnt/fileshare is going to the USB drive where I want /mnt/media to go (the 2TB drive) I thought the UUID was the way to uniquely identify a device but I think I'm missing something... |
Then you must have your UUIDs mixed up. You can use fdisk -l to print out the device sizes and names like you've been doing, and then use blkid to get the UUID for it.
Given your latest fdisk output, the 2TB is sdb and the 1TB is sdc, so: Code:
blkid /dev/sdb1 |
Thanks suicidaleggroll, that seems to be what was causing the problem.
Just so I understand, the mount points (/dev/sdb1, /dev/sdc1 etc..) are not fixed and may change when you reboot but the UUIDs are always going to point to the correct device? |
That's correct, but /dev/sdb1 and /dev/sdc1 are not mount points, they're device names. The mount points would be /mnt/media, /mnt/fileshare, /mnt/backup, or wherever else you decided to mount them.
Device names can move around depending on the order in which they were detected, similar to how if you attach two USB drives in Windows they might be labeled D: and E:, or E: and D:, depending on the order you plugged them in. UUIDs are unique identifiers that won't arbitrarily change when you reboot the machine (UUID stands for "Universally Unique IDentifier"). |
Got it.
Thanks to suicidaleggroll and everyone for their help. |
All times are GMT -5. The time now is 06:46 AM. |