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.44k stars 655 forks source link

rancher.autoformat tries to format /dev/sda1 instead of /dev/sda #2959

Open AntonSmolkov opened 4 years ago

AntonSmolkov commented 4 years ago

RancherOS Version: (ros os version) 1.5.4 Where are you running RancherOS? (docker-machine, AWS, GCE, baremetal, etc.) Hyper-v virtual machine

Error log:

[            ] cloud-init-execute:info: Running cloud-init-execute: pre-console=true, console=false
WARN: unknown label
failed [sfd_dump:1] sfdisk --unit=S --dump /dev/sda
sfdisk: /dev/sda: does not contain a recognized partition table
FAILED: failed to dump sfdisk info for /dev/sda
resize2fs 1.43.9 (8-Feb-2018)
open: No such file or directory while opening /dev/sda1
[            ] cloud-init-execute:error: Failed to resize /dev/sda: exit status 1
[            ] cloud-init-execute:info: Running cloud-init-execute: pre-console=true, console=false
WARN: unknown label
failed [sfd_dump:1] sfdisk --unit=S --dump /dev/sda
sfdisk: /dev/sda: does not contain a recognized partition table
FAILED: failed to dump sfdisk info for /dev/sda
resize2fs 1.43.9 (8-Feb-2018)
open: No such file or directory while opening /dev/sda1
[            ] cloud-init-execute:error: Failed to resize /dev/sda: exit status 1
[            ] cloud-init-execute:info: Running cloud-init-execute: pre-console=true, console=false
WARN: unknown label
failed [sfd_dump:1] sfdisk --unit=S --dump /dev/sda
sfdisk: /dev/sda: does not contain a recognized partition table
FAILED: failed to dump sfdisk info for /dev/sda
resize2fs 1.43.9 (8-Feb-2018)
open: No such file or directory while opening /dev/sda1
[            ] cloud-init-execute:error: Failed to resize /dev/sda: exit status 1

Modified global.cfg inside iso:

APPEND rancher.autologin=tty1 rancher.autologin=ttyS0 rancher.autologin=ttyS1 console=tty1 console=ttyS0 console=ttyS1 printk.devkmsg=on panic=10 rancher.state.dev=LABEL=RANCHER_STATE rancher.state.autoformat=[/dev/sda] rancher.cloud_init.datasources=[url:https://xxxxx.ru/devops/public/raw/master/local_hyperv_cloudconfig.yaml]

local_hyperv_cloudconfig.yaml:

rancher:
  docker:
   engine: docker-19.03.4
  #Necessary for kubernetes nodes survival between reboots. 
  #Kuberntes keys live inside map to console container (/etc/kubernetes). Only non-default console types are persistent.
  #Also necessary for longhorn. See script below. 
  console: ubuntu
  sysctl:
    #Necessary for elk
    vm.max_map_count: 262144
  #Resize automatically in case of vhd resize
  resize_device: /dev/sda
ssh_authorized_keys:
 - ssh-rsa 

manual resize2fs /dev/sda works well