You are not logged in.

#1 2015-12-28 22:20:10

jo-shva
Member
From: Sherman, TX USA
Registered: 2010-10-18
Posts: 133

Can't chroot with btrfs subvolumes to repair system [SOLVED]

I followed the chroot wiki page and the install flash-drive to try and remove my current broken system and replace it with a btrfs snapshot.  The problem I face is that btrfs is set up like this

/__active/rootvol/

.  I found I have to mount the drive like this

 /mnt/arch/__active/rootvol/

otherwise proc, dev, resovl.conf, etc wont load.  Now the issue is I have to be above

__active/rootvol

to replace the subvolume as they are all listed as

__active/rootvol/ 2015 21,12

I cant replace the current volume cause its mounted. Im in a catch22.  And yes I tried doing this from getty but the startup sequence refuses to allow me into a tty!

Is there a way to save my system without having to reinstall?  The btrfs subvolumes seem less helpful then I had anticipated.
Any help will be greatly appreciated.

Last edited by jo-shva (2015-12-29 01:09:45)


"Democracy is being allowed to vote for the candidate you dislike least." -- Robert Byrne
http://killhellokitty.deviantart.com/

Offline

#2 2015-12-28 23:25:28

Head_on_a_Stick
Member
From: The Wirral
Registered: 2014-02-20
Posts: 9,003
Website

Re: Can't chroot with btrfs subvolumes to repair system [SOLVED]

Boot into the snapshot rather than using `chroot`

EDIT: You may also be able to use systemd-nspawn (for the snapshot) from the live environment but I've never tried that.

Last edited by Head_on_a_Stick (2015-12-28 23:26:50)


Jin, Jîyan, Azadî

Offline

#3 2015-12-28 23:30:39

nstgc
Member
Registered: 2014-03-17
Posts: 393

Re: Can't chroot with btrfs subvolumes to repair system [SOLVED]

Where is usr/{your shell} in the larger picture? What is the exact command line look like?

If it's

/mnt/arch/__active/rootvol/usr/bin/bash

then try

 sudo arch-chroot /mnt/arch/__active/rootvol

Offline

#4 2015-12-28 23:56:54

tom.ty89
Member
Registered: 2012-11-15
Posts: 897

Re: Can't chroot with btrfs subvolumes to repair system [SOLVED]

mount -o subvol= doesn't work? if arch-chroot doesn't work well on that you can also try systemd-nspawn

Offline

#5 2015-12-29 00:04:28

jo-shva
Member
From: Sherman, TX USA
Registered: 2010-10-18
Posts: 133

Re: Can't chroot with btrfs subvolumes to repair system [SOLVED]

I'm not sure how to boot into the snapshot?

its

 /mnt/arch/__active/rootvol /bin/bash

Are you suggesting i add

mount -o subvol=""

to my kernel parameters?

And lastly I have know idea what systemd-nspawn is.  I'll try and look it up.


"Democracy is being allowed to vote for the candidate you dislike least." -- Robert Byrne
http://killhellokitty.deviantart.com/

Offline

#6 2015-12-29 00:11:35

tom.ty89
Member
Registered: 2012-11-15
Posts: 897

Re: Can't chroot with btrfs subvolumes to repair system [SOLVED]

kernel param? aren't you trying to chroot? I mean you should mount the subvol you want to chroot into, instead of the default subvol to the mountpoint, e.g.

mount -o subvol=__active/rootvol /dev/sdXY /mnt; arch-chroot /mnt

Offline

#7 2015-12-29 00:14:07

Head_on_a_Stick
Member
From: The Wirral
Registered: 2014-02-20
Posts: 9,003
Website

Re: Can't chroot with btrfs subvolumes to repair system [SOLVED]


Jin, Jîyan, Azadî

Offline

#8 2015-12-29 00:29:18

jo-shva
Member
From: Sherman, TX USA
Registered: 2010-10-18
Posts: 133

Re: Can't chroot with btrfs subvolumes to repair system [SOLVED]

I'm not sure which is the best way to go.  You all have given me 3 options(which is great) first is to chroot into snapshot and repair from there.
The next is to add kernel boot parameters to load into snapshot (and change fstab to match). To repair system.
The last is systemd-nspawn to create a container free of the installed system, to try and remove the old volume and replace with snapshot.

I have no idea which one to choose.  Which way is going to be best to remove old volume and replace with snapshot.


"Democracy is being allowed to vote for the candidate you dislike least." -- Robert Byrne
http://killhellokitty.deviantart.com/

Offline

#9 2015-12-29 00:39:08

tom.ty89
Member
Registered: 2012-11-15
Posts: 897

Re: Can't chroot with btrfs subvolumes to repair system [SOLVED]

Thing is I don't know what you're actually trying to do. How exactly is your btrfs structured and why do you need chroot to remove...volume? what volume? Also replace with snapshot? Do you mean you want to boot to a specific snapshot or send a snapshot from one btrfs to another?

Can you use `btrfs subvol list $MOUNTPOUNT_OF_SUBVOL_ID_5` to tell what you're trying to do?

systemd-nspawn is just an alternative to arch-chroot here.

Last edited by tom.ty89 (2015-12-29 00:40:44)

Offline

#10 2015-12-29 00:52:02

jo-shva
Member
From: Sherman, TX USA
Registered: 2010-10-18
Posts: 133

Re: Can't chroot with btrfs subvolumes to repair system [SOLVED]

My btrfs volume got screwed-up(my fault, tried to hibernate to swap partition[not file]).
I have snapshots that can replace the current broken volume.
My problem is that I am unable to enter a tty to do a simple volume replace with snapshot.
So I figured(perhaps incorrectly) that I would need to chroot into the system to remove the current volume and replace it with snapshot.
Thats where I got in to my catch22  because I have to mount the btrfs volume to chroot

 /mnt/__active/rootvol/

I cant remove it to replace it with a snapshot because I have to be able to remove

__active/rootvol

to replace with new.
So I am thinking that systemd-nspawn would probably be the best way to remove the damaged volume and replace with snapshot.  Since it is a self contained container.  But I am not sure.  This is a lot more involved than I had expected.  If I could force it to boot into tty that would be the easiest fix. But I don't know if that is even possible.
And I'm not sure, but maybe I didn't even need to chroot, instead just load the Arch install and move the volumes.  Would something so simple work?  I'll feel like a complete dip**** if it is.

Last edited by jo-shva (2015-12-29 00:57:54)


"Democracy is being allowed to vote for the candidate you dislike least." -- Robert Byrne
http://killhellokitty.deviantart.com/

Offline

#11 2015-12-29 01:03:29

tom.ty89
Member
Registered: 2012-11-15
Posts: 897

Re: Can't chroot with btrfs subvolumes to repair system [SOLVED]

You don't need (arch-)chroot/systemd-nspawn. You just need to boot into a live environment and mount the btrfs and manipulate.

Offline

#12 2015-12-29 01:09:03

jo-shva
Member
From: Sherman, TX USA
Registered: 2010-10-18
Posts: 133

Re: Can't chroot with btrfs subvolumes to repair system [SOLVED]

Seriously.  That simple.  I'm kicking myself right now!
Thanks for all your help and getting me to find my way from around my elbow back to my thumb.
Cheers!


"Democracy is being allowed to vote for the candidate you dislike least." -- Robert Byrne
http://killhellokitty.deviantart.com/

Offline

Board footer

Powered by FluxBB