rancher / os

Tiny Linux distro that runs the entire OS as Docker containers
https://rancher.com/docs/os/v1.x/en/
Apache License 2.0
6.45k stars 656 forks source link

Rancher 1.0.0 Cannot resize root partition. #1809

Open joehumphries opened 7 years ago

joehumphries commented 7 years ago

RancherOS Version: 1.0.0

Where are you running RancherOS? Openstack

On Openstack, RancherOS used only 8G of the 60G allocated, normally after boot we resize the partition using fdisk, and then reboot + resize. This all worked fine...

However on 1.0.0 after the resize the machine refused to boot up, I cannot even see the logs via Openstack to diagnose the issue.

Thanks

SvenDowideit commented 7 years ago

@joehumphries to make sure we're not doing things differently - how are you doing the fdisk and resize? manually? what are the specific commands (I'll test tomorrow, but the more detail I have the quicker things go)

joehumphries commented 7 years ago

Sure: commands are:

sudo fdisk /dev/vda (or whatever)
d
n
p
take all defaults
w
sudo reboot now

I doesn't come back up....

Normally comes back up, then I do:

sudo resize2fs /dev/vda1

This has worked on 100+ installs :) on 0.7.1.. we are now trying 1.0.0

Thanks

SvenDowideit commented 7 years ago

@joehumphries yup - I think doing that breaks it for me too - when I use https://docs.rancher.com/os/configuration/resizing-device-partition/ my qemu vm continues to work - does our built in magic work for you?

joehumphries commented 7 years ago

I will have a go, I admittedly did not read that part of the docs ;)

Thanks I will update.

lfsperotto commented 7 years ago

I saw the instructions on the page https://docs.rancher.com/os/configuration/resizing-device-partition/ and put the settings on /var/lib/rancher/conf/cloud-config.d/user_config.yml. This settings worked perfectly once, but after the second reboot it didn't work. I removed the /var/lib/rancher/resizefs.done file and on the next reboot the "resize" occurred normally. Is that correct? I need to delete the /var/lib/rancher/resizefs.done file before rebooting?

SvenDowideit commented 7 years ago

Yes @lfsperotto you're right, we haven't documented that. We don't want to attempt to resize the fs on every boot, and for most users they only need it the first time, so we lay down a doneStampfile whenever its run successfully, and skip the resize code when it exists.

SvenDowideit commented 7 years ago

1828

EugenMayer commented 7 years ago

this is still an issue. When resizing the normal linux way ( fdisk delete, create, write, resizefs ) the whole partition is corrupted. you can recover it by deleting the partition again using fdisk, then using testdisk /dev/device to restore the partition table.

whatever changed in rancher 1.0.0 @SvenDowideit should be made transparent, since it is no longer matching any known system. Please explain, why this resizing is no longer working, how to work around that or at least, explain the different paths. Thanks

omniproc commented 6 years ago

yep. same here. besides that the cloud-config option mentioned here https://rancher.com/docs/os/v1.x/en/configuration/resizing-device-partition/ doesn't seem to do anything.

In my case I deploy to vSphere using docker-machine with the vsphere driver. All cloud-config settings are applied but the resize param is ignored. The lock file is not created as well. Another reboot doesn't fix anything so this is not only a issue with the initial boot process.

AciDCooL commented 6 years ago

Ok after some testing here things summarized;

Seems to me that there is something wrong after user_config.yml is applied, or the way it is applied differs from cloud-config.yml