nixos-infect icon indicating copy to clipboard operation
nixos-infect copied to clipboard

mv -v /boot /boot.bak fails if /boot is a mount point

Open whentze opened this issue 3 years ago • 6 comments

More specifically, when run on a machine with non-EFI boot where /boot is a mount point, you get the following error:

mv: cannot move '/boot' to '/boot.bak': Device or resource busy

I ran into this error on a contabo VPS but I suspect the kind of setup that causes it is not super rare.

whentze avatar Aug 31 '21 18:08 whentze

@whentze So what did you do to resolve past this?

I get this on Hetzner dedicated server as well (AX101).

srid avatar Sep 04 '21 19:09 srid

What I actually ended up doing is replace the mv with cp -a in the script and re-running it, after which went through successfully.

However, I'm not sure if this would be the right thing to do in all situations, I'm not sure of the implications.

whentze avatar Sep 05 '21 21:09 whentze

I'm hitting this consistently on Oracle's Ampere instances as well.

colemickens avatar Oct 01 '21 07:10 colemickens

Is there a workaround to fixing it on oracle amepere? mv -v -> cp -a did not do the job for me.

Kranzes avatar Feb 16 '22 16:02 Kranzes

Yes, use the Ubuntu 20.04 "shape". It would be nice to have this fixed, however, the Oracle 7.9 "shape" gives a reasonable result, especially with PR#100 which automatically adopts the 8G swap partition.

[root@amd1-orc:/]# df -h (after removing old-root)
Filesystem      Size  Used Avail Use% Mounted on
devtmpfs         49M     0   49M   0% /dev
tmpfs           488M     0  488M   0% /dev/shm
tmpfs           244M  4.0M  240M   2% /run
tmpfs           488M  432K  488M   1% /run/wrappers
/dev/sda3        39G  1.8G   37G   5% /
/dev/sda1       200M   31M  170M  16% /boot
tmpfs            98M     0   98M   0% /run/user/0

keithy avatar Apr 19 '22 20:04 keithy

Use this https://gist.github.com/kradalby/0957a5d4fbb9018d0b700b118f5c5341

shism2 avatar Jun 03 '22 00:06 shism2