Forum › Forums › New users › New Users and General Questions › bootrepair encounters error: could not set up chroot environment
Tagged: bootrepair
- This topic has 7 replies, 4 voices, and was last updated Jan 22-6:40 pm by rokytnji.
-
AuthorPosts
-
May 3, 2020 at 12:09 pm #35591Member
rayluo
I run bootrepair app from desktop environment, from Antix 19.2 liveUSB and encounter error “Could not set up chroot environment. Please double-check the selected location.”
I chose its first option “Reinstall GRUB bootloader on ESP, MBR or PBR (root)”, (the second option “Repair GRUB configuration file” would yield same result, anyway). I then chose “install on MBR” and choose location as “sda”, selected root location as “sdb2” which is my “/live/boot-dev” (actually I also tried different root location options here, but again the outcome were the same). It ended up with an error: “Could not set up chroot environment. Please double-check the selected location.” I figure if I head to that route of manually doing the chroot preparation, it might eventually work. But perhaps the whole point of such “bootrepair” app is to save users from doing those manually.
And then I happened to redo the previous process, but by running bootrepair app from inside terminal, i.e. from the command-line
sudo bootrepair. This way, the final outcome is still the same, but at least the console shows the screen output of each step.bootrepair version: 17.15
/bin/lsblk -ln -o NAME,SIZE,LABEL,MODEL -d -e 2,11 -x NAME | /bin/grep -E ‘^x?[h,s,v].[a-z]|^mmcblk|^nvme’
“sda 55.9G HTS541060G9SA00\nsdb 4G MSFT_NORB\nsdc 3.2G MSFT_NORB”
/bin/lsblk -ln -o NAME,SIZE,FSTYPE,MOUNTPOINT,LABEL -e 2,11 -x NAME | /bin/grep -E ‘^x?[h,s,v].[a-z][0-9]|^mmcblk[0-9]+p|^nvme[0-9]+n[0-9]+p’
“sda1 26.8G ntfs IBM_PRELOAD\nsda2 1K \nsda3 5.1G vfat IBM_SERVICE\nsda5 23.8G vfat /media/DATA DATA\nsda6 256M swap [SWAP] \nsdb1 204M vfat /media/USB-DATA USB-DATA\nsdb2 3.8G ext4 /live/boot-dev Live-usb\nsdb3 49M vfat /media/LIVE-UEFI LIVE-UEFI\nsdc1 3.2G ntfs /media/demo/DELL_PRO_64 DELL_PRO_64”
/bin/lsblk -ln -o PARTTYPE /dev/sda| /bin/grep -qEi ‘0x83|0fc63daf-8483-4772-8e79-3d69d8477de4|44479540-F297-41B2-9AF7-D131D5F0458A|4F68BCE3-E8CD-4DB1-96E7-FBCAF984B709’
/bin/lsblk -ln -o PARTTYPE /dev/sdb| /bin/grep -qEi ‘0x83|0fc63daf-8483-4772-8e79-3d69d8477de4|44479540-F297-41B2-9AF7-D131D5F0458A|4F68BCE3-E8CD-4DB1-96E7-FBCAF984B709’
/bin/lsblk -ln -o LABEL /dev/sda1| /bin/grep -q rootantiX
/bin/lsblk -ln -o LABEL /dev/sda2| /bin/grep -q rootantiX
/bin/lsblk -ln -o LABEL /dev/sda3| /bin/grep -q rootantiX
/bin/lsblk -ln -o LABEL /dev/sda5| /bin/grep -q rootantiX
/bin/lsblk -ln -o LABEL /dev/sda6| /bin/grep -q rootantiX
/bin/lsblk -ln -o LABEL /dev/sdb1| /bin/grep -q rootantiX
/bin/lsblk -ln -o LABEL /dev/sdb2| /bin/grep -q rootantiX
/bin/lsblk -ln -o LABEL /dev/sdb3| /bin/grep -q rootantiX
/bin/lsblk -ln -o LABEL /dev/sdc1| /bin/grep -q rootantiX
/bin/lsblk -ln -o PARTTYPE /dev/sda1| /bin/grep -qEi ‘0x83|0fc63daf-8483-4772-8e79-3d69d8477de4|44479540-F297-41B2-9AF7-D131D5F0458A|4F68BCE3-E8CD-4DB1-96E7-FBCAF984B709’
/bin/lsblk -ln -o PARTTYPE /dev/sda2| /bin/grep -qEi ‘0x83|0fc63daf-8483-4772-8e79-3d69d8477de4|44479540-F297-41B2-9AF7-D131D5F0458A|4F68BCE3-E8CD-4DB1-96E7-FBCAF984B709’
/bin/lsblk -ln -o PARTTYPE /dev/sda3| /bin/grep -qEi ‘0x83|0fc63daf-8483-4772-8e79-3d69d8477de4|44479540-F297-41B2-9AF7-D131D5F0458A|4F68BCE3-E8CD-4DB1-96E7-FBCAF984B709’
/bin/lsblk -ln -o PARTTYPE /dev/sda5| /bin/grep -qEi ‘0x83|0fc63daf-8483-4772-8e79-3d69d8477de4|44479540-F297-41B2-9AF7-D131D5F0458A|4F68BCE3-E8CD-4DB1-96E7-FBCAF984B709’
/bin/lsblk -ln -o PARTTYPE /dev/sda6| /bin/grep -qEi ‘0x83|0fc63daf-8483-4772-8e79-3d69d8477de4|44479540-F297-41B2-9AF7-D131D5F0458A|4F68BCE3-E8CD-4DB1-96E7-FBCAF984B709’
/bin/lsblk -ln -o PARTTYPE /dev/sdb1| /bin/grep -qEi ‘0x83|0fc63daf-8483-4772-8e79-3d69d8477de4|44479540-F297-41B2-9AF7-D131D5F0458A|4F68BCE3-E8CD-4DB1-96E7-FBCAF984B709’
/sbin/cryptsetup isLuks /dev/sdb2
df / –output=source |sed -e 1d
“overlay”
/bin/mktemp -d –tmpdir -p /tmp
“/tmp/tmp.TUTUN9qlS6”
/bin/mount /dev/sdb2 /tmp/tmp.TUTUN9qlS6 && /bin/mount -o bind /dev /tmp/tmp.TUTUN9qlS6/dev && /bin/mount -o bind /sys /tmp/tmp.TUTUN9qlS6/sys && /bin/mount -o bind /proc /tmp/tmp.TUTUN9qlS6/proc
“mount:”
“/tmp/tmp.TUTUN9qlS6/dev: mount point does not exist.”So, somehow, that
/bin/mount -o bind /dev /tmp/tmp.TUTUN9qlS6/devwas not successful. I opened another terminal to check, and noticed that/tmp/tmp.TUTUN9qlS6/devdirectory did not exist. Is it supposed to be automatically created, during the bootrepair operation before I reached to this point? How, if possible, can I modify the scripts of bootrepair?Some more background, if it would be helpful: my computer came with Windows XP pre-installed in its first hard drive partition, later I successfully installed a Lubuntu on an extended partition and the dual boot worked fine. Recently, since I’ve switched to exclusively use AntiX from liveUSB anyway, I nuked the Lubuntu partition and reclaimed/merged its space back to my another data-only partition. Now I can still boot with AntiX liveUSB, but the Windows XP on hard disk can not boot due to a messed-up GRUB.
Regards,
RayMay 3, 2020 at 12:22 pm #35593Member
Xecure
::If antiX is NOT installed in your computer, then you cannot REINSTALL Grub, as it will be looking for the antiX partition in your computer (not liveUSB).
If I understand correctly, you only have Windows XP installed.If you simply want something to manage the booting of Windows XP, then follow some tutorial to have Windows XP manage the MBR. If you want some kind of GRUB to manage the booting, you will have to create a new partition for GRUB to exist and follow some other tutorial for installing GRUB there. I may be mistaken, but I believe christophe has explained how to do that in the forum somewhere.
Edit:
https://www.antixforum.com/forums/topic/booting-antix-frugal-only-from-hdd-without-any-full-installed-os-with-extlinux/
christophe uses extlinuxYou could also boot from the liveUSB menu to Win XP and install something like EasyBCD to get the bootmenu working.
I have little experience with creating these things separatly. Maybe someone else can recommend something.
- This reply was modified 3 years ago by Xecure.
antiX Live system enthusiast.
General Live Boot Parameters for antiX.May 3, 2020 at 12:57 pm #35595Member
rayluo
::If antiX is NOT installed in your computer, then you cannot REINSTALL Grub, as it will be looking for the antiX partition in your computer (not liveUSB).
Really? I don’t know, but I thought AntiCapitalista hinted that a Live DVD would also work. Did you/he mean “even if you can boot from a Live USB/DVD to run bootrepair, you would still have to have a (bootable?) Linux installed in one of your partition”?
If I understand correctly, you only have Windows XP installed. If you simply want something to manage the booting of Windows XP, then follow some tutorial to have Windows XP manage the MBR. If you want some kind of GRUB to manage the booting, you will have to create a new partition for GRUB to exist and follow some other tutorial for installing GRUB there. I may be mistaken, but I believe Cristoph has explaines how to do that in the forum somewhere.
That’s true. Currently I have only a Windows XP installed, although technically it was a dual-boot system since day 1, because this Thinkpad laptop was also shipped with yet another partition installed with an IBM recovery system (which is not currently functioning due to the messed-up boot).
I believe I could always go back to use some tools in the Windows world to fix MBR. Historically, tools in Windows world were very good at nuking Linux partitions and reclaim the MBR for Windows. 🙂
I am now just wondering whether “making/fixing a MBR to boot from the first partition” sounds a very common task that the mighty Linux should have a command-line tool just for that. If the outcome would be a boot menu (regardless of whether it is powered by grub), to choose between existing partitions, that would be even better.
You could also boot from the liveUSB menu to Win XP and install something like EasyBCD to get the bootmenu working.
“Boot from liveUSB”, yes. And that is indeed my only way to access this computer. “boot from the liveUSB menu to Win XP”, no. Once I choose the “boot from harddisk” from the LiveUSB boot menu, my harddisk booting sequence kicks in, and then it gets stuck with those aforementioned problems.
May 3, 2020 at 1:26 pm #35596Member
Xecure
::“boot from the liveUSB menu to Win XP”, no. Once I choose the “boot from harddisk” from the LiveUSB boot menu, my harddisk booting sequence kicks in, and then it gets stuck with those aforementioned problems.
When in the boot menu from live USB, can you not find the Windows XP Bootloader using the Boot Rescue Menus? I have no idea if Windows XP will appear there, as I have only tested this with W7 and W10.
Does anyone else have much experience creating some boot partition to install a working grub independent of a linux system? I have only experience with installing rEFInd, and I think that doesn’t work here.
Attachments:
antiX Live system enthusiast.
General Live Boot Parameters for antiX.May 3, 2020 at 6:09 pm #35612Member
rayluo
::When in the boot menu from live USB, can you not find the Windows XP Bootloader using the Boot Rescue Menus? I have no idea if Windows XP will appear there, as I have only tested this with W7 and W10.
Interestingly, I did not even see that Rescue menu you shared in your screenshot. When I boot from live USB, I saw only the (highest level?) menu of:
antiX-19.2 386-full Hannie (16 April 2020) Safe Video Mode Failsafe Boot Boot from Hard Disk Memory TestAnd then I choose “Boot from Hard Disk”, and I’ll get this:
Booting
error: unknown filesystem.
Entering rescue mode…
grub rescue>Instructed by some info about grub rescue, somehow
ls (hdX,Y)indicates grub can recognize only one filesystem, which is my liveUSB boot partition. Following that rabbit hole, I instruct grub to boot from that liveUSB partition. And, well this time, I at least reach to a place that I can see the same screen as your screenshot.There is no real progress since then, though. The rescue menu item was unable to detect any of my existing Windows partition.
For the record, despite unable to boot, all those Windows partitions are themselves in valid condition, because I can mount them when/if I boot from antiX liveUSB.
In all fairness, thank you Xecure and whoever spend time reading this. I was just trying to make sure I did not miss anything obvious when using that “bootrepair” thing. But if I was already doing it right, it just did not work due to some unknown reason, then so be it.
Does anyone else have much experience creating some boot partition to install a working grub independent of a linux system? I have only experience with installing rEFInd, and I think that doesn’t work here.
I’m all ears.
May 3, 2020 at 10:00 pm #35618Forum Admin
Dave
::If you want grub on with only windows installed I think you will need to setup a boot directory in either the windows partitions or better yet the recovery partitions if it is dead anyway. Ideally this would be it’s own boot partition that could hold the grub files normally found in /boot/grub. I think this would also leave you with no way to update the boot manager later outside of using a live session and manually doing a grub repair.
I think the difference between your boot menu and xecure’s is that one is extlinux and the other is grub. I think that depends on the system being bios or uefi.
Computers are like air conditioners. They work fine until you start opening Windows. ~Author Unknown
May 4, 2020 at 5:44 am #35627Member
Xecure
::Edit: I tried doing this in a Virtual Machine with Windows XP and I wasn’t able to make it find Windows bootloaders, so it seems the only choice is creating your own boot partition.
All that follows is useless. No need to read.I created my live USB with the antiX live USB maker. For non-UEFI systems, this is what I see:
During boot, I choose Switch to Grub Bootloader

