How to Gitlab バージョンを上げる話

速攻ですが、さっき書いているときにバージョンが古かったのであげようとして引っかかりましたw

apt-get upgrade


Unpacking gitlab-ee (14.3.2-ee.0) over (14.2.4-ee.0) ...
dpkg: error processing archive /var/cache/apt/archives/gitlab-ee_14.3.2-ee.0_amd64.deb (--unpack):
 cannot copy extracted data for './opt/gitlab/embedded/service/gitlab-rails/doc/user/project/clusters/runbooks/img/sample-runbook.png' to '/opt/gitlab/embedded/service/gitlab-rails/doc/user/project/clusters/runbooks/img/sample-runbook.png.dpkg-new': failed to write (No space left on device)
No apport report written because the error message indicates a disk full error
                                                                              dpkg-deb: error: paste subprocess was killed by signal (Broken pipe)
Errors were encountered while processing:
 /var/cache/apt/archives/gitlab-ee_14.3.2-ee.0_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

はい、おかしいです;;

ってか…
No space left on deviceディスク容量なしって!w

wataru@gitlab:~$ df -h
Filesystem                         Size  Used Avail Use% Mounted on
udev                               3.9G     0  3.9G   0% /dev
tmpfs                              797M  5.5M  791M   1% /run
/dev/mapper/ubuntu--vg-ubuntu--lv  8.8G  7.2G  1.3G  86% /
tmpfs                              3.9G   28K  3.9G   1% /dev/shm
tmpfs                              5.0M     0  5.0M   0% /run/lock
tmpfs                              3.9G     0  3.9G   0% /sys/fs/cgroup
/dev/loop1                          62M   62M     0 100% /snap/core20/1081
/dev/loop0                          55M   55M     0 100% /snap/core18/1880
/dev/loop3                          72M   72M     0 100% /snap/lxd/16099
/dev/loop5                          68M   68M     0 100% /snap/lxd/21545
/dev/loop2                          56M   56M     0 100% /snap/core18/2128
/dev/loop7                          33M   33M     0 100% /snap/snapd/12883
/dev/loop6                          33M   33M     0 100% /snap/snapd/13170
/dev/sdb1                           49G  3.3G   44G   7% /var/opt/gitlab
/dev/loop4                          62M   62M     0 100% /snap/core20/1169
/dev/sda2                          976M  299M  610M  33% /boot
192.168.1.203:/backups/gitlab      7.1T  3.4T  3.8T  47% /var/opt/gitlab/backups
tmpfs                              797M     0  797M   0% /run/user/1000

/は1.3GBあるんだけれどもね… (容量アップはこちら)

14.2.4 → 14.3.2に上げるのに… なんかありますw

どうするのか!

普通に通りましたw

容量かよ!w

wataru@gitlab:~$ sudo apt list gitlab-ee
Listing... Done
gitlab-ee/focal,now 14.3.2-ee.0 amd64 [installed]

memoメモ程度に容量アップ!

とりあえず、vmwareにてドライブの容量を適当に50GB!

wataru@gitlab:~$ sudo parted /dev/sda
[sudo] password for wataru: 
GNU Parted 3.3
Using /dev/sda
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) p                                                                
Model: ATA VBOX HARDDISK (scsi)
Disk /dev/sda: 53.8GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags: 

Number  Start   End     Size    File system  Name  Flags
 1      1049kB  2097kB  1049kB                     bios_grub
 2      2097kB  1076MB  1074MB  ext4
 3      1076MB  10.7GB  9661MB
(parted) resizepart 3 53.8GB
(parted) print                                                            
Model: ATA VBOX HARDDISK (scsi)
Disk /dev/sda: 53.8GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags: 

Number  Start   End     Size    File system  Name  Flags
 1      1049kB  2097kB  1049kB                     bios_grub
 2      2097kB  1076MB  1074MB  ext4
 3      1076MB  53.8GB  52.7GB

