Created
December 31, 2015 01:21
-
-
Save masato/ccb665fa2052e181a843 to your computer and use it in GitHub Desktop.
IDCFクラウドのDebian Jessieにディスクを追加してDockerのディレクトリを移動する ref: http://qiita.com/masato/items/9ed5d4aa5d3995395c87
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ cat /etc/debian_version | |
8.2 | |
$ cat /etc/os-release | |
PRETTY_NAME="Debian GNU/Linux 8 (jessie)" | |
NAME="Debian GNU/Linux" | |
VERSION_ID="8" | |
VERSION="8 (jessie)" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ df -h | |
Filesystem Size Used Avail Use% Mounted on | |
/dev/sda1 15G 12G 2.7G 81% / | |
udev 10M 0 10M 0% /dev | |
tmpfs 1.6G 110M 1.5G 7% /run | |
tmpfs 4.0G 740K 4.0G 1% /dev/shm | |
tmpfs 5.0M 0 5.0M 0% /run/lock | |
tmpfs 4.0G 0 4.0G 0% /sys/fs/cgroup |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ sudo cp -ip /etc/fstab{,.`date +%Y%m%d`} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ sudo vi /etc/fstab | |
# <file system> <mount point> <type> <options> <dump> <pass> | |
UUID=18de9747-f69a-4f98-a80a-3d4b77145eaa / ext4 errors=remount-ro 0 1 | |
/dev/sr0 /media/cdrom0 udf,iso9660 user,noauto 0 0 | |
UUID=af1e6cc8-6184-4642-9a0d-5ac917e1d9d3 /media/data ext4 defaults 0 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ sudo mount -a | |
$ df -h | |
Filesystem Size Used Avail Use% Mounted on | |
/dev/sda1 15G 12G 2.7G 81% / | |
udev 10M 0 10M 0% /dev | |
tmpfs 1.6G 8.5M 1.6G 1% /run | |
tmpfs 4.0G 0 4.0G 0% /dev/shm | |
tmpfs 5.0M 0 5.0M 0% /run/lock | |
tmpfs 4.0G 0 4.0G 0% /sys/fs/cgroup | |
/dev/sdb1 99G 60M 94G 1% /media/data |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ sudo systemctl stop docker | |
$ sudo systemctl status docker | |
● docker.service - Docker Application Container Engine | |
Loaded: loaded (/lib/systemd/system/docker.service; enabled) | |
Active: inactive (dead) since 木 2015-12-31 06:29:44 JST; 14s ago | |
Docs: https://docs.docker.com | |
Process: 521 ExecStart=/usr/bin/docker daemon -H fd:// $DOCKER_OPTS (code=exited, status=0/SUCCESS) | |
Main PID: 521 (code=exited, status=0/SUCCESS) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ sudo mkdir /media/data/docker | |
$ sudo rsync -aXS /var/lib/docker/. /media/data/docker/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ sudo du -sch /var/lib/docker/* | |
9.6G /var/lib/docker/aufs | |
6.8M /var/lib/docker/containers | |
11M /var/lib/docker/graph | |
8.0K /var/lib/docker/linkgraph.db | |
72K /var/lib/docker/network | |
4.0K /var/lib/docker/repositories-aufs | |
4.0K /var/lib/docker/tmp | |
4.0K /var/lib/docker/trust | |
447M /var/lib/docker/volumes | |
11G total | |
$ sudo du -sch /media/data/docker/* | |
9.9G /media/data/docker/aufs | |
6.8M /media/data/docker/containers | |
11M /media/data/docker/graph | |
8.0K /media/data/docker/linkgraph.db | |
68K /media/data/docker/network | |
4.0K /media/data/docker/repositories-aufs | |
4.0K /media/data/docker/tmp | |
4.0K /media/data/docker/trust | |
443M /media/data/docker/volumes | |
11G total |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ sudo mv /var/lib/docker /var/lib/docker.bak | |
$ sudo mkdir /var/lib/docker |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ sudo mount -o bind /media/data/docker /var/lib/docker | |
$ sudo du -sch /var/lib/docker/* | |
9.9G /var/lib/docker/aufs | |
6.8M /var/lib/docker/containers | |
11M /var/lib/docker/graph | |
8.0K /var/lib/docker/linkgraph.db | |
68K /var/lib/docker/network | |
4.0K /var/lib/docker/repositories-aufs | |
4.0K /var/lib/docker/tmp | |
4.0K /var/lib/docker/trust | |
443M /var/lib/docker/volumes | |
11G total |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ df -ha | |
Filesystem Size Used Avail Use% Mounted on | |
... | |
/dev/sdb1 99G 11G 83G 12% /media/data | |
/dev/sdb1 99G 11G 83G 12% /var/lib/docker |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ sudo vi /etc/fstab | |
/media/data/docker /var/lib/docker none bind 0 0 | |
$ sudo mount -a |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ sudo reboot |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ sudo systemctl start docker | |
sudo systemctl status docker | |
● docker.service - Docker Application Container Engine | |
Loaded: loaded (/lib/systemd/system/docker.service; enabled) | |
Active: active (running) since 木 2015-12-31 06:44:08 JST; 5s ago | |
Docs: https://docs.docker.com | |
Main PID: 1060 (docker) | |
CGroup: /system.slice/docker.service | |
└─1060 /usr/bin/docker daemon -H fd:// --cluster-store=consul://lo... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ sudo rm -r /var/lib/docker.bak/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ sudo fdisk -l | |
Disk /dev/sdb: 100 GiB, 107374182400 bytes, 209715200 sectors |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ sudo fdisk /dev/sdb |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ sudo fdisk -l | |
... | |
Device Boot Start End Sectors Size Id Type | |
/dev/sdb1 2048 209715199 209713152 100G 83 Linux |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ df -T | |
Filesystem Type 1K-blocks Used Available Use% Mounted on | |
/dev/sda1 ext4 15348720 11734892 2811116 81% / | |
udev devtmpfs 10240 0 10240 0% /dev | |
tmpfs tmpfs 1638236 8672 1629564 1% /run | |
tmpfs tmpfs 4095588 0 4095588 0% /dev/shm | |
tmpfs tmpfs 5120 0 5120 0% /run/lock | |
tmpfs tmpfs 4095588 0 4095588 0% /sys/fs/cgroup |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ sudo mkfs.ext4 /dev/sdb1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ sudo mkdir /media/data |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ sudo blkid /dev/sdb1 | |
/dev/sdb1: UUID="af1e6cc8-6184-4642-9a0d-5ac917e1d9d3" TYPE="ext4" PARTUUID="07a7e924-01" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment