Help! chroot seems to have changed, I can't recover my system
Hi, I had to change over to a new hard drive,500G to 1T, I changed my partitioning scheme slightly to include a separate home and opt partition and merged two data partitions into one. I also changed to a gpt partition table to remove the need for an extended partition I got this Leap:15.3 system up and running fine except for a root ext4 partition error that popped up when I had a power outage. This made me remember how tolerant the xfs file system was to crashes so i decided to copy the root partition contents to a backup and create an xfs root partition. Wrong move, I'd forgotten that grub2 and xfs don't like each other and the system was unbootable. Ok backup root again and create an ext3 boot partition before the root partition and perform the mount --bind on sys proc and dev then chroot into root partition then use yast2 bootloader on it. Fine except "chroot /mnt" no longer appears to work, it says: "chroot: failed to run command ‘/bin/bash’: Permission denied" I've googled this but I can't understand any of the solutions and tutorials which I don't really have time for, I need to get back to work. Thanks Dave Plater
Dave Plater composed on 2021-12-24 07:22 (UTC+0200):
...I'd forgotten that grub2 and xfs don't like each other and the system was unbootable. Ok backup root again and create an ext3 boot partition before the root partition and perform the mount --bind on sys proc and dev then chroot into root partition then use yast2 bootloader on it. Fine except "chroot /mnt" no longer appears to work, it says: "chroot: failed to run command ‘/bin/bash’: Permission denied"
mount <rootfilesystem> /mnt mount -o bind /dev /mnt/dev mount -o bind /sys /mnt/sys mount -o bind /proc /mnt/proc chroot /mnt mount -a <proceed to fix/update/yast/whatever> With a separate partition for /boot/ in fstab, /boot/ will be empty until the the boot filesystem is mounted. mount -a is doubly important if / is BTRFS. -- Evolution as taught in public schools is, like religion, based on faith, not based on science. Team OS/2 ** Reg. Linux User #211409 ** a11y rocks! Felix Miata
On 12/24/21, Felix Miata <mrmazda@earthlink.net> wrote:
Dave Plater composed on 2021-12-24 07:22 (UTC+0200):
...I'd forgotten that grub2 and xfs don't like each other and the system was unbootable. Ok backup root again and create an ext3 boot partition before the root partition and perform the mount --bind on sys proc and dev then chroot into root partition then use yast2 bootloader on it. Fine except "chroot /mnt" no longer appears to work, it says: "chroot: failed to run command ‘/bin/bash’: Permission denied"
mount <rootfilesystem> /mnt mount -o bind /dev /mnt/dev mount -o bind /sys /mnt/sys mount -o bind /proc /mnt/proc chroot /mnt mount -a <proceed to fix/update/yast/whatever>
With a separate partition for /boot/ in fstab, /boot/ will be empty until the the boot filesystem is mounted. mount -a is doubly important if / is BTRFS. -- Evolution as taught in public schools is, like religion, based on faith, not based on science.
Team OS/2 ** Reg. Linux User #211409 ** a11y rocks!
Felix Miata
Thanks Felix but at the point " chroot /mnt " I can't continue because I get: "chroot: failed to run command ‘/bin/bash’: Permission denied" I've used your method many times in the past but now I'm stuck. When I did the change over from fading drive to new drive I used boot installed system on the new hard drive, I think I'll try it after I've sorted the root and boot partitions, moving boot to bootbu then back to the newly mounted boot partition. Thanks again, have a good christmas Dave P
On 24/12/2021 06.22, Dave Plater wrote:
Hi, I had to change over to a new hard drive,500G to 1T, I changed my partitioning scheme slightly to include a separate home and opt partition and merged two data partitions into one. I also changed to a gpt partition table to remove the need for an extended partition
Ok...
I got this Leap:15.3 system up and running fine except for a root ext4 partition error that popped up when I had a power outage. This made me remember how tolerant the xfs file system was to crashes so i decided to copy the root partition contents to a backup and create an xfs root partition.
Ok... So you made a backup of the root partition. Do you still have that backup?
Wrong move, I'd forgotten that grub2 and xfs don't like each other and the system was unbootable. Ok backup root again and create an ext3 boot partition before the root partition and perform the mount --bind on sys proc and dev then chroot into root partition then use yast2 bootloader on it.
This step is not clear. Backup root again? Why, you already did a backup in the previous paragraph. Then did what? Can you try to explain this step again?
Fine except "chroot /mnt" no longer appears to work, it says: "chroot: failed to run command ‘/bin/bash’: Permission denied"
I've googled this but I can't understand any of the solutions and tutorials which I don't really have time for, I need to get back to work.
Thanks Dave Plater
-- Cheers / Saludos, Carlos E. R. (from 15.2 x86_64 at Telcontar)
On Fri, 24 Dec 2021, 10:21 Carlos E. R., <robin.listas@telefonica.net> wrote:
On 24/12/2021 06.22, Dave Plater wrote:
Hi, I had to change over to a new hard drive,500G to 1T, I changed my partitioning scheme slightly to include a separate home and opt partition and merged two data partitions into one. I also changed to a gpt partition table to remove the need for an extended partition
Ok...
I got this Leap:15.3 system up and running fine except for a root ext4 partition error that popped up when I had a power outage. This made me remember how tolerant the xfs file system was to crashes so i decided to copy the root partition contents to a backup and create an xfs root partition.
Ok...
So you made a backup of the root partition. Do you still have that backup?
Wrong move, I'd forgotten that grub2 and xfs don't like each other and the system was unbootable. Ok backup root again and create an ext3 boot partition before the root partition and perform the mount --bind on sys proc and dev then chroot into root partition then use yast2 bootloader on it.
This step is not clear.
Backup root again? Why, you already did a backup in the previous paragraph.
Then did what?
Sorry I'm having to write this from my phone, the tumbleweed rescue iso I'm using won't run Gmail in it's browser.
The reason for the steps I've taken is to try to avoid the home directory on the old root partition, the new drive has a separate home partition. You've given me the idea to start again and mount the failing drive and copy it's root directory again, it only has one bad sector somewhere in home. Then I can delete home and opt directories from the new drive before booting. Still love to know what's wrong with chroot though all the small files in home take ages to copy. I have one bad hard drive that takes a long time to bring up plasma5 because of a bad sector. I've one new drive that was working until I messed with the root partition trying to change the root partition from ext4 to xfs. I have one older and only 350G space that mirrors the old drive's root and home which I used to transfer from old to new the first time Hope this explains it,
Dave P
Can you try to explain this step again?
Fine except "chroot /mnt" no longer appears to work, it says: "chroot: failed to run command ‘/bin/bash’: Permission denied"
I've googled this but I can't understand any of the solutions and tutorials which I don't really have time for, I need to get back to work.
Thanks Dave Plater
-- Cheers / Saludos,
Carlos E. R. (from 15.2 x86_64 at Telcontar)
On 24/12/2021 11.43, Dave Plater wrote:
On Fri, 24 Dec 2021, 10:21 Carlos E. R., <<>> wrote: On 24/12/2021 06.22, Dave Plater wrote: > Hi, I had to change over to a new hard drive,500G to 1T, I changed my > partitioning scheme slightly to include a separate home and opt > partition and merged two data partitions into one. I also changed to a > gpt partition table to remove the need for an extended partition
Ok...
> I got this Leap:15.3 system up and running fine except for a root ext4 > partition error that popped up when I had a power outage. This made me > remember how tolerant the xfs file system was to crashes so i decided > to copy the root partition contents to a backup and create an xfs root > partition.
Ok...
So you made a backup of the root partition. Do you still have that backup?
> Wrong move, I'd forgotten that grub2 and xfs don't like each other and > the system was unbootable. Ok backup root again and create an ext3 > boot partition before the root partition and perform the mount --bind > on sys proc and dev then chroot into root partition then use yast2 > bootloader on it.
This step is not clear.
Backup root again? Why, you already did a backup in the previous paragraph.
Then did what?
Sorry I'm having to write this from my phone, the tumbleweed rescue iso I'm using won't run Gmail in it's browser.
The reason for the steps I've taken is to try to avoid the home directory on the old root partition, the new drive has a separate home partition.
Having a separate /home is fine. But still I don't understand what you have done in the paragraph I mentioned, step by step. "Why", yes, but "what" you have done, no, you have not. And without that detailed list I can not know or guess why chroot does not work. -- Cheers / Saludos, Carlos E. R. (from 15.2 x86_64 at Telcontar)
On 24.12.2021 08:22, Dave Plater wrote:
Hi, I had to change over to a new hard drive,500G to 1T, I changed my partitioning scheme slightly to include a separate home and opt partition and merged two data partitions into one. I also changed to a gpt partition table to remove the need for an extended partition
I got this Leap:15.3 system up and running fine except for a root ext4 partition error that popped up when I had a power outage. This made me remember how tolerant the xfs file system was to crashes so i decided to copy the root partition contents to a backup and create an xfs root partition. Wrong move, I'd forgotten that grub2 and xfs don't like each other and the system was unbootable. Ok backup root again and create an ext3 boot partition before the root partition and perform the mount --bind on sys proc and dev then chroot into root partition then use yast2 bootloader on it. Fine except "chroot /mnt" no longer appears to work, it says: "chroot: failed to run command ‘/bin/bash’: Permission denied"
And what is output og ls -l /mnt/bin/bash
I've googled this but I can't understand any of the solutions and tutorials which I don't really have time for, I need to get back to work.
Thanks Dave Plater
participants (4)
-
Andrei Borzenkov
-
Carlos E. R.
-
Dave Plater
-
Felix Miata