wataru@gitlab:~$ sudo pvdisplay /dev/sda3
  --- Physical volume ---
  PV Name               /dev/sda3
  VG Name               ubuntu-vg
  PV Size               <9.00 GiB / not usable 0   
  Allocatable           yes (but full)
  PE Size               4.00 MiB
  Total PE              2303
  Free PE               0
  Allocated PE          2303
  PV UUID               j7crK9-lKch-Pahn-5fMv-NTuw-cGm3-EX6Jw1

wataru@gitlab:~$ sudo pvresize  /dev/sda3
  Physical volume "/dev/sda3" changed
  1 physical volume(s) resized or updated / 0 physical volume(s) not resized
wataru@gitlab:~$ sudo pvdisplay /dev/sda3
  --- Physical volume ---
  PV Name               /dev/sda3
  VG Name               ubuntu-vg
  PV Size               49.06 GiB / not usable 16.50 KiB
  Allocatable           yes 
  PE Size               4.00 MiB
  Total PE              12560
  Free PE               10257
  Allocated PE          2303
  PV UUID               j7crK9-lKch-Pahn-5fMv-NTuw-cGm3-EX6Jw1

wataru@gitlab:~$ sudo lvextend -l +100%FREE /dev/ubuntu-vg/ubuntu-lv
  Size of logical volume ubuntu-vg/ubuntu-lv changed from <9.00 GiB (2303 extents) to 49.06 GiB (12560 extents).
  Logical volume ubuntu-vg/ubuntu-lv successfully resized.

wataru@gitlab:~$ sudo resize2fs /dev/mapper/ubuntu--vg-ubuntu--lv 
resize2fs 1.45.5 (07-Jan-2020)
Filesystem at /dev/mapper/ubuntu--vg-ubuntu--lv is mounted on /; on-line resizing required
old_desc_blocks = 2, new_desc_blocks = 7
The filesystem on /dev/mapper/ubuntu--vg-ubuntu--lv is now 12861440 (4k) blocks long.

wataru@gitlab:~$ sudo fdisk -l /dev/sda
Disk /dev/sda: 50.7 GiB, 53758394368 bytes, 104996864 sectors
Disk model: VBOX HARDDISK   
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: 971AA00E-86D2-4A93-99D5-39DBE501F3D0

Device       Start       End   Sectors  Size Type
/dev/sda1     2048      4095      2048    1M BIOS boot
/dev/sda2     4096   2101247   2097152    1G Linux filesystem
/dev/sda3  2101248 104996830 102895583 49.1G Linux filesystem
wataru@gitlab:~$ df -h
Filesystem                         Size  Used Avail Use% Mounted on
udev                               3.9G     0  3.9G   0% /dev
tmpfs                              797M  5.4M  791M   1% /run
/dev/mapper/ubuntu--vg-ubuntu--lv   49G  7.2G   40G  16% /
tmpfs                              3.9G   28K  3.9G   1% /dev/shm
tmpfs                              5.0M     0  5.0M   0% /run/lock
tmpfs                              3.9G     0  3.9G   0% /sys/fs/cgroup
/dev/loop0                          62M   62M     0 100% /snap/core20/1081
/dev/loop1                          55M   55M     0 100% /snap/core18/1880
/dev/loop5                          68M   68M     0 100% /snap/lxd/21545
/dev/loop4                          56M   56M     0 100% /snap/core18/2128
/dev/loop6                          33M   33M     0 100% /snap/snapd/12883
/dev/loop3                          72M   72M     0 100% /snap/lxd/16099
/dev/loop7                          33M   33M     0 100% /snap/snapd/13170
/dev/sdb1                           49G  3.3G   44G   7% /var/opt/gitlab
/dev/loop2                          62M   62M     0 100% /snap/core20/1169
/dev/sda2                          976M  299M  610M  33% /boot
192.168.1.203:/backups/gitlab      7.1T  3.4T  3.8T  47% /var/opt/gitlab/backups
tmpfs                              797M     0  797M   0% /run/user/1000