Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

/dev/sda device is in use in bare-metal server #261

Closed
majorinche opened this issue Jun 2, 2020 · 12 comments · Fixed by #276
Closed

/dev/sda device is in use in bare-metal server #261

majorinche opened this issue Jun 2, 2020 · 12 comments · Fixed by #276
Assignees

Comments

@majorinche
Copy link

try to install fcos by pxe in bare-metal server, but meet the error, like

checking for exclusive access to /dev/sda
caused by: couldn't reread partition table: device is in use

other information:
pxelinux.cfg is:
DEFAULT pxeboot
TIMEOUT 20
PROMPT 0
LABEL pxeboot
KERNEL fedora-coreos-31.20200505.3.0-live-kernel-x86_64
APPEND ip=dhcp rd.neednet=1 initrd=fedora-coreos-31.20200505.3.0-live-initramfs.x86_64.img coreos.inst=yes coreos.inst.ignition_url=http://10.30.0.109/example.ign coreos.inst.image_url=http://10.30.0.109/fedora-coreos-31.20200505.3.0-metal.x86_64.raw.xz coreos.inst.install_dev=/dev/sda coreos.inst.insecure=yes
IPAPPEND 2

@majorinche majorinche changed the title /dev/sda device is in use /dev/sda device is in use in bare-metal server Jun 2, 2020
@kkeng11235
Copy link

Same issue with iso boot live image.
Both fedora-coreos-31.20200517.3.0-live.x86_64.iso &
fedora-coreos-32.20200601.3.0-live.x86_64.iso
using CLI to initiate, and kernel line args

@jlebon
Copy link
Member

jlebon commented Jun 17, 2020

Can one of you print the full output from coreos-installer? Specifically, does this error happen at the end of the install or at the start?

@kkeng11235
Copy link

The full output I get is this:

Error: checking for exclusive access to /dev/sda
Caused by: couldn't reread partition table: device is in use
Caused by: EBUSY: Device or resource busy

This comes up a few seconds after:
curl -O http://X.X.X.X:8000/example.ign
sudo coreos-installer install /dev/sda -i example.ign

@bgilbert
Copy link
Contributor

Could you drop the coreos.inst=yes and coreos.inst.image_url arguments, boot to a prompt (easier with the ISO image), and check /proc/mounts and /proc/swaps for partitions on /dev/sda? The output of sgdisk -p /dev/sda would also be helpful.

@kkeng11235
Copy link

Nothing to /dev/sda on /proc/mounts
Nothing in /proc/swaps

Here is sudo sgdisk -p /dev/sda

Disk /dev/sda: 234441648 sectors, 111.8 GiB
Model: KINGSTON SV300S3
Sector size (logical/physical): 512/512 bytes
Disk identifier (GUID): B6F22F01-F3E7-41F2-9AED-8613426CA213
Partition table holds up to 128 entries
Main partition table begins at sector 2 and ends at sector 33
First usable sector is 34, last usable sector is 234441614
Partitions will be aligned on 2048-sector boundaries
Total free space is 2452333 sectors (1.2 GiB)

Number Start (sector) End (sector) Size Code Name
1 2048 1230847 600.0 MiB EF00 EFI System Partition
2 1230848 3327999 1024.0 MiB 8300
3 3328000 231991295 109.0 GiB 8E00

@bgilbert
Copy link
Contributor

bgilbert commented Jun 18, 2020

3 3328000 231991295 109.0 GiB 8E00

Aha! Your disk has an LVM physical volume. What does sudo lvs say?

@bgilbert
Copy link
Contributor

It turns out that Linux MD partitions and LVM PVs are automatically run at startup, which interferes with coreos.inst.

@bgilbert
Copy link
Contributor

Thanks for the report. This should be fixed by #276.

@MarkIannucci
Copy link

@bgilbert , I'm bumping up against this as well with my bare metal install on an old laptop. Are you aware of a workaround that I can use to get past this issue?

@bgilbert
Copy link
Contributor

@MarkIannucci If you're doing a one-off install, it's easiest to work around this by hand:

  1. Boot the live image without any coreos.inst options
  2. sudo mdadm --stop /dev/mdXXX for each mdXXX listed in /proc/mdstat
  3. sudo vgchange -an XXX for each VG listed in sudo vgs
  4. curl -o config.ign <ignition_config_url>
  5. sudo coreos-installer install <target-device> -i config.ign <other-args>

@blueskyjunkie
Copy link

I seem to have run into this problem with a bare metal live ISO install. The disk had an old ubuntu installation using LVM which blocked the coreos-installer run from the coreos live installer.

To enable install I had to do these commands before running coreos-installer.

sudo lvm lvremove ubuntu-vg
sudo lvm vgremove ubuntu-vg

@jlebon
Copy link
Member

jlebon commented Jan 22, 2025

@blueskyjunkie Thanks for the report. We don't have tests for this currently. Can you open a new issue?

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

Successfully merging a pull request may close this issue.

6 participants