nvme0n1 259:0 0 1.8T 0 disk
├─nvme0n1p1 259:1 0 100M 0 part
├─nvme0n1p2 259:2 0 1.3T 0 part
├─nvme0n1p3 259:3 0 300M 0 part
├─nvme0n1p4 259:4 0 31.3G 0 part
└─nvme0n1p5 259:5 0 456.7G 0 part /mnt```
```ts
ls /mnt
@ bin boot @cache dev etc @home @log proc @root run @srv sys @tmp tmp var```
```ts
chroot /mnt /bin/bash
chroot: failed to run command ‘/bin/bash’: Permission denied```
```ts
arch-chroot /mnt /bin/bash
mount: /mnt/sys: sys already mounted or mount point busy.
dmesg(1) may have more information after failed mount system call.
==> ERROR: failed to setup chroot /mnt```
can anyone help and when i try to close my terminal it says `bash` process is running
#[SOLVED] Can't chroot into /mnt
353 messages · Page 1 of 1 (latest)
lsblk -f
NAME FSTYPE FSVER LABEL UUID FSAVAIL FSUSE% MOUNTPOINTS
loop0
squash 4.0 0 100% /run/miso/sfs/livefs
loop1
squash 4.0 0 100% /run/miso/sfs/mhwdfs
loop2
squash 4.0 0 100% /run/miso/sfs/desktopfs
loop3
squash 4.0 0 100% /run/miso/sfs/rootfs
sda
└─sda1
ntfs Local Disk 9EA854C6A8549F19
sdb iso966 Jolie GARUDA_DR460NIZED_RAPTOR
2023-05-01-21-27-23-00
├─sdb1
│ iso966 Jolie GARUDA_DR460NIZED_RAPTOR
│ 2023-05-01-21-27-23-00 0 100% /run/miso/bootmnt
└─sdb2
vfat FAT12 MISO_EFI CC34-06DF
zram0
[SWAP]
nvme0n1
├─nvme0n1p1
│ vfat FAT32 6CF6-2B9A
├─nvme0n1p2
│ ntfs A01401A114017C12
├─nvme0n1p3
│ vfat FAT32 C146-AA85
├─nvme0n1p4
│ swap 1 0a15e252-1fbb-4930-ac23-411bb2cbe19a
└─nvme0n1p5
btrfs 8f9d8323-36db-4639-9e79-349bd9dd2a8f 376.9G 17% /mnt```
The formatting isn't ideal, can you run this
lsblk -f | curl -F 'f:1=<-' ix.io
instead?
So nvme0n1p5 is where your OS resides?
yes
Can you post output of findmnt /mnt
/mnt /dev/nvme0n1p5 btrfs rw,relatime,ssd,discard=async,space_cache=v2,subvolid=5,subvol=/```
Are you sure your os tree is at subvolid 5 ?
I assume it must be the /@.?
Can you post output of ls /mnt/@
i have dual boot
bin boot dev etc home lib lib64 mnt opt proc root run sbin srv sys tmp usr var
cat /mnt/@/etc/os-release
PRETTY_NAME="Garuda Linux"
ID=garuda
ID_LIKE=arch
BUILD_ID=rolling
ANSI_COLOR="38;2;23;147;209"
HOME_URL="https://garudalinux.org/"
DOCUMENTATION_URL="https://wiki.garudalinux.org/"
SUPPORT_URL="https://forum.garudalinux.org/"
BUG_REPORT_URL="https://gitlab.com/groups/garuda-linux/"
PRIVACY_POLICY_URL="https://terms.archlinux.org/docs/privacy-policy/"
LOGO=garudalinux```
Is the operating system you are trying to chroot into Garuda Linux?
yes
it broke some days ago
and i read on the forum
that the guy fixed it by going into chroot
So the command to chroot here should be arch-chroot /mnt/@
but then i messed up my boot
why?
i mounted it in /mnt
arch-chroot /mnt/@
==> WARNING: /mnt/@ is not a mountpoint. This may have undesirable side effects.```
Because obviously your OS tree is under btrfs subvolume /@ instead of root subvolume (subvolume=5)
Ignore it
nothing happend
My 2 cents you haven't read https://wiki.archlinux.org/title/Btrfs at all.
Really?
cat /etc/os-release
NAME="Garuda Linux"
PRETTY_NAME="Garuda Linux"
ID=garuda
ID_LIKE=arch
BUILD_ID=rolling
ANSI_COLOR="38;2;23;147;209"
HOME_URL="https://garudalinux.org/"
DOCUMENTATION_URL="https://wiki.garudalinux.org/"
SUPPORT_URL="https://forum.garudalinux.org/"
BUG_REPORT_URL="https://gitlab.com/groups/garuda-linux/"
PRIVACY_POLICY_URL="https://terms.archlinux.org/docs/privacy-policy/"
LOGO=garudalinux```
and
ls /mnt
i did su username
doesn't log anything
So something has happened, you are in the chroot in FA.
It is an illusion that the command does nothing, because you may see the exact same bash prompt before chrooting.
Because you have not mounted it
Your operating system is installed on a btrfs subvolume, and your /home and other directories are on different btrfs subvolumes.
fix it
so i can boot into my os
like i did before
with grub
should i do grub-install?
Could you please take a moment to read this straightforward article at https://wiki.archlinux.org/title/Btrfs?
which paragraph
There are 400 lines in total, so it shouldn't take too long.
In particular, the sub-volume section
What kind of problem is preventing the system from booting?
i don't see grub interface like i used to before
im scared to reboot cuz all the work will be thrown away
im on my live usb
Could you please run
[[ -d /sys/firmware/efi/efivars ]] && efibootmgr
And post the output
damn this is big output
i see grub console
where i can write commands
if i change priority of my boot order
Didn't you say you couldn't see the grub interface? Did you actually mean that you couldn't see the grub entry?
i mean selective menu
like
when you use your arrow buttons to select the os you wanna boot into
Like you system just boot into windows
Without showing grub at all
no
if i put my ssd in first place
in boot priority
it says GRUB:
and then i can write some commands
but it doesn't have a visual
like
no selection
it used to look like this
now it is like CMD
grub rescue
yes
grub rescue
it says that
Sorry, can you describe the problem with a bit more coherence?
yes it takes me into grub rescue
i can't boot into my os
so i was told i have to chroot into system to fix grub
cat /mnt/@/etc/fstab
If you are already chrooted, cat /etc/fstab.
# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a device; this may
# be used with UUID= as a more robust way to name devices that works even if
# disks are added and removed. See fstab(5).
#
# <file system> <mount point> <type> <options> <dump> <pass>
UUID=C146-AA85 /boot/efi vfat defaults,noatime 0 2
UUID=0a15e252-1fbb-4930-ac23-411bb2cbe19a swap swap defaults 0 0
UUID=8f9d8323-36db-4639-9e79-349bd9dd2a8f / btrfs subvol=/@,defaults,noatime,compress=zstd 0 0
UUID=8f9d8323-36db-4639-9e79-349bd9dd2a8f /home btrfs subvol=/@home,defaults,noatime,compress=zstd 0 0
UUID=8f9d8323-36db-4639-9e79-349bd9dd2a8f /root btrfs subvol=/@root,defaults,noatime,compress=zstd 0 0
UUID=8f9d8323-36db-4639-9e79-349bd9dd2a8f /srv btrfs subvol=/@srv,defaults,noatime,compress=zstd 0 0
UUID=8f9d8323-36db-4639-9e79-349bd9dd2a8f /var/cache btrfs subvol=/@cache,defaults,noatime,compress=zstd 0 0
UUID=8f9d8323-36db-4639-9e79-349bd9dd2a8f /var/log btrfs subvol=/@log,defaults,noatime,compress=zstd 0 0
UUID=8f9d8323-36db-4639-9e79-349bd9dd2a8f /var/tmp btrfs subvol=/@tmp,defaults,noatime,compress=zstd 0 0
tmpfs /tmp tmpfs defaults,noatime,mode=1777 0 0```
Are you in the chroot?
yes
First mount the EFI system partition
mount /dev/nvme0n1p3 /boot/efi
garuda-dr460nized% su
Password:
su: cannot set groups: Operation not permitted```
should i exit chroot?
arch-chroot should put you in root instead of this regular account, so log out of it.
Wait, what is the output of whoami
OK, let's start all over again, following the bash commands exactly as they appear.
Or ctrl+alt+f3 to bring up another virtual console.
no im in garuda iso
i have konsole
also /mnt is empty
i need to mount
i think
No, at the bash prompt, type exit repeatedly until konsole exit
Then open another konsole window and arch-chroot /mnt/@
ok
After chroot is done, do not type another other commands
Ok, now
findmnt /boot/efi
it logs nothing
next, mount ESP with
mount /dev/nvme0n1p3 /boot/efi
ok i did
Can you post the output of
ls /boot/efi
dev proc run sys 'System Volume Information'
Finally run
grub-install --efi-directory=/boot/efi
Then post the output
Installing for x86_64-efi platform.
grub-install: error: cannot find a device for /boot/grub (is /dev mounted?).```
😦
Did you use arch-chroot, which automatically mounts /dev, /sys, etc?
In the previous chroot step
Can you post output of df -h
/dev/nvme0n1p3 300M 32K 300M 1% /boot/efi
udev 16G 0 16G 0% /dev
shm 16G 0 16G 0% /dev/shm
run 16G 0 16G 0% /run
tmp 16G 0 16G 0% /tmp
overlay 24G 2.1G 22G 9% /etc/resolv.conf```
So finally we have to actually mount the subvolume /@, because grub is stubborn.
Sorry for any inconvenience
Now, exit the chroot
just type exit, then enter
ok
umount -l /mnt/boot/efi
umount -l /mnt
mount -o subvol=/@ /dev/nvme0n1p5 /mnt
mount /dev/nvme0n1p3 /mnt/boot/efi
Next,
arch-chroot /mnt
Finally,
grub-install --efi-directory=/boot/efi
If there's an error, please post it
mount: /mnt: /dev/nvme0n1p5 already mounted on /mnt.
dmesg(1) may have more information after failed mount system call.```
Sorry, I forgot the umount.
The previous message was edited using umount commands.
sudo umount /mnt
umount: /mnt: target is busy.```
You can unmount them lazily with flag -l
umount -l /mnt
GDBus.Error:org.freedesktop.Notifications.Error.ExcessNotificationGeneration: Created too many similar notifications in quick succession
This seems to be unrelated, so let's ignore it for now
ok
Is the /mnt and /mnt/boot/efi now mounted?
yes I followed your instructions
Installing for x86_64-efi platform.
Installation finished. No error reported.```
yay
does it mean that it works now?
It seems fine. Can you test it with a reboot?
Does it still show you a Grub Recuse prompt?
Do you have a picture of it?
its like black screen and on top left it says GRUB _
_ is blinking
i don't have a picture
also in my bios menu it only showed windows boot manager not grub boot manager
like this?
No problem, just ping me when you are done.
.Can you go back to the live ISO and rebuild the grub config?
grub-mkconfig -o /boot/grub/grub.cfg
in chroot?
sudo grub-mkconfig -o /boot/grub/grub.cfg
/usr/bin/grub-probe: error: failed to get canonical path of `overlay'.```
it says this when im not in chroot
Yes repeat the commands above in chroot
mount -o subvol=/@ /dev/nvme0n1p5 /mnt
mount /dev/nvme0n1p3 /mnt/boot/efi
arch-chroot /mnt
grub-mkconfig -o /boot/grub/grub.cfg
If you are still in the chroot, please post the output of fdisk -l.
sorry for inconvenience my internet cut off
What a coincidence, my internet was also cut due to the router overheating.
What is the output of efibootmgr ?
That doesn't look right.
Boot0003 and 4 is my usb
BBS can stand for BIOS Boot Specification, which means your system will boot in BIOS mode with the second entry.
the Boot0001
Can you arch-chroot /mnt and
grub-install --target=x86_64-efi --bootloader-id=GRUB --efi-directory=/boot/efi --recheck
post the output of efibootmgr again?
yea i did it
Ok, try to reboot
Don't use BBS in your firmware
Bbs?
It seems that your firmware is trying to boot using lagecy BIOS
its disabled
Can you try to find options in your firmware to boot the drive in UEFI mode?
what should i look for?
this is my bios
Should be easier. Msi was kinda weird back then.
Notice: I was using Kioxia 1tb nvme cacheless ssd. I also have an asus z170-p with pentium on it, and there speeds were around 2000 mb/s. On this motherboard the speeds are dropped to +/- 800 mb/s. Atleast that's still well enough and better than sata ssd.
tags: msi, gaming, z87, z97, h87, h97 ...
In the settings\boot select something like [UEFI GRUB] or [UEFI Hard Disk]
Can you post a picture of the settings\boot of your firmware setup?
Change the boot mode to [UEFI] instead of [UEFI+legacy].
Then i cant see my ssd
It was probably marked as something like [UEFI hard disk ...].
Just give it a try.
What is in the UEFI Hard Drive BBS Priorities
When you click on Boot Option #1, what happens?
Does this firmware have a boot menu (which can be accessed by pressing f12 during boot)?
Yes
Can you bring up the boot menu and post a pictureo f it?
Well, here is one possibility, from your lsblk and fdisk output I can see that you have two ESPs (EFI System Partition) on the same drive. The first ESP only has the window boot manager on it, and the second has the grub efi binary on it.
Although the practice of having multiple ESPs on the same drive is not strictly forbidden, it is discouraged by the UEFI specification and is known to cause problems with some UEFI implementations.
For example, the firmware won't let you select EFI binaries (boot loaders) from the second ESP.
But it was working before
I just had disabled windows boot manager
And it was taking me to grub
I need to access some folders on my linux
Its important
Your system was set up with Lagecy+UEFI. This means that you probably installed GRUB in the past to boot with the BIOS instead of UEFI.
May I know what broke your boot before all this happened?
where were you chroot from
Live iso
Why do you use Live ISO to chroot into your system and update?
Because i cant boot in the system
I mean before all that. what breaks your system in first place
Like before problems i updated garuda then shut down my pc
When i turned it on
In grub i selected linux
And it was giving me some error I don’t remember
After that i searched that error and i had to solve it by going in chroot
Ok, let's focus on the problem at hand for now. Can you go back to Live ISO?
Yes
The Live ISO typically uses a hybrid BIOS and UEFI setup, so it should support booting in UEFI mode without changing the current firmware settings
Can you post a picture of f12 boot menu if you can't boot in UEFI mode?
stat /sys/firmware/efi/efivars
Its installing some drivers first
stat /sys/firmware/efi/efivars/
File: /sys/firmware/efi/efivars/
Size: 0 Blocks: 0 IO Block: 4096 directory
Device: 0,33 Inode: 19609 Links: 2
Access: (0755/drwxr-xr-x) Uid: ( 0/ root) Gid: ( 0/ root)
Access: 2023-07-18 11:02:32.777291836 +0000
Modify: 2023-07-18 10:59:11.220052622 +0000
Change: 2023-07-18 10:59:11.220052622 +0000
Birth: -```
mount /dev/nvme0n1p3 /mnt
ls /mnt
dev EFI proc run sys 'System Volume Information'
ls /mnt/EFI
garuda GRUB
tree /mnt/EFI
if there is no tree, install it with pacman -S tree
umount /mnt
mount /dev/nvme0n1p1 /mnt
tree /mnt/EFI
umount /mnt
ok i did it
OK. The second ESP only contains EFI files for grub, so we will stop marking it as an ESP and install grub on the first ESP. This may solve the problem if it was caused by the firmware not regonising the second ESP.
This won't interfere with the Windows boot manager as UEFI supports multi-boot natively.
Ok i don't know what we are doing but i trust you 😄
However I need to say this before continue
Disclaimer of Liability
Whilst I will endeavour to take reasonable measures in aiding you with the issue at hand in good faith, there is no guarantee of absolute efficacy of such measures. In providing any assistance or advice concerning your matter, I hereby disclaim any and all responsibility or liability for any potential loss or damage to physical or digital data, equipment or property wihch may arise as a result of any action taken or counsel given. By heeding the advice proffered, you acknowledge and accept this disclaimer.
Do you wish to continue?
Well first use fdisk to mark /dev/nvme0n1p3 as "Linux Filesystem"
its already broken so
how?
then it asks for partition number
When asked
Partition number (1,2, default 5):
type 3
It will display
Partition type or alias (type L to list all):
type 20
The output should be
Changed type of partition 'EFI System' to 'Linux filesystem'.
Command (m for help):
Then type w and enter
Let's verify that,
fdisk -l /dev/nvme0n1
Disk /dev/nvme0n1: 1.82 TiB, 2000398934016 bytes, 3907029168 sectors
Disk model: Samsung SSD 980 PRO 2TB
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: 8E576950-BE10-498D-8DD7-6AEA26EDC11E
Device Start End Sectors Size Type
/dev/nvme0n1p1 2048 206847 204800 100M EFI System
/dev/nvme0n1p2 206848 2883024895 2882818048 1.3T Microsoft basic data
/dev/nvme0n1p3 2883024896 2883639295 614400 300M Linux filesystem
/dev/nvme0n1p4 2883639296 2949175295 65536000 31.3G Linux swap
/dev/nvme0n1p5 2949175296 3907029134 957853839 456.7G Linux filesystem```
Sehr gut.
Next, mount the OS tree
mount -o subvol=/@ /dev/nvme0n1p5 /mnt
mount /dev/nvme0n1p1 /mnt/boot/efi
arch-chroot /mnt
ok done
Change the 8th line of your /etc/fstab
from
UUID=C146-AA85 /boot/efi vfat defaults,noatime 0 2
to
UUID=6CF6-2B9A /boot/efi vfat defaults,noatime 0 2
Afterwards
mkinitcpio -P
Finally, reinstall grub
grub-install --target=x86_64-efi --bootloader-id=GRUB --efi-directory=/boot/efi --recheck
Post the output of efibootmgr when it is finished.
pacman -Qkk mkinitcpio
pacman -Qkk mkinitcpio
warning: mkinitcpio: /etc (Permissions mismatch)
warning: mkinitcpio: /usr (Permissions mismatch)
warning: mkinitcpio: /usr/bin (Permissions mismatch)
warning: mkinitcpio: /usr/lib (Permissions mismatch)
warning: mkinitcpio: /usr/lib/initcpio (Permissions mismatch)
warning: mkinitcpio: /usr/lib/initcpio/hooks (Permissions mismatch)
warning: mkinitcpio: /usr/lib/initcpio/install (Permissions mismatch)
warning: mkinitcpio: /usr/lib/initcpio/udev (Permissions mismatch)
warning: mkinitcpio: /usr/lib/kernel (Permissions mismatch)
warning: mkinitcpio: /usr/lib/kernel/install.d (Permissions mismatch)
warning: mkinitcpio: /usr/lib/systemd (Permissions mismatch)
warning: mkinitcpio: /usr/lib/systemd/system (Permissions mismatch)
warning: mkinitcpio: /usr/lib/tmpfiles.d (Permissions mismatch)
warning: mkinitcpio: /usr/share (Permissions mismatch)
warning: mkinitcpio: /usr/share/bash-completion (Permissions mismatch)
warning: mkinitcpio: /usr/share/bash-completion/completions (Permissions mismatch)
warning: mkinitcpio: /usr/share/libalpm (Permissions mismatch)
warning: mkinitcpio: /usr/share/libalpm/hooks (Permissions mismatch)
warning: mkinitcpio: /usr/share/libalpm/scripts (Permissions mismatch)
warning: mkinitcpio: /usr/share/man (Permissions mismatch)
warning: mkinitcpio: /usr/share/man/man1 (Permissions mismatch)
warning: mkinitcpio: /usr/share/man/man5 (Permissions mismatch)
warning: mkinitcpio: /usr/share/man/man8 (Permissions mismatch)
warning: mkinitcpio: /usr/share/zsh (Permissions mismatch)
warning: mkinitcpio: /usr/share/zsh/site-functions (Permissions mismatch)
mkinitcpio: 84 total files, 25 altered files```
stat /etc /usr /usr/bin /usr/share
File: /etc
Size: 4752 Blocks: 0 IO Block: 4096 directory
Device: 0,66 Inode: 274 Links: 1
Access: (0777/drwxrwxrwx) Uid: ( 0/ root) Gid: ( 0/ root)
Access: 2023-07-18 15:27:12.204464530 +0400
Modify: 2023-07-18 15:27:11.676467679 +0400
Change: 2023-07-18 15:27:11.676467679 +0400
Birth: 2023-05-31 04:45:19.658561823 +0400
File: /usr
Size: 80 Blocks: 0 IO Block: 4096 directory
Device: 0,66 Inode: 278 Links: 1
Access: (0777/drwxrwxrwx) Uid: ( 0/ root) Gid: ( 0/ root)
Access: 2023-07-18 15:27:11.753467219 +0400
Modify: 2023-07-18 15:27:11.753467219 +0400
Change: 2023-07-18 15:27:11.753467219 +0400
Birth: 2023-05-31 04:45:19.658561823 +0400
File: /usr/bin
Size: 84248 Blocks: 0 IO Block: 4096 directory
Device: 0,66 Inode: 1177 Links: 1
Access: (0777/drwxrwxrwx) Uid: ( 0/ root) Gid: ( 0/ root)
Access: 2023-07-18 15:27:11.597468150 +0400
Modify: 2023-07-18 15:27:11.598468144 +0400
Change: 2023-07-18 15:27:11.598468144 +0400
Birth: 2023-05-31 04:45:20.030556991 +0400
File: /usr/share
Size: 5046 Blocks: 0 IO Block: 4096 directory
Device: 0,66 Inode: 1182 Links: 1
Access: (0777/drwxrwxrwx) Uid: ( 0/ root) Gid: ( 0/ root)
Access: 2023-07-18 15:27:11.596468156 +0400
Modify: 2023-07-18 15:25:53.011936802 +0400
Change: 2023-07-18 15:25:53.011936802 +0400```
I will say that your system is more broken than you have described.
World read write execute permissions on important directories like /etc, /usr, /usr/bin is no good,
Have you done any sort of chroot -R / in the past?
stat /etc/shadow
yes i did chroot -R 777
File: /etc/shadow
Size: 1197 Blocks: 8 IO Block: 4096 regular file
Device: 0,66 Inode: 1468220 Links: 1
Access: (0777/-rwxrwxrwx) Uid: ( 0/ root) Gid: ( 0/ root)
Access: 2023-07-18 12:23:10.279937328 +0400
Modify: 2023-07-04 23:20:26.970996764 +0400
Change: 2023-07-18 11:54:57.539615963 +0400
Birth: 2023-07-04 23:20:26.970996764 +0400```
!!!
stat /etc/sudoers
File: /etc/sudoers
Size: 3319 Blocks: 8 IO Block: 4096 regular file
Device: 0,66 Inode: 1131 Links: 1
Access: (0777/-rwxrwxrwx) Uid: ( 0/ root) Gid: ( 0/ root)
Access: 2023-05-31 04:45:20.008557276 +0400
Modify: 2023-03-06 21:55:35.000000000 +0400
Change: 2023-07-18 11:54:57.536615991 +0400
Birth: 2023-05-31 04:45:20.008557276 +0400```
Ja, your system is finished. everyone is root in principle.
what does it mean?
Every file on your system has permission 777 (full read write execute permission for everyone)
even your /etc/shadow (related to password) /etc/sudoers is 777
This is madness in its purest form
I suggest a reinstall
Copy your important project files from the Live ISO to another location.
how can i access it?
Exit the chroot and umount /mnt/boot/efi, /mnt
You can mount the home subvolume with
mount -o subvol=/@home /dev/nvme0n1p5 /mnt
mount: /mnt: /dev/nvme0n1p5 already mounted on /mnt.
dmesg(1) may have more information after failed mount system call.```
umount -l /mnt/boot/efi
umount -l /mnt
mount -o subvol=/@home /dev/nvme0n1p5 /mnt
your home directory is now mounted in /mnt, so you can copy your stuff now
You are welcome
If you maintained a marvelous snapshot of subvolume /@ before this magnificent chmod 777 mayhem. Mending your machine might be possible.
nah imma just install some other os
i wanted to reinstall it too for quite a while
should i close this post?
Yes, mayhap a more measured maneuver is a reinstallation.
OK. change to title to [SOLVED] Can't chroot into /mnt
Thanks 🙂