How do I migrate data to another disk?


#1

Hi,

I’m in China and use Aliyun to host discourse. I’ve purchased a 20G system disk by default but after 2 years the disk is almost full now.

Since Aliyun doesn’t support expanding system disk, I have to purchase another bigger data disk and migrate discourse to that disk and do some necessary reconfiguration.

Do you have a detailed step by step tutorial for doing that? And BTW, under my circumstance, do you have better suggestions?

Thanks,

Yinglu


(Matt Palmer) #2

There’s nothing special about Discourse from a filesystem organisation perspective. I’d recommend asking Aliyun for a generic guide on migrating an existing system to use a bigger data disk.


(Sam Saffron) #3

The answer here depends on which data is eating up the 20G.

How big is a full discourse backup for your instance?

Have your ran ./launcher cleanup lately?

If Docker images are eating up all the space you can reconfigure docker to have its stuff live on the bigger disk.

If DB/uploads are eating space you can reconfigure your app.yml file to point to a new location and move the files there.


#4

Hi,

Thanks for helping.

I have 2 backups at the same time and each takes approx 450 MB, which is no big deal;

I have run ./launcher cleanup for several times, before and after I rebuilt the app;

And according to the control panel, the uploads take only 226 MB.

For the docker images, I don’t know how can I figure out their spaces. Are there any simple commands I can use?

Thanks,

Yinglu


(Sam Saffron) #5

use ncdu as root on /


#6

Hi,

It turns out /var/lib/docker/aufs/diff is taking much space:

ncdu 1.10 ~ Use the arrow keys to navigate, press ? for help                                                                                                  
--- /var/lib/docker/aufs/diff --------------------------------------------------------------------------------------------------------------------------------
                               /..
  932.1MiB 32.620 [##########] /e9d5dc9fc926d8dca61dbd2a80bea224ccdf0a6efea66db47e00336ceb6c964c                                                              
  911.4MiB 41.300 [######### ] /881eb43cc61a09393ded2b4f054fc303d8d156e6b64c248231fc3c04608e8c77
  911.4MiB 41.308 [######### ] /8672072b5b7b1dbdac3c2f0f9eb9bf82d096d9e4cb425c10cfe1ff2f4ba798b4
  634.2MiB 25.484 [######    ] /45ca71ffb140a19242a23ca86f5c2692f02dda6132f04c6fb045cf94bccf87fe
  190.4MiB 11.857 [##        ] /80fda949239dc7ceff80d32388b53c896fe216fc6f5ad055d7d8a4bc71504e52
   55.8MiB  2.880 [          ] /1d51fb9177078978732b41363aeb763fe2edbbb3bf2ba666bb588bbd28e37933
    5.8MiB    637 [          ] /cbb3e5e0dd10df32a25b7126f14a4b36bfb7f4ff5a42912ef150e359718ba3c1
    3.5MiB    150 [          ] /a8de66328a2b990d73803a92dac2a8a82219d98f97185a36147605a90503ebba
   20.0KiB     11 [          ] /a8de66328a2b990d73803a92dac2a8a82219d98f97185a36147605a90503ebba-init
   12.0KiB      1 [          ] /53dbefc5a99d6fcfe697a89fb21098653989031334a5cfd010eb81d15463f769
e   4.0KiB        [          ] /4acebcafd9f8997c37b7d1baeee50bb75c2a00a341c90cb18e957cf861c6e4e0
e   4.0KiB        [          ] /40175514038b69c48928e43ea8005370e46781eda1cac4b189e55c8a067706b2
e   4.0KiB        [          ] /3c6f56c3bde877ba872e91106bc2eee028718646bcc28213abf46f409b8a8293

According to this post, seems that /launcher cleanup should delete those old containers, but in fact it didn’t.

And here’s the output of docker ps:

root@iosre:~# docker ps
CONTAINER ID        IMAGE                 COMMAND             CREATED             STATUS              PORTS                                         NAMES
71ce3080e00f        local_discourse/app   "/sbin/boot"        19 hours ago        Up 19 hours         0.0.0.0:2222->22/tcp, 0.0.0.0:30080->80/tcp   app
root@iosre:~# 

Should I delete those containers manually?

Thanks,

Yinglu


(Sam Saffron) #7

What does docker ps -a return?


#8

Same:

root@iosre:/var# docker ps -a
CONTAINER ID        IMAGE                 COMMAND             CREATED             STATUS              PORTS                                         NAMES
71ce3080e00f        local_discourse/app   "/sbin/boot"        19 hours ago        Up 19 hours         0.0.0.0:2222->22/tcp, 0.0.0.0:30080->80/tcp   app
root@iosre:/var#