[opensuse] cannot change root while attempting to reinstall grub
I am trying to copy my root partition into another partition in order to boot from that partition. My system has 2 hard drives - an sdd which is /dev/sda, and an hdd, which is /dev/sdb. Here is how they are partitioned:
fdisk -l Disk /dev/sda: 232.9 GiB, 250059350016 bytes, 488397168 sectors Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disklabel type: gpt Disk identifier: 5105ED88-0EA8-4BF5-B7B8-31C56BA1351E
Device Start End Sectors Size Type /dev/sda1 2048 52430847 52428800 25G Linux filesystem /dev/sda2 52430848 104859647 52428800 25G Microsoft basic data /dev/sda3 104859648 488396799 383537152 182.9G Microsoft basic data Disk /dev/sdb: 931.5 GiB, 1000204886016 bytes, 1953525168 sectors Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 4096 bytes I/O size (minimum/optimal): 4096 bytes / 4096 bytes Disklabel type: gpt Disk identifier: A4BA7F24-83E8-4139-BBE3-76AB94D3CDDC Device Start End Sectors Size Type /dev/sdb1 2048 1026047 1024000 500M EFI System /dev/sdb2 1026048 1288191 262144 128M Microsoft reserved /dev/sdb3 1288192 433004543 431716352 205.9G Microsoft basic data /dev/sdb4 1928595456 1929517055 921600 450M Windows recovery environment /dev/sdb5 1929517056 1951195135 21678080 10.3G Windows recovery environment /dev/sdb6 1951197184 1953523711 2326528 1.1G Windows recovery environment /dev/sdb7 433004544 466558975 33554432 16G Linux swap /dev/sdb8 466558976 518987775 52428800 25G Linux filesystem /dev/sdb9 518987776 1928595455 1409607680 672.2G Linux filesystem Partition table entries are not in disk order. What I want to do is copy the contents of /dev/sda1 to /dev/sdb8, then setup grub to see the operating system at /dev/sdb8, and be able to boot from there. I have already copied /dev/sda1 to /dev/sdb1 using rsync, so now it is just a matter of setting up grub. I have successfully used the following procedure many times in the past, but this time it isn't working. root@tribetrekDellbig:/home/george> mount /dev/sdb8 /mnt root@tribetrekDellbig:/home/george> mount -o bind /proc /mnt/proc/ root@tribetrekDellbig:/home/george> mount -o bind /sys /mnt/sys/ root@tribetrekDellbig:/home/george> mount -o bind /dev /mnt/dev/ root@tribetrekDellbig:/home/george> cd /mnt root@tribetrekDellbig:/mnt> chroot /mnt /bin/bash: error while loading shared libraries: libreadline.so.8: cannot open shared object file: No such file or directory The plan was after changing root, I was going to re-install grub. I can reinstall grub regardless, but if I change the root first, then it will make the new partition the first partition in the grub list. I also tried to do this using a rescue system, but I get the same error. My rescue system stick is a leap 42.3 stick, so I expect that library was not part of 42.3 and that is the problem there. But trying to change root inside a shell on a fully booted system, where the root partition files are simply copied from one partition to another should not cause this problem. I am running leap 15.0 in this partition that I copied over to /dev/sdb8. I was running tumbleweed on this partition before, but I used a zypper dup to change it to leap 15.0. Any suggestions? -- George Box: TW | Plasma 5 | AMD Phenom IIX4 | 64 | 32GB Laptop #1: 15.0 | Plasma 5 | AMD FX 7TH GEN | 64 | 32GB Laptop #2: 15.0 | Plasma 5 | Core i5 | 64 | 8GB -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
George from the tribe composed on 2019-06-23 15:52 (UTC-0500): Useful, likely necessary, information not provided: /etc/fstab from /dev/sda1 output from blkid
I have already copied /dev/sda1 to /dev/sdb1 using rsync, so now it is just a matter of setting up grub.
Not exactly.
I have successfully used the following procedure many times in the past, but this time it isn't working.
It appears from the partitioning on sdb that you are using UEFI. Grub plays a considerably different role using UEFI than when using legacy/MBR. Assuming your sda1 installation was in fact made in UEFI mode, efibootmgr should be employed to adjust how and whether Grub appears after POST. What might enable you to fix Grub is to make the required fstab and /etc/default/grub adjustments on sdb8, then boot from sda1 substituting /dev/sdb8's UUID for /dev/sda1's UUID on the kernel cmdline's root= (or just type in root=/dev/sdb8 instead of root=UUID=foo). Once sdb8 is in command from this temporary hybrid boot configuration, use YaST to reconfigure booting from sdb1/sdb8. If Windows is booting in UEFI and openSUSE on sda1 is not, then for openSUSE on sdb8 functionality you'll more likely need to create a new installation on sdb8. -- Evolution as taught in public schools is religion, not science. Team OS/2 ** Reg. Linux User #211409 ** a11y rocks! Felix Miata *** http://fm.no-ip.com/ -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On 6/23/19 6:47 PM, Felix Miata wrote:
George from the tribe composed on 2019-06-23 15:52 (UTC-0500):
Useful, likely necessary, information not provided: /etc/fstab from /dev/sda1 output from blkid
cat /etc/fstab LABEL=root423 / ext4 acl,user_xattr 1 1 LABEL=swap swap swap defaults 0 0 LABEL=ESP /boot/efi vfat umask=0002,utf8=true 0 0 LABEL=data1 /home ext4 defaults 1 2 LABEL=OS /windows/C ntfs-3g uid=1000,gid=1000,dmask=027,fmask=137 0 0 LABEL=ntfsdata /mounters/ntfsdata ntfs-3g uid=1000,gid=1000,dmask=027,fmask=137 0 0
blkid /dev/sda1 /dev/sda1: LABEL="root423" UUID="05842869-174f-4231-970b-bb9b439fb29e" TYPE="ext4" PARTLABEL="rootxtra" PARTUUID="8817328e-d57b-4a4f-ad81-027bef10c8d4"
So on this partition, it should be known that it was running Leap 42.3 at one point. Then I upgraded it to tumbleweed, and then I downgraded it to Leap 15.0. I just never changed the label to reflect that it is now 15.0. Both system changes were done using zypper dup.
I have already copied /dev/sda1 to /dev/sdb1 using rsync, so now it is just a matter of setting up grub.
Not exactly.
I have successfully used the following procedure many times in the past, but this time it isn't working.
It appears from the partitioning on sdb that you are using UEFI. Grub plays a considerably different role using UEFI than when using legacy/MBR. Assuming your sda1 installation was in fact made in UEFI mode, efibootmgr should be employed to adjust how and whether Grub appears after POST.
What might enable you to fix Grub is to make the required fstab and /etc/default/grub adjustments on sdb8, then boot from sda1 substituting /dev/sdb8's UUID for /dev/sda1's UUID on the kernel cmdline's root= (or just type in root=/dev/sdb8 instead of root=UUID=foo). Once sdb8 is in command from this temporary hybrid boot configuration, use YaST to reconfigure booting from sdb1/sdb8.
When I have done this before, I have not had to reconfigure /etc/fstab in the new partition before trying to change root in order to get Grub to find everything and put the grub configuration together. I only had to do so afterwards. Nevertheless, I will try this, as it makes sense to work around the problem and get to my ultimate goal. Thanks. :)
If Windows is booting in UEFI and openSUSE on sda1 is not, then for openSUSE on sdb8 functionality you'll more likely need to create a new installation on sdb8.
I am pretty sure I am only booting in UEFI mode. My bios has a legacy bios option but I have never used it to my knowledge.
-- George Box: TW | Plasma 5 | AMD Phenom IIX4 | 64 | 32GB Laptop #1: 15.0 | Plasma 5 | AMD FX 7TH GEN | 64 | 32GB Laptop #2: 15.0 | Plasma 5 | Core i5 | 64 | 8GB -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On 6/24/19 9:21 AM, George from the tribe wrote:
On 6/23/19 6:47 PM, Felix Miata wrote:
I have already copied /dev/sda1 to /dev/sdb8 using rsync, so now it is just a matter of setting up grub.
Not exactly.
Problem solved.... I hope... When you suggested I modify the fstab file on the new partition, I went to look at it, and noticed that it was not copied from the old partition. Then I compared and figured out several files on the new partition /dev/sdb8 were not copied. So looking at the rsync manual, I saw this: -u, --update skip files that are newer on the receiver I was using -u as one of my rsync options when I copied /dev/sda1 to /dev/sdb8, and that is why several files didn't copy over. The partition /dev/sdb8 had a whole set of tumbleweed files that were newer than the leap 15.0 files, so they were not erased, hence not being able to find the proper library on calling chroot. So I re-ran my rsync copy, leaving out the -u option, and then ran my procedure. Change root then worked fine, and I have updated grub. So now to reboot, and hopefully everything is set now. Thanks. -- George Box: TW | Plasma 5 | AMD Phenom IIX4 | 64 | 32GB Laptop #1: 15.0 | Plasma 5 | AMD FX 7TH GEN | 64 | 32GB Laptop #2: 15.0 | Plasma 5 | Core i5 | 64 | 8GB -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On 6/24/19 10:07 AM, George from the tribe wrote:
On 6/24/19 9:21 AM, George from the tribe wrote:
On 6/23/19 6:47 PM, Felix Miata wrote:
I have already copied /dev/sda1 to /dev/sdb8 using rsync, so now it is just a matter of setting up grub.
Not exactly.
Problem solved.... I hope...
When you suggested I modify the fstab file on the new partition, I went to look at it, and noticed that it was not copied from the old partition. Then I compared and figured out several files on the new partition /dev/sdb8 were not copied.
So looking at the rsync manual, I saw this: -u, --update skip files that are newer on the receiver
I was using -u as one of my rsync options when I copied /dev/sda1 to /dev/sdb8, and that is why several files didn't copy over. The partition /dev/sdb8 had a whole set of tumbleweed files that were newer than the leap 15.0 files, so they were not erased, hence not being able to find the proper library on calling chroot. So I re-ran my rsync copy, leaving out the -u option, and then ran my procedure.
Change root then worked fine, and I have updated grub. So now to reboot, and hopefully everything is set now.
Thanks.
Ok, I have confirmed it - booted into the new partition and sending this email from /dev/sdb8. It works now. -- George Box: TW | Plasma 5 | AMD Phenom IIX4 | 64 | 32GB Laptop #1: 15.0 | Plasma 5 | AMD FX 7TH GEN | 64 | 32GB Laptop #2: 15.0 | Plasma 5 | Core i5 | 64 | 8GB -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On Sun, Jun 23, 2019 at 11:53 PM George from the tribe <tech@reachthetribes.org> wrote:
...
I have already copied /dev/sda1 to /dev/sdb1 using rsync, so now it is just a matter of setting up grub.
I have successfully used the following procedure many times in the past, but this time it isn't working.
root@tribetrekDellbig:/home/george> mount /dev/sdb8 /mnt
You copied it to /dev/sdb1 bit mount now /dev/sdb8?
root@tribetrekDellbig:/home/george> mount -o bind /proc /mnt/proc/ root@tribetrekDellbig:/home/george> mount -o bind /sys /mnt/sys/ root@tribetrekDellbig:/home/george> mount -o bind /dev /mnt/dev/ root@tribetrekDellbig:/home/george> cd /mnt root@tribetrekDellbig:/mnt> chroot /mnt /bin/bash: error while loading shared libraries: libreadline.so.8: cannot open shared object file: No such file or directory
And is this file actually present? -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On 6/24/19 9:35 AM, Andrei Borzenkov wrote:
On Sun, Jun 23, 2019 at 11:53 PM George from the tribe <tech@reachthetribes.org> wrote:
...
I have already copied /dev/sda1 to /dev/sdb1 using rsync, so now it is just a matter of setting up grub.
I have successfully used the following procedure many times in the past, but this time it isn't working.
root@tribetrekDellbig:/home/george> mount /dev/sdb8 /mnt
You copied it to /dev/sdb1 bit mount now /dev/sdb8?
Sorry that was a typo. I meant to write /dev/sdb8.
root@tribetrekDellbig:/home/george> mount -o bind /proc /mnt/proc/ root@tribetrekDellbig:/home/george> mount -o bind /sys /mnt/sys/ root@tribetrekDellbig:/home/george> mount -o bind /dev /mnt/dev/ root@tribetrekDellbig:/home/george> cd /mnt root@tribetrekDellbig:/mnt> chroot /mnt /bin/bash: error while loading shared libraries: libreadline.so.8: cannot open shared object file: No such file or directory
And is this file actually present?
-- George Box: TW | Plasma 5 | AMD Phenom IIX4 | 64 | 32GB Laptop #1: 15.0 | Plasma 5 | AMD FX 7TH GEN | 64 | 32GB Laptop #2: 15.0 | Plasma 5 | Core i5 | 64 | 8GB -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
participants (3)
-
Andrei Borzenkov
-
Felix Miata
-
George from the tribe