[chroot] "Error: could not open file: etc/mtab: No such file or directory"

So I was trying to fix my missing kernel issue via chroot from a live disk, and attempted installing 5.10 (because when I started my computer it said something to the effect of “vmlinuz-5.10-x64_x86 is missing”). After loading the live disk I did this series of commands:

manjaro-chroot -a
mount /dev/sda2 /mnt
mount - t proc proc /proc
chroot /mnt

After mounting, I entered pacman -S linux510 linux510-headers in the terminal to install the required kernel, and received this output of errors:

error: could not open file: /etc/mtab: No such file or directory
error: could not determine filesystem mount points
error: failed to commit transaction (unexpected error)
Errors occurred, no packages were upgraded.

If anyone knows how to fix this, it would be greatly appreciated.

You chroot’d twice.


Ah how did I not realize that until now :joy: I must’ve misunderstood some guide that I read.
Well, after I exited the second chroot layer pacman successfully installed the missing kernel, so now I’ll just reboot and see if it works or not.

Don’t feel bad! Sometimes in life we do things twice without realizing it. :person_shrugging:

Don’t feel bad! Sometimes in life we do things twice without realizing it. :man_shrugging:

Well, the kernel does seem to be in its right place. Only problem now is that I have a “end Kernel panic - not syncing: No working init found.” error on boot. This is my output from sudo fsck /dev/sda:

fsck from util-linux 2.38
e2fsck 1.46.5 (30-Dec-2021)
ext2fs_open2: Bad magic number in super-block
fsck.ext2: Superblock invalid, trying backup blocks...
fsck.ext2: Bad magic number in super-block while trying to open /dev/sda

The superblock could not be read or does not describe a valid ext2/ext3/ext4
filesystem.  If the device is valid and it really contains an ext2/ext3/ext4
filesystem (and not swap or ufs or something else), then the superblock
is corrupt, and you might try running e2fsck with an alternate superblock:
    e2fsck -b 8193 <device>
    e2fsck -b 32768 <device>

