The device or partition with the Linux system on it will need to be mounted. To discover the kernel name of the storage device name, type:
fdisk -l
Create a directory where you would like to mount the device or partition, then mount it:
mkdir /mnt/arch
mount /dev/<device-or-partition-name> /mnt/arch
Mount the temporary filesystems:
cd /mnt/arch
mount -t proc proc proc/
mount -t sysfs sys sys/
mount -o bind /dev dev/
Mount other parts of your filesystem (e.g. /boot, /var, /usr...) that reside on separate partitions but which you need access to. For example:
mount /dev/<device-or-partition-name> boot/
It's possible to mount filesystems after you've chrooted, but it's more convenient to do so beforehand. The reasoning for this is you'll have to unmount the temporary filesystems after you exit a chroot so this lets you umount all the filesystems in a single command. This also allows a safer shutdown. Because the external Linux environment knows all mounted partitions it can safely unmount them during shutdown.
If you've setup your network and want to use it in the chroot environment, copy over your DNS servers so that you will be connected to the network:
cp -L /etc/resolv.conf etc/resolv.conf
Now chroot to your installed device or partition and define your shell:
chroot . /bin/bash
If you see the error, "chroot: cannot run command '/bin/bash': Exec format error" it is likely the two architectures do not match.
If you'll be doing anything with GRUB inside the chroot environment, you'll need to be sure your /etc/mtab is up-to-date:
grep -v rootfs /proc/mounts > /etc/mtab
If you use bash, your root $HOME/.bashrc will be sourced on login provided your ~/.bash_profile specifies it (source ~/.bashrc). To source your chrooted, global bash configuration do:
source /etc/profile
If your bash configuration doesn't use a unique prompt, consider creating one to be able to differentiate your chroot environment:
Something went wrong when upgrading the linux package and after rebooting the machine I got in the recovery console. So I decided to reinstall the package via pacman LiveCD and I got this.
Any ideas how to install it properly?
UPDATE: after chrooting the proper way, the install went fine! Thanks for your help anyway guys :)
the heart-warming message problem was fixed by reading the wiki & chrooting the proper way.
But reinstalling linux (and filesystem) didn't solve my problems. When booting from hard disk, arch couldn't find /lib/modules/3.1.6-1-ARCH/modules.dep (it is present when checking from liveCD) and root partition (also present when checking from liveCD).
This is why you always look at the recent news on the Arch Linux website before performing a system update. The recent upgrade to filesystem breaks mtab.
They've added a warning for this? I changed my /boot to not be auto-mounted and had a whole bunch of errors because pacman didn't realise this and so just installed things into the boot folder on my root partition.
Yeah, ask me if I really want to install some packages I clearly just fucking asked for, but pretend you can't read an fstab and make sure /boot is mounted when it comes time to upgrade da kernel.
2 points
unknown author
Don't worry, 'pacman -U /var/cache/pacman/pkg/linux-3.1.5-1-x86_64.pkg.tar.xz' fixes this if your system doesn't start up.
29 comments
When my HDD was shot and the computer wouldn't boot properly, the shell told me "We're bailing out. You're on your own."
EDIT: I just looked up exactly what it said (I took a picture), the real quote was: "Bailing out, you are on your own. Good luck."
The good luck was a nice touch at least.
they sure know how to cheer people up! :D
Honestly as a new linux user, that would be a pretty good motivator for me to try and fix instead of just reformatting.
Haha, well in my case, the problem was that my hard drive was broken and needed to be replaced, so there wasn't much I could have done to fix it :)
Could you provide said picture? Sounds amusing.
Here you go: https://imgur.com/LlNK8
Sorry for the quality, it was taken with my phone.
Did you follow the instructions on Arch Linux News about upgrading filesystem?
Is there a way to have a local copy of it on your file system that you can manually update or something? Like /usr/ports/UPDATING on FreeBSD?
You can download it from http://www.archlinux.org/packages/core/any/filesystem/ and install with
pacman -U.
Pacman keep a cache in /var/cache/pacman/pkg/, so you could install a version (if it's in there) with
pacman -U /var/cache/pacman/pkg/pkgname-pkgver.pkg.tar.gz
Oh shit. I manually deleted those files and it replaced them just fine. Think I broke anything? lol
If you can't boot then yes, if it's working I guess not.
Are you sure yuo chroot into your arch install correctly? Consult https://wiki.archlinux.org/index.php/Change_Root it's best resource you can get for archlinux.
Proper way to chroot:
The device or partition with the Linux system on it will need to be mounted. To discover the kernel name of the storage device name, type:
fdisk -l
Create a directory where you would like to mount the device or partition, then mount it:
mkdir /mnt/arch
mount /dev/<device-or-partition-name> /mnt/arch
Mount the temporary filesystems:
cd /mnt/arch
mount -t proc proc proc/
mount -t sysfs sys sys/
mount -o bind /dev dev/
Mount other parts of your filesystem (e.g. /boot, /var, /usr...) that reside on separate partitions but which you need access to. For example:
mount /dev/<device-or-partition-name> boot/
It's possible to mount filesystems after you've chrooted, but it's more convenient to do so beforehand. The reasoning for this is you'll have to unmount the temporary filesystems after you exit a chroot so this lets you umount all the filesystems in a single command. This also allows a safer shutdown. Because the external Linux environment knows all mounted partitions it can safely unmount them during shutdown.
If you've setup your network and want to use it in the chroot environment, copy over your DNS servers so that you will be connected to the network:
cp -L /etc/resolv.conf etc/resolv.conf
Now chroot to your installed device or partition and define your shell:
chroot . /bin/bash
If you see the error, "chroot: cannot run command '/bin/bash': Exec format error" it is likely the two architectures do not match.
If you'll be doing anything with GRUB inside the chroot environment, you'll need to be sure your /etc/mtab is up-to-date:
grep -v rootfs /proc/mounts > /etc/mtab
If you use bash, your root $HOME/.bashrc will be sourced on login provided your ~/.bash_profile specifies it (source ~/.bashrc). To source your chrooted, global bash configuration do:
source /etc/profile
If your bash configuration doesn't use a unique prompt, consider creating one to be able to differentiate your chroot environment:
export PS1="(chroot) $PS1"
Something went wrong when upgrading the linux package and after rebooting the machine I got in the recovery console. So I decided to reinstall the package via pacman LiveCD and I got this.
Any ideas how to install it properly?
UPDATE: after chrooting the proper way, the install went fine! Thanks for your help anyway guys :)
Did you try and upgrade the packages
linuxandfilesystemat the same time?What happens if you type "mount /boot". Do you know what block device name your boot drive is usually on?
Can you
cat /etc/fstab?Are you on the #archlinux on freenode?
the heart-warming message problem was fixed by reading the wiki & chrooting the proper way.
But reinstalling linux (and filesystem) didn't solve my problems. When booting from hard disk, arch couldn't find /lib/modules/3.1.6-1-ARCH/modules.dep (it is present when checking from liveCD) and root partition (also present when checking from liveCD).
Deleted before we saved it.
Credit: cowsay
< I'm your system. This is you. Thanks. >
Deleted before we saved it.
This is why you always look at the recent news on the Arch Linux website before performing a system update. The recent upgrade to filesystem breaks mtab.
RSS to that bitch.
They've added a warning for this? I changed my /boot to not be auto-mounted and had a whole bunch of errors because pacman didn't realise this and so just installed things into the boot folder on my root partition.
pacman sounds pretty smart.
Yeah, ask me if I really want to install some packages I clearly just fucking asked for, but pretend you can't read an fstab and make sure /boot is mounted when it comes time to upgrade da kernel.
Don't worry, 'pacman -U /var/cache/pacman/pkg/linux-3.1.5-1-x86_64.pkg.tar.xz' fixes this if your system doesn't start up.
Don't feel bad. I got that message (reasonably so) because my /boot partition got corrupt!
I read this warning with GLaDOS' voice.