Page MenuHomeDevCentral

Add a new hard disk on Dwellers to host Docker images and data
Closed, ResolvedPublic

Description

Following the T150 procedure, add a new 200G disk to

Current partitions are:

$ df -h | grep /dev/mapper
/dev/mapper/centos_dwellers-root   50G   50G  192M 100% /
/dev/mapper/centos_dwellers-home   47G   83M   47G   1% /home

If we reinstall the server, it could be interesting to assign a minimal space to the OS (20 to 50 Gb) and to attach the 200G Docker disk.

Event Timeline

dereckson created this task.Nov 28 2014, 14:19
dereckson updated the task description. (Show Details)
dereckson raised the priority of this task from to Unbreak Now!.
dereckson claimed this task.
dereckson added a project: Servers.
dereckson added a subscriber: dereckson.

Stormshear. Done. Transcript available at P18. We have fully assigned our To of data to Dwellers and Ysul with this task.

Dwellers. Available as /dev/sdb, journalctl kernel log about the addition available as P19.

Nov 28 15:47:46 dwellers.nasqueron.org kernel: vmw_pvscsi: msg type: 0x0 - MSG RING: 1/0 (5)
Nov 28 15:47:46 dwellers.nasqueron.org kernel: vmw_pvscsi: msg: device added at scsi0:1:0
Nov 28 15:47:46 dwellers.nasqueron.org kernel: scsi 2:0:1:0: Direct-Access VMware Virtual disk 1.0 PQ: 0 ANSI: 2
Nov 28 15:47:46 dwellers.nasqueron.org kernel: sd 2:0:1:0: [sdb] 419430400 512-byte logical blocks: (214 GB/200 GiB)
Nov 28 15:47:46 dwellers.nasqueron.org kernel: sd 2:0:1:0: [sdb] Write Protect is off
Nov 28 15:47:46 dwellers.nasqueron.org kernel: sd 2:0:1:0: [sdb] Mode Sense: 61 00 00 00
Nov 28 15:47:46 dwellers.nasqueron.org kernel: sd 2:0:1:0: [sdb] Cache data unavailable
Nov 28 15:47:46 dwellers.nasqueron.org kernel: sd 2:0:1:0: [sdb] Assuming drive cache: write through
Nov 28 15:47:46 dwellers.nasqueron.org kernel: sd 2:0:1:0: Attached scsi generic sg2 type 0
Nov 28 15:47:46 dwellers.nasqueron.org kernel: sd 2:0:1:0: [sdb] Cache data unavailable
Nov 28 15:47:46 dwellers.nasqueron.org kernel: sd 2:0:1:0: [sdb] Assuming drive cache: write through
Nov 28 15:47:46 dwellers.nasqueron.org kernel: sdb: unknown partition table
Nov 28 15:47:46 dwellers.nasqueron.org kernel: sd 2:0:1:0: [sdb] Cache data unavailable
Nov 28 15:47:46 dwellers.nasqueron.org kernel: sd 2:0:1:0: [sdb] Assuming drive cache: write through
Nov 28 15:47:46 dwellers.nasqueron.org kernel: sd 2:0:1:0: [sdb] Attached SCSI disk

dereckson added a comment.EditedNov 28 2014, 20:51

Procedured followed from http://bencane.com/2011/12/19/creating-a-new-filesystem-with-fdisk-lvm-and-mkfs/ and https://github.com/docker/docker/issues/3127:

Stop Docker and unmount former partitions

$ kill -9 `cat /var/run/docker.pid`
$ cd /var/lib/docker/devicemapper/mnt
$ umount ./*

Create and mount new partition

$ fdisk /dev/sdb
    # Creates new primary partition sdb1
$ pvcreate /dev/sdb1
$ vgextend centos_dwellers /dev/sdb1
$ lvcreate -l 100%FREE -n wharf centos_dwellers
$ mkfs -t xfs /dev/centos_dwellers/wharf
$ echo "/dev/mapper/centos_dwellers-wharf /wharf xfs defaults 1 2" >> /etc/fstab
$ mount /wharf

Move Docker data

$ mv /data /wharf/data
$ mv /var/lib/docker /wharf/docker
$ ln -s /wharf/data /data
$ ln -s /wharf/docker /var/lib/docker
$ echo 'OPTIONS="--selinux-enabled -g /wharf/docker"' > /etc/sysconfig/docker

Restart Docker

$ systemctl start docker
$ docker start ecstatic_heisenberg
dereckson closed this task as Resolved.Nov 28 2014, 20:51

Configuration superseded by T553: Docker now directly manages this disk.