LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   External USB drives out of disk space when copying files via Samba (https://www.linuxquestions.org/questions/linux-newbie-8/external-usb-drives-out-of-disk-space-when-copying-files-via-samba-4175512450/)

Lakeshow32 07-27-2014 06:16 PM

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!

frankbell 07-27-2014 08:16 PM

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.

Lakeshow32 07-28-2014 11:41 AM

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
/dev/sdc1      19091584 13571680  4527036  75% /
none                  4        0        4  0% /sys/fs/cgroup
udev            2022624      12  2022612  1% /dev
tmpfs            406448      964    405484  1% /run
none                5120        0      5120  0% /run/lock
none            2032236        0  2032236  0% /run/shm
none              102400        0    102400  0% /run/user
/dev/sdc2        237869    62915    158366  29% /boot
/dev/sdc5      74652840    53036  70784588  1% /home

Output from "fdisk -l":

Code:

WARNING: GPT (GUID Partition Table) detected on '/dev/sdb'! The util fdisk doesn't support GPT. Use GNU Parted.


Disk /dev/sdb: 1000.2 GB, 1000204886016 bytes
255 heads, 63 sectors/track, 121601 cylinders, total 1953525168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

  Device Boot      Start        End      Blocks  Id  System
/dev/sdb1              1  1953525167  976762583+  ee  GPT

WARNING: GPT (GUID Partition Table) detected on '/dev/sda'! The util fdisk doesn't support GPT. Use GNU Parted.


Disk /dev/sda: 2000.4 GB, 2000365289472 bytes
255 heads, 63 sectors/track, 243197 cylinders, total 3906963456 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

  Device Boot      Start        End      Blocks  Id  System
/dev/sda1              1  3906963455  1953481727+  ee  GPT

Disk /dev/sdc: 100.0 GB, 100030242816 bytes
255 heads, 63 sectors/track, 12161 cylinders, total 195371568 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00028a15

  Device Boot      Start        End      Blocks  Id  System
/dev/sdc1            2048    39063551    19530752  83  Linux
/dev/sdc2  *    39063552    39563263      249856  83  Linux
/dev/sdc3        43417598  195371007    75976705    5  Extended
/dev/sdc4        39563264    43415551    1926144  82  Linux swap / Solaris
/dev/sdc5        43417600  195371007    75976704  83  Linux

Partition table entries are not in disk order

And finally /etc/fstab:

Code:

/etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point>  <type>  <options>      <dump>  <pass>
# / was on /dev/sda1 during installation
UUID=54a5d5a8-e5d3-494f-86b6-fa0e3d3c3cfa /              ext4    errors=remount-ro 0      1
# /boot was on /dev/sda2 during installation
UUID=d1b85ca2-4892-475e-b48e-c8e7192fdc9b /boot          ext4    defaults        0      2
# /home was on /dev/sda5 during installation
UUID=6c1de1cb-9846-48ea-9a9d-2991c960a97d /home          ext4    defaults        0      2
# swap was on /dev/sda4 during installation
UUID=7aa30310-eff4-4a68-81f5-6e14a1c8d4e9 none            swap    sw              0      0
# shared drive for regular file sharing
#UUID=65ea71e4-e901-4403-a734-1cb78f5c3e05    /mnt/fileshare  ext2    rw,user,auto    0    0
# shared drive for media files
#UUID=84ecac70-220c-4d9b-a4d3-cb98e27ca1f0    /mnt/media      ext2    rw,user,auto    0    0
# shared network backup drive
#UUID=85ffe2cd-90d2-4c2f-9efe-a863de8a0041    /mnt/backup      ext2    rw,user,auto    0    0


jefro 07-28-2014 03:30 PM

Almost seems like a disk quota.

suicidaleggroll 07-28-2014 04:15 PM

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.

Lakeshow32 07-28-2014 08:43 PM

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

Lakeshow32 07-28-2014 10:11 PM

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
255 heads, 63 sectors/track, 12161 cylinders, total 195371568 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00028a15

  Device Boot      Start        End      Blocks  Id  System
/dev/sda1            2048    39063551    19530752  83  Linux
/dev/sda2  *    39063552    39563263      249856  83  Linux
/dev/sda3        43417598  195371007    75976705    5  Extended
/dev/sda4        39563264    43415551    1926144  82  Linux swap / Solaris
/dev/sda5        43417600  195371007    75976704  83  Linux

Partition table entries are not in disk order

WARNING: GPT (GUID Partition Table) detected on '/dev/sdc'! The util fdisk doesn't support GPT. Use GNU Parted.


Disk /dev/sdc: 1000.2 GB, 1000204886016 bytes
255 heads, 63 sectors/track, 121601 cylinders, total 1953525168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

  Device Boot      Start        End      Blocks  Id  System
/dev/sdc1              1  1953525167  976762583+  ee  GPT

WARNING: GPT (GUID Partition Table) detected on '/dev/sdb'! The util fdisk doesn't support GPT. Use GNU Parted.


Disk /dev/sdb: 2000.4 GB, 2000365289472 bytes
255 heads, 63 sectors/track, 243197 cylinders, total 3906963456 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

  Device Boot      Start        End      Blocks  Id  System
/dev/sdb1              1  3906963455  1953481727+  ee  GPT


suicidaleggroll 07-29-2014 07:49 AM

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.

Lakeshow32 07-29-2014 08:23 AM

@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
/dev/sda1        19G  1.4G  16G  8% /
none            4.0K    0  4.0K  0% /sys/fs/cgroup
udev            2.0G  4.0K  2.0G  1% /dev
tmpfs          397M  960K  396M  1% /run
none            5.0M    0  5.0M  0% /run/lock
none            2.0G    0  2.0G  0% /run/shm
none            100M    0  100M  0% /run/user
/dev/sda2      233M  62M  155M  29% /boot
/dev/sda5        72G  52M  68G  1% /home


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?

suicidaleggroll 07-29-2014 08:48 AM

What errors were you getting on boot?

Lakeshow32 07-29-2014 09:23 AM

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
[  34.360021] usb 2-4: device descriptor read/64, error -110
[  49.783356] usb 2-4: device descriptor read/64, error -110
[  65.046685] usb 2-4: device descriptor read/64, error -110
[  75.716691] usb 2-4: device not accepting address 6, error -110

I just uncommented the lines in fstab and rebooted and did not get any messages, so I'm not sure what the problem was exactly at that time.

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...

suicidaleggroll 07-29-2014 09:36 AM

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
blkid /dev/sdc1

Should give you each of their UUIDs respectively. Of course you'll have to modify this if they've changed names again.

Lakeshow32 07-29-2014 10:38 AM

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?

suicidaleggroll 07-29-2014 11:47 AM

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").

Lakeshow32 07-29-2014 05:33 PM

Got it.

Thanks to suicidaleggroll and everyone for their help.


All times are GMT -5. The time now is 06:46 AM.