/dev/sda contains `DOS/MBR boot sector, extended partition table (last)' data

The filesystem is not on the whole device
it is on a partition on that device.

/dev/sda is the whole device
/dev/sda1 or /dev/sda2
are referring to partitions (holding the filesystem) on that device

You want to check (fsck) the partition, not the device.


Ahhh thanks, when I fsck /dev/sda1 I get this message and string of numbers below:

fsck from util-linux 2.38
fsck.fat 4.2 (2021-01-31)
There are differences between boot sector and its backup.
This is mostly harmless. Differences: (offset:original/backup)
  1:63/58, 90:00/0e, 91:80/1f, 92:c0/be, 93:35/77, 94:51/7c, 95:03/ac
  , 96:00/22, 97:00/c0, 98:00/74, 99:00/0b, 100:ff/56, 101:fa/b4, 102:90/0e
  , 103:90/bb, 104:f6/07, 105:c2/00, 106:80/cd, 107:74/10, 108:05/5e
  , 109:f6/eb, 110:c2/f0, 111:70/32, 112:74/e4, 113:02/cd, 114:b2/16
  , 115:80/cd, 116:ea/19, 117:79/eb, 118:7c/fe, 119:00/54, 120:00/68
  , 121:31/69, 122:c0/73, 123:8e/20, 124:d8/69, 125:8e/73, 126:d0/20
  , 127:bc/6e, 128:00/6f, 129:20/74, 130:fb/20, 131:a0/61, 132:64/20
  , 133:7c/62, 134:3c/6f, 135:ff/6f, 137:02/61, 138:88/62, 139:c2/6c
  , 140:52/65, 141:bb/20, 142:17/64, 143:04/69, 144:f6/73, 145:07/6b
  , 146:03/2e, 147:74/20, 148:06/20, 149:be/50, 150:88/6c, 151:7d/65
  , 152:e8/61, 153:17/73, 154:01/65, 155:be/20, 156:05/69, 157:7c/6e
  , 158:b4/73, 159:41/65, 160:bb/72, 161:aa/74, 162:55/20, 163:cd/61
  , 164:13/20, 165:5a/62, 166:52/6f, 167:72/6f, 168:3d/74, 169:81/61
  , 170:fb/62, 171:55/6c, 172:aa/65, 173:75/20, 174:37/66, 175:83/6c
  , 176:e1/6f, 177:01/70, 178:74/70, 179:32/79, 180:31/20, 181:c0/61
  , 182:89/6e, 183:44/64, 184:04/0d, 185:40/0a, 186:88/70, 187:44/72
  , 188:ff/65, 189:89/73, 190:44/73, 191:02/20, 192:c7/61, 193:04/6e
  , 194:10/79, 195:00/20, 196:66/6b, 197:8b/65, 198:1e/79, 199:5c/20
  , 200:7c/74, 201:66/6f, 202:89/20, 203:5c/74, 204:08/72, 205:66/79
  , 206:8b/20, 207:1e/61, 208:60/67, 209:7c/61, 210:66/69, 211:89/6e
  , 212:5c/20, 213:0c/2e, 214:c7/2e, 215:44/2e, 216:06/20, 217:00/0d
  , 218:70/0a, 219:b4/00, 220:42/00, 221:cd/00, 222:13/00, 223:72/00
  , 224:05/00, 225:bb/00, 227:70/00, 228:eb/00, 229:76/00, 230:b4/00
  , 231:08/00, 232:cd/00, 233:13/00, 234:73/00, 235:0d/00, 236:5a/00
  , 237:84/00, 238:d2/00, 239:0f/00, 240:83/00, 241:d0/00, 243:be/00
  , 244:93/00, 245:7d/00, 246:e9/00, 247:82/00, 249:66/00, 250:0f/00
  , 251:b6/00, 252:c6/00, 253:88/00, 254:64/00, 255:ff/00, 256:40/00
  , 257:66/00, 258:89/00, 259:44/00, 260:04/00, 261:0f/00, 262:b6/00
  , 263:d1/00, 264:c1/00, 265:e2/00, 266:02/00, 267:88/00, 268:e8/00
  , 269:88/00, 270:f4/00, 271:40/00, 272:89/00, 273:44/00, 274:08/00
  , 275:0f/00, 276:b6/00, 277:c2/00, 278:c0/00, 279:e8/00, 280:02/00
  , 281:66/00, 282:89/00, 283:04/00, 284:66/00, 285:a1/00, 286:60/00
  , 287:7c/00, 288:66/00, 289:09/00, 290:c0/00, 291:75/00, 292:4e/00
  , 293:66/00, 294:a1/00, 295:5c/00, 296:7c/00, 297:66/00, 298:31/00
  , 299:d2/00, 300:66/00, 301:f7/00, 302:34/00, 303:88/00, 304:d1/00
  , 305:31/00, 306:d2/00, 307:66/00, 308:f7/00, 309:74/00, 310:04/00
  , 311:3b/00, 312:44/00, 313:08/00, 314:7d/00, 315:37/00, 316:fe/00
  , 317:c1/00, 318:88/00, 319:c5/00, 320:30/00, 321:c0/00, 322:c1/00
  , 323:e8/00, 324:02/00, 325:08/00, 326:c1/00, 327:88/00, 328:d0/00
  , 329:5a/00, 330:88/00, 331:c6/00, 332:bb/00, 334:70/00, 335:8e/00
  , 336:c3/00, 337:31/00, 338:db/00, 339:b8/00, 340:01/00, 341:02/00
  , 342:cd/00, 343:13/00, 344:72/00, 345:1e/00, 346:8c/00, 347:c3/00
  , 348:60/00, 349:1e/00, 350:b9/00, 352:01/00, 353:8e/00, 354:db/00
  , 355:31/00, 356:f6/00, 357:bf/00, 359:80/00, 360:8e/00, 361:c6/00
  , 362:fc/00, 363:f3/00, 364:a5/00, 365:1f/00, 366:61/00, 367:ff/00
  , 368:26/00, 369:5a/00, 370:7c/00, 371:be/00, 372:8e/00, 373:7d/00
  , 374:eb/00, 375:03/00, 376:be/00, 377:9d/00, 378:7d/00, 379:e8/00
  , 380:34/00, 382:be/00, 383:a2/00, 384:7d/00, 385:e8/00, 386:2e/00
  , 388:cd/00, 389:18/00, 390:eb/00, 391:fe/00, 392:47/00, 393:52/00
  , 394:55/00, 395:42/00, 396:20/00, 398:47/00, 399:65/00, 400:6f/00
  , 401:6d/00, 403:48/00, 404:61/00, 405:72/00, 406:64/00, 407:20/00
  , 408:44/00, 409:69/00, 410:73/00, 411:6b/00, 413:52/00, 414:65/00
  , 415:61/00, 416:64/00, 418:20/00, 419:45/00, 420:72/00, 421:72/00
  , 422:6f/00, 423:72/00, 424:0d/00, 425:0a/00, 427:bb/00, 428:01/00
  , 430:b4/00, 431:0e/00, 432:cd/00, 433:10/00, 434:ac/00, 435:3c/00
  , 437:75/00, 438:f4/00, 439:c3/00
1) Copy original to backup
2) Copy backup to original
3) No action

Meanwhile it says /dev/sda2 is fine:

fsck from util-linux 2.38
e2fsck 1.46.5 (30-Dec-2021)
/dev/sda2: clean, 3614016/31244288 files, 103942509/124948550 blocks

“Mostly harmless” is what the message says.
… just differences …
more importantly
there are no errors reported for the filesystem on /dev/sda1

I do not have experience with interpreting fsck results of a FAT filesystem though - but: no errors suggest that it is ok.

Thus I cannot advise on any of the two options given.

When in doubt, leave it as is … is what I’d go for.

… actually - but only with a working backup
which means:
a bitwise copy of that partition,
aka done with dd
so I could always restore the original state
I’d go for the other option
just to see what’ll happen :wink: - but that is just me and not advice to try it …

/dev/sda2 is ok too (clean)

all good it seems …

Is there still an actual problem?

1 Like

Frustratingly enough the kernel panic error still happens whenever I boot, pic of exact error below

How did you install that kernel?
Installing it via pacman will not be enough - you have to update grub and regenerate the initrd

mhwd-kernel would be the command to use if I recall correctly

1 Like

I installed the kernel by pacman -S linux510 linux510-headers initially, so I’ll try mhwd-kernel now

Just update grub. And if it happens again, show grub.cfg.

1 Like

did a -Syu upgrade and then update-grub, still had the error, this was the update-grub output:

Found theme: /usr/share/grub/themes/manjaro/theme.txt
Found linux image: /boot/vmlinuz-5.10-x86_64
Found initrd image: /boot/amd-ucode.img /boot/initramfs-5.10-x86_64.img
Found initrd fallback image: /boot/initramfs-5.10-x86_64-fallback.img
Found linux image: /boot/vmlinuz-5.9-x86_64
Found initrd image: /boot/amd-ucode.img /boot/initramfs-5.9-x86_64.img
Found initrd fallback image: /boot/initramfs-5.9-x86_64-fallback.img
Found linux image: /boot/vmlinuz-5.4-x86_64
Found initrd image: /boot/amd-ucode.img /boot/initramfs-5.4-x86_64.img
Found initrd fallback image: /boot/initramfs-5.4-x86_64-fallback.img
Found linux image: /boot/vmlinuz-4.14-x86_64
Found initrd image: /boot/amd-ucode.img /boot/initramfs-4.14-x86_64.img
Found initrd fallback image: /boot/initramfs-4.14-x86_64-fallback.img
Warning: os-prober will be executed to detect other bootable partitions.
Its output will be used to detect bootable binaries on them and create new boot entries.
grub-probe: error: cannot find a GRUB drive for /dev/sdc1.  Check your device.map.
grub-probe: error: cannot find a GRUB drive for /dev/sdc1.  Check your device.map.
Found memtest86+ image: /boot/memtest86+/memtest.bin

This waqs in grub.cfg for 5.10 specifically

menuentry 'Manjaro Linux (Kernel: 5.10.123-1-MANJARO x64 - fallback initramfs)' --class manjaro --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-5.10.123-1-MANJARO x64-fallback-abd85b7e-b277-43c3-ab29-8948e>
                set gfxpayload=keep
                insmod gzio
                insmod part_gpt
                insmod ext2
                set root='hd0,gpt2'
                if [ x$feature_platform_search_hint = xy ]; then
                  search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt2 --hint-efi=hd0,gpt2 --hint-baremetal=ahci0,gpt2  abd85b7e-b277-43c3-ab29-8948e5fc5c0b
                  search --no-floppy --fs-uuid --set=root abd85b7e-b277-43c3-ab29-8948e5fc5c0b
                linux   /boot/vmlinuz-5.10-x86_64 root=UUID=abd85b7e-b277-43c3-ab29-8948e5fc5c0b rw  quiet apparmor=1 security=apparmor udev.log_priority=3
                initrd  /boot/initramfs-5.10-x86_64-fallback.img

Usually, when /etc/mtab is defective, the only way out, is reinstalling.

luckily it turned out that wasn’t the problem after exiting the second chroot, right now it seems to have to do with /dev/sdc1 not having a GRUB drive according to update-grub

Does booting into fallback image or any other kernel work? What if you reinstall systemd?

1 Like

You can ignore that. Your sdc is not relevant for booting.

You’re missing the initrd for kernel 5.10.

You need to install linux510 again, using mhwd-kernel, but not with pacman.

In fact, I would first remove 5.10, and then reinstall it. Also, why not 5.15, which is the latest LTS kernel?

You’ve got a lot going on. :sweat_smile: Kernels 4.14, 5.4, 5.9, and 5.10? Here I am, only using 5.15 and nothing else.

when I chroot it says that I’m running on 5.15, but when I try removing 5.10 by mhwd-kernel -r linux510 I get these errors:

error: could not open file /var/lib/pacman/local/xcursor-breeze-5.22.5-1/desc: No such file or directory
error: could not open file /var/lib/pacman/local/xcursor-breeze-5.22.5-1/desc: No such file or directory
checking dependencies...
error: could not open file /var/lib/pacman/local/xcursor-breeze-5.22.5-1/desc: No such file or directory
error: failed to prepare transaction (could not satisfy dependencies)
:: removing linux510 breaks dependency 'linux510' required by linux-latest
:: removing linux510-headers breaks dependency 'linux510-headers' required by linux-latest-headers
:: removing linux510-virtualbox-host-modules breaks dependency 'linux510-virtualbox-host-modules' required by linux-latest-virtualbox-host-modules

I tried both booting into a fallback image/alternative kernel and reinstalling systemd to no avail