Sponsored Content
Top Forums UNIX for Beginners Questions & Answers Why bind to LiveCD /proc before building initramfs ? Post 303001642 by Corona688 on Tuesday 8th of August 2017 11:29:22 AM
Old 08-08-2017
Quote:
Originally Posted by sreyan32
Imagine I have an unbootable system where I need to update the kernel image using
Code:
update-initramfs

.

I have seen numerous examples online which show the following

Code:
$ mount -t proc none /mnt/ubuntu/proc
$ mount -o bind /dev /mnt/ubuntu/dev
$ mount -o bind /sys /mnt/ubuntu/sys

After that we chroot into the broken OS and then execute the command to update the initramfs.

My questions are as follows-:
[LIST=1][*]Are we binding the /proc and /dev of the Live CD to the broken system ? Or are we binding the /proc and /dev of the broken system to the live cd ?
Neither. /dev and especially /proc are virtual filesystems, which don't show files but rather imaginary kernel things.

So they're neither livecd, nor your broken system, but something belonging to whatever kernel you're running.

These kernel / device interfaces are pretty hard for a system to do without.

Quote:
If building the initramfs is dependent on the information of the OS for which the initramfs is built then won't it contain erroneous information if we build for the Live CD ? That is use the /proc and /dev of the LiveCD ?
It doesn't so much archive them as use them.
These 2 Users Gave Thanks to Corona688 For This Post:
 

6 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Cannot log on to FreeBSD LiveCD

Hi, I just download FreeBSD LiveCD and burn it to the CDROM (Because I want to learn UNIX). But when I boot the computer from the CDROM, it display the username and password. I type "root" and the password blank. But it does not allow me to login. I try many user name and password that I guest but... (3 Replies)
Discussion started by: 012633023
3 Replies

2. Debian

change initramfs by hand?

What's the correct way to change the initramfs file that's used during boot? I know that it's a gzipped cpio archive, but when I gunzip, extract, re-archive (without changing any files), and gzip, then the result is that the system does not boot any more. And I even set the cpio archive type. ... (18 Replies)
Discussion started by: frankie06
18 Replies

3. Linux

initramfs on 2.4 kernel

Is there a patch available to support initramfs on the 2.4 kernel? We can't upgrade to 2.6 for legacy purposes. All I found on google were early references to how initramfs is better than the 2.4 initrd. Thanks much! (0 Replies)
Discussion started by: amoeba
0 Replies

4. UNIX for Dummies Questions & Answers

_/proc/stat vs /proc/uptime

Hi, I am trying to calculate the CPU Usage by getting the difference between the idle time reported by /proc/stat at 2 different intervals. Now the 4th entry in the first line of /proc/stat will give me the 'idle time'. But I also came across /proc/uptime that gives me 2 entries : 1st one as the... (0 Replies)
Discussion started by: coderd
0 Replies

5. UNIX for Dummies Questions & Answers

LiveCD help

hey, I am build an operating system but i cant seem to get it to boot. I am using GRUB as the boot loader, but I'm not sure if I have all the files need, on the CD, to load the operating system. So can anyone tell me what files I need in order for GRUB to load my OS. P.S. The OS is neither... (1 Reply)
Discussion started by: neur0n
1 Replies

6. Debian

Only have initramfs now...

Long story short, I had a ps3 with both Lenny and Sid repositories. Knowing this is a bad idea and that Lenny is being deprecated I decided I wanted to move everything to Sid. I changed my repos and ran apt-get-update, upgrade, dist-upgrade. Had one warning during the apt-get upgrade that... (0 Replies)
Discussion started by: Azrael
0 Replies
ltsp-chroot(8)															    ltsp-chroot(8)

NAME
ltsp-chroot - Chroots into a specific LTSP thin client chroot SYNOPSIS
ltsp-chroot <options> DESCRIPTION
ltsp-chroot chroots into a specified LTSP chroot. Optional arguments can be provided to customize the chroot location as well as extra mounts. If present, default arguments will be read from the configuration file /etc/ltsp/ltsp-chroot.conf, and overwritten with used com- mand line options. OPTIONS
-a --arch arch Sets the architecture of the target chroot. Defaults vary by distribution. -b --base dir Sets the path of the target chroot. Defaults to /opt/ltsp/. -c --mount-package-cache If set, mounts the server package directories to the chroot previous to chrooting. Settings vary by distribution. -d --mount-dev If set, mounts the server dev and devpts directories to the chroot previous to chrooting. -p --mount-proc If set, mounts the server proc to the chroot previous to chrooting. -m --mount-all If set, mounts the proc, dev and package directories to the chroot before chrooting. -p --copy-resolv-conf If set, copies the server resolv.conf to the chroot previous to chrooting. -h --help Displays the ltsp-chroot help message. SEE ALSO
ltsp-build-client(8), AVAILABILITY
ltsp-chroot is part of ltsp package and the latest versions are available in source form from https://launchpad.net/products/ltsp. MAN PAGE AUTHOR
Wim Muskee <wimmmuskee@gmail.com> 2012-02-11 ltsp-chroot(8)
All times are GMT -4. The time now is 04:28 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy