Skip to content

Instantly share code, notes, and snippets.

@flaccid
Created June 26, 2015 05:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save flaccid/e23555fccdd708fa6ac6 to your computer and use it in GitHub Desktop.
Save flaccid/e23555fccdd708fa6ac6 to your computer and use it in GitHub Desktop.
docker-storage-setup fails to use /dev/xvd0, uses /dev/xda1 instead
# sh -x ./docker-storage-setup.sh
+ set -e
+ POOL_LV_NAME=docker-pool
+ DATA_LV_NAME=docker-pool
+ META_LV_NAME=docker-poolmeta
+ DOCKER_STORAGE=/etc/sysconfig/docker-storage
+ '[' -e /usr/lib/docker-storage-setup/docker-storage-setup ']'
+ source /usr/lib/docker-storage-setup/docker-storage-setup
++ DATA_SIZE=60%FREE
++ CHUNK_SIZE=512K
++ GROWPART=false
++ AUTO_EXTEND_POOL=yes
++ POOL_AUTOEXTEND_THRESHOLD=60
++ POOL_AUTOEXTEND_PERCENT=20
+ '[' -e /etc/sysconfig/docker-storage-setup ']'
+ source /etc/sysconfig/docker-storage-setup
++ DEVS=/dev/xvd0
++ VG=docker-vg
++ SETUP_LVM_THIN_POOL=yes
+ is_old_data_meta_mode
+ '[' '!' -f /etc/sysconfig/docker-storage ']'
+ grep -e '^DOCKER_STORAGE_OPTIONS=.*dm\.datadev' -e '^DOCKER_STORAGE_OPTIONS=.*dm\.metadatadev' /etc/sysconfig/docker-storage
+ return 1
++ awk '$2 ~ /^\/$/ && $1 !~ /rootfs/ { print $1 }' /proc/mounts
+ ROOT_DEV=/dev/xvda1
++ lvs --noheadings -o vg_name /dev/xvda1
++ sed -e 's/^ *//' -e 's/ *$//'
Volume group "xvda1" not found
Cannot process volume group xvda1
+ ROOT_VG=
++ pvs --noheadings -o pv_name,vg_name
++ awk '$2 ~ /^$/ { print $1 }'
+ ROOT_PVS=
+ VG_EXISTS=
+ '[' -z docker-vg ']'
++ vgs --noheadings -o vg_name
+ '[' -z /dev/xvd0 ']'
+ '[' -n /dev/xvd0 ']'
+ create_disk_partitions
+ for dev in '$DEVS'
+ expr match /dev/xvd0 '.*[0-9]'
9
+ echo 'Partition specification unsupported at this time.'
Partition specification unsupported at this time.
+ exit 1
@flaccid
Copy link
Author

flaccid commented Jun 26, 2015

Ok so I accidentally used /dev/xvd0 when its actually /dev/xvdo.

However this is now the situation:

# sh ./docker-storage-setup.sh --force
  Volume group "xvda1" not found
  Cannot process volume group xvda1
0
Checking that no-one is using this disk right now ...
OK

Disk /dev/xvdo: 130 cylinders, 255 heads, 63 sectors/track
sfdisk:  /dev/xvdo: unrecognized partition table type

Old situation:
sfdisk: No partitions found

New situation:
sfdisk: Warning: The partition table looks like it was made
  for C/H/S=*/139/8 (instead of 130/255/63).
For this listing I'll assume that geometry.

Units: sectors of 512 bytes, counting from 0

   Device Boot    Start       End   #sectors  Id  System
/dev/xvdo1          2048   2097151    2095104  8e  Linux LVM
sfdisk:                 start: (c,h,s) expected (1,117,1) found (0,32,33)

sfdisk:                 end: (c,h,s) expected (1023,138,8) found (130,138,8)

/dev/xvdo2             0         -          0   0  Empty
/dev/xvdo3             0         -          0   0  Empty
/dev/xvdo4             0         -          0   0  Empty
Warning: partition 1 does not end at a cylinder boundary
Warning: no primary partition is marked bootable (active)
This does not matter for LILO, but the DOS MBR will not boot this disk.
end of partition 1 has impossible value for cylinders: 130 (should be in 0-129)
sfdisk: I don't like these partitions - nothing changed.
(If you really want this, use the --force option.)
# lvs
[root@10 tmp]# cat /etc/sysconfig/docker-storage
# This file may be automatically generated by an installation program.

# By default, Docker uses a loopback-mounted sparse file in
# /var/lib/docker.  The loopback makes it slower, and there are some
# restrictive defaults, such as 100GB max storage.

# If your installation did not set a custom storage for Docker, you
# may do it below.

# Example: Use a custom pair of raw logical volumes (one for metadata,
# one for data).
# DOCKER_STORAGE_OPTIONS = --storage-opt dm.metadatadev=/dev/mylogvol/my-docker-metadata --storage-opt dm.datadev=/dev/mylogvol/my-docker-data

DOCKER_STORAGE_OPTIONS=

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment