Kickstart install: what disk name should I tell Anaconda to use? (Installer running from USB thumb drive.)

anacondacentos7kickstart

I'm running the CentOS 7.6 installer from a USB thumb drive using a kickstart file. I'm installing to a system that has only one disk.

In the bash shell of the installer, my system's hard drive shows up as /dev/sdb. The installer sees the USB drive it booted from as /dev/sda.
Should I be telling Anaconda to use /dev/sdb? Seems like a bad idea.

Best Answer

You cannot use /dev/sda /dev/sdb in there because you have no idea what your kernel is going to identify your disks as. same machine booted twice could show the same disk with a different dev name.

The only efficient current way to install linux that way would be to specify either a UUID or a LABEL for the disk that you are installing (or customize the installation)

The solution is somewhat described at https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/7/html/installation_guide/chap-anaconda-boot-options#list-boot-options-sources

basically with either UUID=(uuid of your USB drive) or LABEL=(the label of your usb drive) You're gonna need to refer to your stage2/repo and where to find the ks file this way(you didn't ask info about your cmd append line, so I skip this)

In your kickstart you call it this way

    install
    harddrive --partition=LABEL=YOURUSBLABEL --dir=/

assuming your USB is labelled as YOURUSBLABEL and your repo is in /

Additionally FYI:

IF you're installing this via USB always, in your kickstart add:

    ignoredisk --drives=/dev/disk/by-path/*usb*

so you avoid wiping your usb drive by accident. But this will throw an error with anaconda if you don't have any USB inserted, there's going to be a --nonfatal that's going to be added soon into it, but I'm not sure of when... so until then only use it IF you're installing only via USB or if you have other possible USB in the machine that you don't want wiped.

Related Topic