You are not logged in.

#1 2015-07-10 17:37:46

rhodie
Member
Registered: 2012-03-19
Posts: 45

[SOLVED] Remote install: pacstrap error: failed to commit transaction

Following the guide here: https://wiki.archlinux.org/index.php/Re … ux_Install to install arch onto a debian server.

We created the chroot in the former swap space, switched to it, and mounted the existing / partition to mnt.  Running pacstrap /mnt base gave errors of the type

error: failed to commit transaction (conflicting files)
filesystem: /mnt/usr exists in filesystem

so we did rm -fr /mnt/*, but we can't rmdir /mnt/lib/init/rw/ ("Device or resource busy.")  Unmounting the partition and trying mkfs.ext4 gives the error "in use by filesystem".

Does anyone have any suggestions?  Apparently /mnt/lib/init/rw/ is a debian directory used by initscripts during boot and mounted to tmpfs.

Last edited by rhodie (2015-07-10 21:57:22)

Offline

#2 2015-07-10 18:19:26

respiranto
Member
Registered: 2015-05-15
Posts: 479
Website

Re: [SOLVED] Remote install: pacstrap error: failed to commit transaction

What exactly did you mount on /mnt? The new, empty partition? - Seemingly not.

It seems like you mount-binded the debian-root to /mnt, and then used debian's rm to remove the whole debian-system residing in /mnt.
rm complains when trying to remove its own library. If you don't have physical access to the server, you should now do your best to make your debian system working again.

Edit: What do you mean by creating and switching to the chroot?

Last edited by respiranto (2015-07-10 18:23:09)

Offline

#3 2015-07-10 18:55:20

rhodie
Member
Registered: 2012-03-19
Posts: 45

Re: [SOLVED] Remote install: pacstrap error: failed to commit transaction

respiranto wrote:

What exactly did you mount on /mnt? The new, empty partition? - Seemingly not.

The debian root partition.

respiranto wrote:

It seems like you mount-binded the debian-root to /mnt, and then used debian's rm to remove the whole debian-system residing in /mnt.
rm complains when trying to remove its own library. If you don't have physical access to the server, you should now do your best to make your debian system working again.

We removed everything from within the chroot.  I can reinstall debian or another distro (not arch, sadly) via the data center's control panel if necessary.  It's a new, unused server.

respiranto wrote:

Edit: What do you mean by creating and switching to the chroot?

I created /mnt/newsys per the instructions here: https://wiki.archlinux.org/index.php/Re … _partition

# swapoff /dev/sdaX
# fdisk /dev/sda
(set /dev/sdaX ID field to "Linux" - Hex 83)
# mke2fs -j /dev/sdaX
# mkdir /mnt/newsys
# mount -t ext4 /dev/sdaX /mnt/newsys

and then followed these steps: https://wiki.archlinux.org/index.php/In … x#Manually

 $ curl -O https://mirrors.kernel.org/archlinux/iso/2015.06.01/archlinux-bootstrap-2015.06.01-x86_64.tar.gz
 # cd /tmp
 # tar xzf <path-to-bootstrap-image>/archlinux-bootstrap-2015.06.01-x86_64.tar.gz
 # cd /tmp/root.x86_64
  # cp /etc/resolv.conf etc
  # mount -t proc /proc proc
  # mount --rbind /sys sys
  # mount --rbind /dev dev
  # mount --rbind /run run
    (assuming /run exists on the system)
  # chroot /tmp/root.x86_64 /bin/bash

except that we used /mnt/newsys instead of /tmp/

Last edited by rhodie (2015-07-10 19:03:11)

Offline

#4 2015-07-10 19:36:10

respiranto
Member
Registered: 2015-05-15
Posts: 479
Website

Re: [SOLVED] Remote install: pacstrap error: failed to commit transaction

So it's not as dramatically as i thought.
So is debian still working?

rhodie wrote:

except that we used /mnt/newsys instead of /tmp/

Which is the problem.
As far as I understand, the idea is to have a working arch system in a chroot, then to mount the new arch-root-partition inside the chroot (could obviously also be done before) and then to install arch via pacstrap on the mounted partition.

So:

/tmp/root.x86_64 - simple Arch-environment providing everything to install Arch
/tmp/root.x86_64/mnt - mountpoint of your arch-root partition

Of course you can replace /tmp with anything you want, but it should certainly not be inside your mounted new arch-root partition.

That should solve your issue.
However I'd still like to know, how you managed to get the errors you got.
Which further steps did you take?
I can only imagine this, if you were using a mount-bind of something at least containing a usr-dir in which the rm-library, needed to remove itself, was residing.

Edit: Appended:

rhodie wrote:
respiranto wrote:

What exactly did you mount on /mnt? The new, empty partition? - Seemingly not.

The debian root partition.

Wait - I thought you were installing from within debian. Did you 'mount -bind' debian to its own /mnt?

Last edited by respiranto (2015-07-10 19:43:26)

Offline

#5 2015-07-10 19:49:21

rhodie
Member
Registered: 2012-03-19
Posts: 45

Re: [SOLVED] Remote install: pacstrap error: failed to commit transaction

respiranto wrote:

So it's not as dramatically as i thought.
So is debian still working?

No.

respiranto wrote:

As far as I understand, the idea is to have a working arch system in a chroot, then to mount the new arch-root-partition inside the chroot (could obviously also be done before) and then to install arch via pacstrap on the mounted partition.

So:

/tmp/root.x86_64 - simple Arch-environment providing everything to install Arch
/tmp/root.x86_64/mnt - mountpoint of your arch-root partition

Of course you can replace /tmp with anything you want, but it should certainly not be inside your mounted new arch-root partition.

That should solve your issue.

If I understand you right, that's basically what we did.

respiranto wrote:

However I'd still like to know, how you managed to get the errors you got.
Which further steps did you take?
I can only imagine this, if you were using a mount-bind of something at least containing  a usr-dir in which the rm-library needed to remove itself was residing.

From within the chroot, we tried to wipe the mounted partition. Everything was deleted except (/mnt)/lib/init/rw, which as I understand it is debian-specific and always open.

I'm reprovisioning the server with CentOS; will try that and report back.

Offline

#6 2015-07-10 20:20:08

respiranto
Member
Registered: 2015-05-15
Posts: 479
Website

Re: [SOLVED] Remote install: pacstrap error: failed to commit transaction

If I understand you right, that's basically what we did.

No.
Trying to reconstruct what you did:

/ - debian-root
/mnt/newsys - new arch-root
/mnt/newsys/root.x68_64 - temporary arch system for install only
-> chroot into the above
(/mnt/newsys/root.x68_64)/mnt - debian-root
-> pacstrap -i (/mnt/newsys/root.x68_64)/mnt base
-> rm -rf (/mnt/newsys/root.x68_64)/mnt

Still not correct as this does not explain why rm -rf did not want to delete the rm-library, which is debian's while the rm is running from inside the chroot.
Or does the bootstrap image use some programs like rm from the host OS?

What you should have done:

/ - debian-root
/tmp/root.x86_64 - simple Arch-environment providing everything to install Arch
/tmp/root.x86_64/mnt - new arch-root (former swap)
-> chroot into /tmp/root.x86_64
-> pacstrap -i (/tmp/root.x86_64)/mnt

Edit: It does not matter whether you use debian or CentOS or whichever linux-distribution (for this purpose). Or at least I can't imagine why it should.

Last edited by respiranto (2015-07-10 20:23:24)

Offline

#7 2015-07-10 21:56:45

rhodie
Member
Registered: 2012-03-19
Posts: 45

Re: [SOLVED] Remote install: pacstrap error: failed to commit transaction

OK, I get it now.  Thanks for the help!

Offline

Board footer

Powered by FluxBB