Resizing the root folder on an external HDD on Raspberry Pi 2

Right now I’m using Ubuntu Mate with a Raspberry Pi 2 in order to use Transmission and files were being stored on an external HDD with 4 TB. So far everything was working well, but recently arose an error saying that there was no space available. Then I realized that the error is the root folder has a size of 1.5 TB and was already filled to 100%.

Apart from the root folder, there are also other folders of the same size that are also filled to 100%:

/ 100% 1,5 TB
media 99,0% 1,5 TB
os**** 100% 1,5 TB
Seagate 100% 1,5 TB

The downloaded files are stored within the Seagate folder.

My question then is how can I increase the size of those folders from 1.5 TB to 4 TB without losing or damaging my files, because right now I have no other HDD, plus I do not want to delete the already downloaded files.

I’m a bit confused what you mean by root folder. Is Ubuntu MATE running from the external hard drive or is it running off an SD card but mounting the external drives?

Folders are not limited by size, but the partition of that disk. It could be a limitation of the file system, partition sizes or improper mount points.

What’s the output of these commands?

df -h
sudo fdisk -l

The first one will tell us how much space is avaliable per mount point, and the second lists the structure of your partitions.

The operating system was installed on an SD card and then connect the HDD to the Rasperry Pi 2, so I would assume that is the second option.

When using df -h this is the output:

S.ficheros Tamaño Usados Disp Uso% Montado en
/dev/root 15G 15G 27M 100% /
devtmpfs 459M 0 459M 0% /dev
tmpfs 463M 228K 463M 1% /dev/shm
tmpfs 463M 6,8M 457M 2% /run
tmpfs 5,0M 4,0K 5,0M 1% /run/lock
tmpfs 463M 0 463M 0% /sys/fs/cgroup
/dev/mmcblk0p1 64M 20M 45M 32% /boot
tmpfs 93M 28K 93M 1% /run/user/1000
/dev/sda2 3,7T 1,4T 2,3T 38% /media/oswaldo/Seagate Expansion Drive

When using sudo fdisk -l this is the output:

Disk /dev/mmcblk0: 14,9 GiB, 16021192704 bytes, 31291392 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
Disklabel type: dos
Disk identifier: 0xf9315c16

Disposit. Inicio Start Final Sectores Size Id Tipo
/dev/mmcblk0p1 * 2048 133119 131072 64M c W95 FAT32 (LBA)
/dev/mmcblk0p2 133120 31291391 31158272 14,9G 83 Linux

Disk /dev/sda: 3,7 TiB, 4000787029504 bytes, 7814037167 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: gpt
Disk identifier: CB069A90-F85C-4628-9906-0CF25197F11C

Disposit. Start Final Sectores Size Tipo
/dev/sda1 34 262177 262144 128M Microsoft reserved
/dev/sda2 264192 7814035455 7813771264 3,7T Microsoft basic data

Partition 1 does not start on physical sector boundary.

The root file system is indeed simply full. This could've happened if the drive wasn't mounted at the intended directory and wrote to the SD card (thinking it was the drive) instead.

Filesystem Size Used Avail Use% Mounted on
/dev/root 15G 15G 27M 100% /
/dev/sda2 3.7T 1.4T 2.3T 38% /media/oswaldo/Seagate Expansion Drive

I'd suggest checking your home folder and move any files that shouldn't be there to /media/oswaldo/Seagate Expansion Drive where your external drive is mounted. Then check Transmission's preferences so that the default download location is correctly pointing to the right folder on the drive.

MATE Disk Analyser tool may be helpful to find these large files.


Tip! You can add symbolic links from the terminal if you'd like /home/oswaldo/Seagate or /home/oswaldo/Downloads to point to the drive's root folders (or any folder inside):

ln -s /home/oswaldo/Seagate  /media/oswaldo/Seagate Expansion Drive

/dev/sda1 34 262177 262144 128M Microsoft reserved
/dev/sda2 264192 7814035455 7813771264 3.7T Microsoft basic data

Nothing needs to be resized, as your drive's NTFS partition is 3.7 TiB (4 TB).


A little tip while in the file manager is to check the status bar for available free space, for instance:

  • I'm in my SSD folders:

  • I'm in my HDD folders:

Indeed, that was the problem, one of the files was being downloaded to the SD card and completely filled, then moved the file from the SD to the correct folder on the HDD and the problem was solved.

Thank you very much for your help.

1 Like