CentOS installation on new machine stuck on "Failed to start switch root"

General support questions
Locked
kusohead
Posts: 1
Joined: 2017/02/06 22:25:59

CentOS installation on new machine stuck on "Failed to start switch root"

Post by kusohead » 2017/02/06 22:31:10

Hi there,
I have recently built my first computer and I have been having trouble installing CentOS.
I have downloaded the CentOS "DVD ISO" from https://www.centos.org/download/
And then I used unetbootin-windows-625 to write the ISO to a reformatted 32GB USB flash drive.
I then powered up my new computer and booted using the USB. From the UNetbootin menu, I selected "Install CentOS Linux 7".
The installation proceeded seemingly successfully until it stopped at the message:

Code: Select all

"[FAILED] Failed to start Switch Root.
See 'systemctl status initrd-switch-root.service' for details.
Warning: /dev/root does not exist"

And if I use the command "systemctl status initrd-switch-root.service", I get the following traceback:

Code: Select all

initrd-switch-root.service - Switch Root
Loaded: loaded (/usr/lib/systemd/system/initrd-switch=root.service; static; vendor preset: enabled)
Active: failed (Result: exit-code) since Tue 2017-02-07 04:50:52 UTC; 3min 47s ago
Process: 4097 ExecStart=/usr/bin/systemctl --no-block --force switch-root /sys
Main PID: 4097 (code=exited, status=1/FAILURE)

Feb 07 04:50:52 localhost systemd[1]: Starting Switch Root...
Feb 07 04:50:52 localhost  systemctl[4097] Failed to switch root: Specified ....
Feb 07 04:50:52 localhost systemd[1]: initrd-switch-root.service: main proc...RE
Feb 07 04:50:52 localhost systemd[1]: Failed to start Switch Root.
Feb 07 04:50:52 localhost systemd[1]:  Unit initrd-switch-root.service enter...e.
Feb 07 04:50:52 localhost systemd[1]: Triggering OnFailure= dependencies of...e.
Feb 07 04:50:52 localhost systemd[1]: initrd-switch-root.service failed.

And my new computer's specs:

Code: Select all

Intel Core i7-5820K 3.3GHz 6-Core Processor
ASRock X99 Extreme4 ATX LGA2011-3 Motherboard
Corsair Vengeance LPX 32GB (2 x 16GB) DDR4-3000 Memory
Western Digital Caviar Blue 1TB 3.5" 7200RPM Internal Hard Drive
Palit GeForce GTX 1050 2GB StormX Video Card
EVGA 100-W1-0500-K3 - 500W 80 Plus Power Supply (100-W1-0500-K3)
Thermaltake 14cm Frio Silent Universal CPU Cooler Fan

Does anyone know what could potentially be the issue here? It would be greatly appreciated if someone can help me to solve this issue.

Thanks in advance!

User avatar
TrevorH
Site Admin
Posts: 33219
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: CentOS installation on new machine stuck on "Failed to start switch root"

Post by TrevorH » 2017/02/06 23:41:43

Unfortunately unetbootin is on our list of "doesn't work" USB creation programs. http://wiki.centos.org/HowTos/InstallFromUSBkey
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

koios
Posts: 1
Joined: 2017/06/07 15:10:25

Re: CentOS installation on new machine stuck on "Failed to start switch root"

Post by koios » 2017/06/07 15:37:53

I came across the exact same error when I wanted to install CentOS-7-x86_64-LiveGNOME.iso.
However, in my case I didn't use unetbootin, I used grub2 (i.e. GNU GRUB version 2.02eta2-36ubuntu3.2) and I used grub2 for a multiboot usb stick (with CentOS-7-x86_64-LiveGNOME.iso one of the isos).

For completeness sake, here a description of my system (but I do not think system is relevant here):

System: Host: LIFEBOOK-S710 Kernel: 3.13.0-37-generic x86_64 (64 bit, gcc: 4.8.2)
Desktop: KDE 4.14.2 (Qt 4.8.6) Distro: Linux Mint 17.1 Rebecca
Machine: System: FUJITSU (portable) product: LIFEBOOK S710
Mobo: FUJITSU model: FJNB216 Bios: FUJITSU // Phoenix version: Version 1.07 date: 03/24/2010
CPU: Dual core Intel Core i3 CPU M 330 (-HT-MCP-) cache: 3072 KB flags: (lm nx sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx) bmips: 8513.24
Clock Speeds: 1: 933.00 MHz 2: 933.00 MHz 3: 1066.00 MHz 4: 1599.00 MHz
Graphics: Card: Intel Core Processor Integrated Graphics Controller bus-ID: 00:02.0
X.Org: 1.15.1 drivers: intel (unloaded: fbdev,vesa) Resolution: 1366x768@60.0hz
GLX Renderer: Mesa DRI Intel Ironlake Mobile GLX Version: 2.1 Mesa 10.1.3 Direct Rendering: Yes
Audio: Card: Intel 5 Series/3400 Series Chipset High Definition Audio driver: snd_hda_intel bus-ID: 00:1b.0
Sound: Advanced Linux Sound Architecture ver: k3.13.0-37-generic
Network: Card-1: Intel Centrino Advanced-N 6200 driver: iwlwifi ver: in-tree: bus-ID: 10:00.0
IF: wlan0 state: up mac: 00:23:14:4d:db:00
Card-2: Intel 82577LM Gigabit Network Connection driver: e1000e ver: 2.3.2-k port: 1840 bus-ID: 00:19.0
IF: eth0 state: down mac: 00:23:26:8c:ae:85
Drives: HDD Total Size: 160.0GB (65.1% used) 1: id: /dev/sda model: Hitachi_HTS54501 size: 160.0GB
Partition: ID: / size: 143G used: 98G (72%) fs: ext4 ID: swap-1 size: 4.08GB used: 0.00GB (0%) fs: swap
RAID: No RAID devices detected - /proc/mdstat and md_mod kernel raid module present
Sensors: System Temperatures: cpu: 49.0C mobo: N/A
Fan Speeds (in rpm): cpu: N/A
Info: Processes: 199 Uptime: 5 min Memory: 575.6/3751.1MB Runlevel: 2 Gcc sys: 4.8.4 Client: Shell inxi: 1.8.4