Then, in the Grub bootloader, I select Boot Rescue Menus

And finally a search for Windows bootloaders

I guess this is related to how the live USB was created. Maybe encrypted systems don’t include this option or maybe it is snapshot related or who knows.
You may need to create a separate live USB or load form a CD and see if you can locate windows XP bootloader with antiX live boot and get inside windows XP.
Hopefully there is some guide somewhere to create a boot partition with grub that can help you.
- This reply was modified 3 years ago by Xecure. Reason: Nothing good in this post
antiX Live system enthusiast.
General Live Boot Parameters for antiX.January 22, 2023 at 6:40 pm #98004Forum Admin
rokytnji
::Guys. I think we are dealing with award bios since Windows XP was mentioned.
MBR drive instead of GPT drive pick on drive partitioning probably applies here. No real need for 512MB boot partition for EFI type of gear that comes later.
Makes for the easiest solo install. I am staying mostly out of this thread because of the desire to keep XP and with boot repair being mentioned.
Only mistake I can figure is the grub screen on installer is too confusing maybe for some users. Like installing grub to / of a partition instead of on the mbr of the drive.
I have not had to use grub repair except for once on a my screwup on my MX box during a grub update. With no windows on my MX box. It was no brainer to fix. On the update. I installed grub to root partition. instead of the MBR on the drive. I used the antiX full iso usb though to fix it during a live session.
So I’ll leave here with my standard search for antiX problems
Edit: Probably be a big help booting another live session and post terminal output of
sudo parted -lI like that command more than fdisk -l .
- This reply was modified 3 months, 2 weeks ago by rokytnji.
Sometimes I drive a crooked road to get my mind straight.
Not all who Wander are Lost.
I'm not outa place. I'm from outer space.Linux Registered User # 475019
How to Search for AntiX solutions to your problems -
AuthorPosts
- You must be logged in to reply to this topic.
