0

My setup:

  • Ubuntu 16.04
  • SSD with 256 GB of space
  • HDD with 2 TB of space

My SSD is filling up with saved numpy arrays from all my Python code. I am hoping to move those data files onto my HDD to clear up space. Unfortunately I don't know how to do that since it doesn't look like a straightforward mv command will work.

Here is some information: after typing in gksu baobab, I get a pop-up where I can see memory usage. Here, you can see that my home drive (name is blacked out for privacy reasons) is almost filling up to 177.9 GB (say, why is it not 256GB? I thought this was my SSD?):

My disk usage: enter image description here

Here is df -h:

$ df -h
Filesystem      Size  Used Avail Use% Mounted on
udev             32G     0   32G   0% /dev
tmpfs           6.3G  706M  5.6G  11% /run
/dev/sda2       166G  128G   30G  82% /
tmpfs            32G   60M   32G   1% /dev/shm
tmpfs           5.0M  4.0K  5.0M   1% /run/lock
tmpfs            32G     0   32G   0% /sys/fs/cgroup
/dev/sda1       511M  3.6M  508M   1% /boot/efi
tmpfs           6.3G  156K  6.3G   1% /run/user/1000
none             32G  2.8M   32G   1% /tmp/guest-3qjkgk
tmpfs           6.3G  108K  6.3G   1% /run/user/999

I think dev/sda2 corresponds to my default usage on my computer, so if I move stuff and make new files, it will be here. I tested this by creating and removing temporary files,and the dev/sda2 memory usage changed. Unfortunately it seems like my 2 TB hard disk is not visible here.

Here is fdisk -l:

Disk /dev/ram0: 64 MiB, 67108864 bytes, 131072 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

//
// ram1 through ram14 omitted for clarity on askubuntu.com ...
//

Disk /dev/ram15: 64 MiB, 67108864 bytes, 131072 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

Disk /dev/sda: 232.9 GiB, 250059350016 bytes, 488397168 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: gpt
Disk identifier: 23607B86-A307-4986-9B20-6E4403223EF3

Device         Start       End   Sectors   Size Type
/dev/sda1       2048   1050623   1048576   512M EFI System
/dev/sda2    1050624 354359295 353308672 168.5G Linux filesystem
/dev/sda3  354359296 488396799 134037504  63.9G Linux swap


Disk /dev/sdb: 1.8 TiB, 2000398934016 bytes, 3907029168 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

Now, here I can see my hard disk, which is in dev/sdb. However, again I can't figure out how to simply move a bunch of numpy arrays over to this drive.

From looking online, the typical procedure seems to be related to mounting the dev/sdb. But from looking at descriptions (e.g. this ubuntu wiki) it seems like mounting the hard disk would give me access to the files within the hard disk, but I wouldn't be able to access the previous files in the SSD that I'm trying to dump over to the HDD. My logic is probably wrong somewhere... and also, that tutorial mentions some things about moving file systems around, but it then says:

no data is copied or removed, it is merely displayed in a different place

and the main reason why I need to move the files is indeed to free memory on the SSD.

I am a beginner with Ubuntu 16.04 so I am happy to provide more information that would be useful about my computer.

Note: the most closely related question here seems to be this one about moving / from SSD to HDD, since I too share that poster's concern:

I thought that the best way to solve this is simply to move everything from the SSD to the HDD? But I am not entirely sure how to accomplish that correctly!

But there is only one answer there which doesn't seem like it answered the question (and I'm not moving everything, I just want to dump some numpy arrays over).

  • 1
    You do not mount a drive, but a partition. And it looks like you have no partitions on sdb. I typical make several including another ESP, and / (root) for a test install, a large data partition, perhaps a backup of essential data from sda partition (but that is not my real only backup) and perhaps other partitions. Since sda is gpt, be sure to use gpt partitioning.https://help.ubuntu.com/community/DiskSpace & http://askubuntu.com/questions/743095/how-to-prepare-a-disk-on-an-efi-based-pc-for-ubuntu – oldfred Feb 08 '17 at 22:01
  • 1
    It seems you do indeed need to format the drive, but also note that once the drive has been formatted and has a filesystem you will be able to mount that filesystem (partition) or it will be mounted automatically in /media/user/drive-name you can then use mv or rsync or the GUI to move files from wherever they are in your root filesystem to the external drive, like mv /home/zanna/playground/py/* /media/zanna/mydrive/py – Zanna Feb 09 '17 at 07:52
  • 1
    @Zanna Thanks, I think that did it. I opened the Disks program on my computer, formatted the 2TB drive, mounted it, and it seems like things are copied over there correctly. I didn't do extra partitioning, though. – ComputerScientist Mar 06 '17 at 22:34
  • Great stuff, glad you managed to get it working :) – Zanna Mar 06 '17 at 22:35

0 Answers0