User avatar
TrevorH
Site Admin
Posts: 33219
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: CentOS installation on new machine stuck on "Failed to start switch root"

Post by TrevorH » 2017/06/07 16:02:25

First, the "Live" media are not intended to perform installations, they are for testing to see if you like CentOS or if it supports your hardware. They _can_ be installed but they basically just copy themselves to the hard disk exactly as-is and allow no customisation or package selection.

We do not support any modification of the iso images whether by the utility (a la unetbootin problems) or by the user. We do not support attempting to make them into multi-boot USB sticks. They are intended to be copied exactly as-is to a USB stick. Any attempt at modification almost always ends up causing problems like this.

Use the full DVD or the minimal 1611 iso images. Copy them to the entire USB stick using dd.
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

jtech
Posts: 2
Joined: 2017/12/07 19:18:05

Re: CentOS installation on new machine stuck on "Failed to start switch root"

Post by jtech » 2017/12/07 19:55:47

(My first post on this forum) Hello techs. I know this is not a new thread but I just want to add my 2¢ since I had a similar issue lately after rebooting a server for a kernel update. Somehow the `/etc/os-release` file went missing and I received the same `failing to switch root` error as described by the OP. The solution to it was to manually create the file with the active kernel information. In my case, it was a CloudLinux 7.4 server and the file I created only contains:

Code: Select all

NAME="CloudLinux"
VERSION="7.4 (Georgy Grechko)"
PRETTY_NAME="CloudLinux 7.4 (Georgy Grechko)"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:cloudlinuxL7.3.GA:server"
HOME_URL="https://www.cloudlinux.com/"
BUG_REPORT_URL="https://helpdesk.cloudlinux.com/"
I believe that I put `CPE_NAME="cpe:/o:cloudlinuxL7.4.GA:server"`, but it could have been updated by the system itself and I am not sure if that makes a difference or not. I hope this helps anyone who may encounter a similar issue while booting up Centos/RedHat.

Regards,

-JV
Last edited by jtech on 2017/12/07 21:35:53, edited 1 time in total.

User avatar
TrevorH
Site Admin
Posts: 33219
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: CentOS installation on new machine stuck on "Failed to start switch root"

Post by TrevorH » 2017/12/07 20:16:40

I didn't believe this so I tested it and it does indeed cause the system to drop into emergency mode but the message it issues is quite clear about what the problem is:
Dec 08 20:08:31 localhost.localdomain systemd[1]: Failed to switch root: Specified switch root path /sysroot does not seem to be an OS tree. os-release file is missing
To recover from this it's not necessary to have a valid file, it just has to exist so you can just

mount -o remount,rw /sysroot
cd /sysroot/etc
echo "" >os-release
mount -o remount,ro /sysroot
reboot

To get it valid afterwards, once it's booted correctly you can rm /etc/os-release && yum reinstall centos-release
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

jtech
Posts: 2
Joined: 2017/12/07 19:18:05

Re: CentOS installation on new machine stuck on "Failed to start switch root"

Post by jtech » 2017/12/07 21:44:18

Thank you, TrevorH, your solution is indeed much more elegant and quicker! :)

dalepres
Posts: 21
Joined: 2016/05/27 19:31:55

Re: CentOS installation on new machine stuck on "Failed to start switch root"

Post by dalepres » 2018/06/05 03:49:28

Same issue as above but when I try the mount command I get an error that states:

Code: Select all

mount: can't find /sysroot in /etc/fstab
I see a sysroot folder and can enter it but there's nothing in it.

/etc/os-release does exist and has this contents:

Code: Select all

NAME="dracut"
VERSION="7 (Core) dracut-033-463.el7"
ID=dracut
VERSION_ID=033-463.el7
PRETTY_NAME="CentOS Linux 7 (Core) dracut-033-463.el7 (Initramfs)"
ANSI_COLOR="0;34"
Any thoughts?

ranshalit
Posts: 49
Joined: 2015/12/28 17:01:59

Re: CentOS installation on new machine stuck on "Failed to start switch root"

Post by ranshalit » 2019/08/13 10:06:30

I have the same issue.
Just copied one machine to another (rsync -avxHAX )....
Any idea how to resolve it ?

User avatar
TrevorH
Site Admin
Posts: 33219
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: CentOS installation on new machine stuck on "Failed to start switch root"

Post by TrevorH » 2019/08/13 10:12:50

Start by raising your own topic, not by hijacking someone else's unrelated one.

Include enough details to allow people to help you. What did you do exactly? Using what commands?

In general using rsync to clone systems is unsupported and will not work. Learn how to use a kickstart file to automate your installs.
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

Locked