LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 08-27-2010, 12:29 PM   #1
rmknox
Member
 
Registered: May 2010
Posts: 354

Rep: Reputation: 34
confused about how the file system loads


my data resides in a partition sda2 - in a logical volume lv_root
unless I'm wrong lv_root contains the information on how to load the partition
so superficially it seems the partition must be loaded bofore we get the info on how to load it.

obviously I'm confused

Maybe someone could point me to documentation that explains this? or educate me a bit?

thanks

DIck
 
Old 08-27-2010, 12:58 PM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
As you might surmise, you are wrong. I'm not clear on what you'd mean by lv_root containing information on how to load. that doesn't mean much to me. on boot, the partition is recognised as an LVM partition and the metadata inside is accordingly read and the physical volumes and assembled into volume groups. Once those are established, then the logical volumes within the are recognised and from that point on treated as normal fileystems ready for mounting. There is no info required on how to load it. As long as the partition type in the partition table says it's LVM (or actually, even if not, as it can still be scanned to see if it's recognised as a known partition type) then the LVM logic is followed and everything (should) fall into place.
 
1 members found this post helpful.
Old 08-27-2010, 02:22 PM   #3
rmknox
Member
 
Registered: May 2010
Posts: 354

Original Poster
Rep: Reputation: 34
Chris - thanks much
If you are willing maybe you could help me with this final detail.
I see in /etc/fstab the following
Code:
#
# /etc/fstab
# Created by anaconda on Mon Mar 22 16:55:46 2010
#
# Accessible filesystems, by reference, are maintained under '/dev/disk'
# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info
#
/dev/vg_knox/lv_root		/		ext4	defaults	1 1
UUID=0f05f3ba-2977-4c68-b6ab-a579d9239913 /boot                   ext4    defaults        1 2
/dev/mapper/vg_knox-lv_swap swap                    swap    defaults        0 0
tmpfs                   /dev/shm                tmpfs   defaults        0 0
devpts                  /dev/pts                devpts  gid=5,mode=620  0 0
sysfs                   /sys                    sysfs   defaults        0 0
proc                    /proc                   proc    defaults        0 0
This fstab data appears to be the information that establishes that the file system in lv_root is to be mounted at /.

This fstab file is located in /etc which is not initially mounted.

Is this info du[plicted somewhere in "metadata" or are there pointers to this info?

This is the essence of my confusion.

I am grateful for what you have explained thuis far - if it makes sense maybe you could help me resolve the above?

Dick

Last edited by rmknox; 08-27-2010 at 02:36 PM.
 
Old 08-27-2010, 02:23 PM   #4
tommylovell
Member
 
Registered: Nov 2005
Distribution: Raspbian, Debian, Ubuntu
Posts: 380

Rep: Reputation: 103Reputation: 103
DIck, what distro are you using? Aha! You're Fedora. I think there are some subtle differences between distros.

acid_kewpie is correct, but he didn't back up all the way to the beginning. I'm not going to either. But speed forward from power on to your boot loader loading your kernel in, the initrd being loaded into RAM and mounted (initial RAM disk - it's an abbreviated filesystem in RAM), an initialization file (possibly an ash shell, possibly called "init") being passed control, initialization being done, eventually your real disk root filesystem is mounted/chroot'd to, and then /etc/fstab can finally be used to mount everything else (and even here it differs a little based on whether you have a System V or a BSD style of initialization - Fedora is system V).

Not terribly technically accurate, but you get the picture. You can actual "blow up" your initrd and look at what is inside of it. I differs from distro to distro and has even evolved over time within some distros (Fedora/Redhat/Centos) as to how it was actually done. So it's easy to be general and vague.

Last edited by tommylovell; 08-27-2010 at 03:09 PM.
 
Old 08-27-2010, 03:02 PM   #5
tommylovell
Member
 
Registered: Nov 2005
Distribution: Raspbian, Debian, Ubuntu
Posts: 380

Rep: Reputation: 103Reputation: 103
I was going to say "here are some of the gory details", but actually this is pretty elegant - and you have full control over what happens, so if you were developing an imbedded system you could target this to your hardware and not have to be so generalized...

Exploding a Fedora 10 initrd

Code:
drwxr-x--- 53 root root 4096 2010-08-27 15:38 ..
[root@athlonz ~]# mkdir initrdcontents
[root@athlonz ~]# cd initrdcontents/
[root@athlonz initrdcontents]# zcat /boot/initrd-2.6.27.41-170.2.117.fc10.x86_64.img | cpio -id
18030 blocks
[root@athlonz initrdcontents]# ls -lt
total 40
drwx------ 2 root root 4096 2010-08-27 15:44 bin
drwx------ 5 root root 4096 2010-08-27 15:44 etc
-rwx------ 1 root root 2034 2010-08-27 15:44 init
drwx------ 6 root root 4096 2010-08-27 15:44 lib
drwx------ 2 root root 4096 2010-08-27 15:44 lib64
drwx------ 2 root root 4096 2010-08-27 15:44 proc
lrwxrwxrwx 1 root root    3 2010-08-27 15:44 sbin -> bin
drwx------ 2 root root 4096 2010-08-27 15:44 sys
drwx------ 2 root root 4096 2010-08-27 15:44 sysroot
drwx------ 4 root root 4096 2010-08-27 15:44 usr
drwx------ 3 root root 4096 2010-08-27 15:44 dev
[root@athlonz initrdcontents]#
'init' gets passed control after the RAMdisk is loaded and mounted. Here's the contents. It is a nash script.

Code:
[root@athlonz initrdcontents]# cat init 
#!/bin/nash

mount -t proc /proc /proc
setquiet
echo Mounting proc filesystem
echo Mounting sysfs filesystem
mount -t sysfs /sys /sys
echo Creating /dev
mount -o mode=0755 -t tmpfs /dev /dev
mkdir /dev/pts
mount -t devpts -o gid=5,mode=620 /dev/pts /dev/pts
mkdir /dev/shm
mkdir /dev/mapper
echo Creating initial device nodes
mknod /dev/null c 1 3
mknod /dev/zero c 1 5
mknod /dev/systty c 4 0
mknod /dev/tty c 5 0
mknod /dev/console c 5 1
mknod /dev/ptmx c 5 2
mknod /dev/fb c 29 0
mknod /dev/tty0 c 4 0
mknod /dev/tty1 c 4 1
mknod /dev/tty2 c 4 2
mknod /dev/tty3 c 4 3
mknod /dev/tty4 c 4 4
mknod /dev/tty5 c 4 5
mknod /dev/tty6 c 4 6
mknod /dev/tty7 c 4 7
mknod /dev/tty8 c 4 8
mknod /dev/tty9 c 4 9
mknod /dev/tty10 c 4 10
mknod /dev/tty11 c 4 11
mknod /dev/tty12 c 4 12
mknod /dev/ttyS0 c 4 64
mknod /dev/ttyS1 c 4 65
mknod /dev/ttyS2 c 4 66
mknod /dev/ttyS3 c 4 67
/lib/udev/console_init tty0
daemonize --ignore-missing /bin/plymouthd
plymouth --show-splash
echo Setting up hotplug.
hotplug
echo Creating block device nodes.
mkblkdevs
echo Creating character device nodes.
mkchardevs
echo "Loading raid1 module"
modprobe -q raid1
echo "Loading raid456 module"
modprobe -q raid456
echo "Loading sata_nv module"
modprobe -q sata_nv
echo "Loading pata_acpi module"
modprobe -q pata_acpi
echo "Loading ata_generic module"
modprobe -q ata_generic
echo Making device-mapper control node
mkdmnod
modprobe scsi_wait_scan
rmmod scsi_wait_scan
mkblkdevs
mdadm -As --auto=yes --run /dev/md0
echo Scanning logical volumes
lvm vgscan --ignorelockingfailure
echo Activating logical volumes
lvm vgchange -ay --ignorelockingfailure  vgz00
resume UUID=b827e20f-db5b-47b2-be38-17489895a0ad
echo Creating root device.
mkrootdev -t ext3 -o defaults,ro UUID=54716048-c91b-4f48-b37e-fb09ce21e412
echo Mounting root filesystem.
mount /sysroot
cond -ne 0 plymouth --hide-splash
echo Setting up other filesystems.
setuproot
loadpolicy
plymouth --newroot=/sysroot
echo Switching to new root and running init.
switchroot
echo Booting has failed.
sleep -1
[root@athlonz initrdcontents]#
'switchroot' chroot's you over to the disk-based root filesystem.

According to the 'nash' manpage:

Quote:
switchroot newrootpath
Makes the filesystem mounted at newrootpath the new root filesystem by moving the mountpoint. This will only work in 2.6 or later kernels.
My assumption is that once we are chroot'd (switchroot'd?), /etc/rc.sysinit is given control, and it continues the system initialization.
 
1 members found this post helpful.
Old 08-27-2010, 07:36 PM   #6
rmknox
Member
 
Registered: May 2010
Posts: 354

Original Poster
Rep: Reputation: 34
tommylovell - fantastic
needless to say I need a little time to digest

cheers - thanks

dick
 
Old 08-27-2010, 08:07 PM   #7
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,125

Rep: Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120
It should be noted that the initrd is basically only there to provide enough support to mount the real (final) root. Could be esoteric hardware drivers - could be esoteric software drivers, LVM e.g.

So the initial premise was correct - in-kernel LVM support is insufficient to mount the root. The smarts have to be loaded beforehand - in the initrd. Then the real init is run.
(I'm not a great fan of LVM)
 
Old 08-27-2010, 09:04 PM   #8
rmknox
Member
 
Registered: May 2010
Posts: 354

Original Poster
Rep: Reputation: 34
sysg00
I haven't wanted to be to open about it, but it seems to me that LVM is an idea whose time has not come - at least for casual desktop users.

For someone running a multi drive system with changing needs - maybe - but I'm not even sure of that.

One thing is clear - it ups the ante as regards knowledge of arcane stuff, for one to manage his machine.

My impression is that the free Fedora thing is to get a group of beta test users to shake out stuff that is aimed at the big system users. In this context it may make sense.

If it weren't for LVM, in no time and with not much knowledge - using fdisk and tar - I beleive I could have cloned my system onto a smaller disk (boot from CD, partition my target disk, tar pipe tar the 2 partitions. Done.) As it is it's still an elusive goal.

Thank you both for your help.

Dick

Last edited by rmknox; 08-27-2010 at 09:22 PM.
 
Old 08-27-2010, 09:13 PM   #9
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,125

Rep: Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120
There is no requirement to use LVM - even on Enterprise systems. Just be aware of what the installer is going to use if you allow it to default.
Even on big systems I prefer to have all my "system" data (anything I need to recover the system) on non-LVM. The user data can go there if they want.
 
Old 08-27-2010, 09:33 PM   #10
Kenny_Strawn
Senior Member
 
Registered: Feb 2010
Location: /usa/ca/orange_county/lake_forest
Distribution: ArchBang, Google Android 2.1 + Motoblur (on Motortola Flipside), Google Chrome OS (on Cr-48)
Posts: 1,791
Blog Entries: 62

Rep: Reputation: 56
Quote:
Originally Posted by tommylovell View Post
I was going to say "here are some of the gory details", but actually this is pretty elegant - and you have full control over what happens, so if you were developing an imbedded system you could target this to your hardware and not have to be so generalized...

Exploding a Fedora 10 initrd

Code:
drwxr-x--- 53 root root 4096 2010-08-27 15:38 ..
[root@athlonz ~]# mkdir initrdcontents
[root@athlonz ~]# cd initrdcontents/
[root@athlonz initrdcontents]# zcat /boot/initrd-2.6.27.41-170.2.117.fc10.x86_64.img | cpio -id
18030 blocks
[root@athlonz initrdcontents]# ls -lt
total 40
drwx------ 2 root root 4096 2010-08-27 15:44 bin
drwx------ 5 root root 4096 2010-08-27 15:44 etc
-rwx------ 1 root root 2034 2010-08-27 15:44 init
drwx------ 6 root root 4096 2010-08-27 15:44 lib
drwx------ 2 root root 4096 2010-08-27 15:44 lib64
drwx------ 2 root root 4096 2010-08-27 15:44 proc
lrwxrwxrwx 1 root root    3 2010-08-27 15:44 sbin -> bin
drwx------ 2 root root 4096 2010-08-27 15:44 sys
drwx------ 2 root root 4096 2010-08-27 15:44 sysroot
drwx------ 4 root root 4096 2010-08-27 15:44 usr
drwx------ 3 root root 4096 2010-08-27 15:44 dev
[root@athlonz initrdcontents]#
'init' gets passed control after the RAMdisk is loaded and mounted. Here's the contents. It is a nash script.

Code:
[root@athlonz initrdcontents]# cat init 
#!/bin/nash

mount -t proc /proc /proc
setquiet
echo Mounting proc filesystem
echo Mounting sysfs filesystem
mount -t sysfs /sys /sys
echo Creating /dev
mount -o mode=0755 -t tmpfs /dev /dev
mkdir /dev/pts
mount -t devpts -o gid=5,mode=620 /dev/pts /dev/pts
mkdir /dev/shm
mkdir /dev/mapper
echo Creating initial device nodes
mknod /dev/null c 1 3
mknod /dev/zero c 1 5
mknod /dev/systty c 4 0
mknod /dev/tty c 5 0
mknod /dev/console c 5 1
mknod /dev/ptmx c 5 2
mknod /dev/fb c 29 0
mknod /dev/tty0 c 4 0
mknod /dev/tty1 c 4 1
mknod /dev/tty2 c 4 2
mknod /dev/tty3 c 4 3
mknod /dev/tty4 c 4 4
mknod /dev/tty5 c 4 5
mknod /dev/tty6 c 4 6
mknod /dev/tty7 c 4 7
mknod /dev/tty8 c 4 8
mknod /dev/tty9 c 4 9
mknod /dev/tty10 c 4 10
mknod /dev/tty11 c 4 11
mknod /dev/tty12 c 4 12
mknod /dev/ttyS0 c 4 64
mknod /dev/ttyS1 c 4 65
mknod /dev/ttyS2 c 4 66
mknod /dev/ttyS3 c 4 67
/lib/udev/console_init tty0
daemonize --ignore-missing /bin/plymouthd
plymouth --show-splash
echo Setting up hotplug.
hotplug
echo Creating block device nodes.
mkblkdevs
echo Creating character device nodes.
mkchardevs
echo "Loading raid1 module"
modprobe -q raid1
echo "Loading raid456 module"
modprobe -q raid456
echo "Loading sata_nv module"
modprobe -q sata_nv
echo "Loading pata_acpi module"
modprobe -q pata_acpi
echo "Loading ata_generic module"
modprobe -q ata_generic
echo Making device-mapper control node
mkdmnod
modprobe scsi_wait_scan
rmmod scsi_wait_scan
mkblkdevs
mdadm -As --auto=yes --run /dev/md0
echo Scanning logical volumes
lvm vgscan --ignorelockingfailure
echo Activating logical volumes
lvm vgchange -ay --ignorelockingfailure  vgz00
resume UUID=b827e20f-db5b-47b2-be38-17489895a0ad
echo Creating root device.
mkrootdev -t ext3 -o defaults,ro UUID=54716048-c91b-4f48-b37e-fb09ce21e412
echo Mounting root filesystem.
mount /sysroot
cond -ne 0 plymouth --hide-splash
echo Setting up other filesystems.
setuproot
loadpolicy
plymouth --newroot=/sysroot
echo Switching to new root and running init.
switchroot
echo Booting has failed.
sleep -1
[root@athlonz initrdcontents]#
'switchroot' chroot's you over to the disk-based root filesystem.

According to the 'nash' manpage:



My assumption is that once we are chroot'd (switchroot'd?), /etc/rc.sysinit is given control, and it continues the system initialization.
How come when I run cat /sbin/init I get a bunch of weird machine code?
 
Old 08-27-2010, 11:08 PM   #11
tommylovell
Member
 
Registered: Nov 2005
Distribution: Raspbian, Debian, Ubuntu
Posts: 380

Rep: Reputation: 103Reputation: 103
Kenny, that's the init executable in your real /sbin on your real disk root filesystem.

The init I showed was the one that is imbedded in the initial RAMdisk (initrd). They just happen to have the same name. I'm not certain why the Fedora team chose to name it that. It clearly is confusing. It would have made more sense to call it 'init.sh' or something like that to differentiate it from the 'init' executable.

Code:
[root@athlonz ~]# file /sbin/init
/sbin/init: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.9, stripped

[root@athlonz ~]# cd initrdcontents/
[root@athlonz initrdcontents]# file init
init: a /bin/nash script text executable
[root@athlonz initrdcontents]#
btw, I think the init nash script in initrd had a different name once upon a time. Maybe back in the 2.4 kernel days.
 
Old 08-27-2010, 11:28 PM   #12
tommylovell
Member
 
Registered: Nov 2005
Distribution: Raspbian, Debian, Ubuntu
Posts: 380

Rep: Reputation: 103Reputation: 103
Kenny, and to make life more complicated, this differs slightly on Ubuntu. (Your profile shows you run Ubuntu.)

Here's the same thing on Ubuntu that I showed on Fedora. In this case the init script is a very long bash script.

Code:
root@tommy-laptop:/home/tommy# mkdir initcontents

root@tommy-laptop:/home/tommy# cd initcontents/

root@tommy-laptop:/home/tommy/initcontents# zcat /boot/initrd.img-2.6.32-24-generic | cpio -id
41139 blocks

root@tommy-laptop:/home/tommy/initcontents# ls -l
total 36
drwxr-xr-x 2 root root 4096 2010-08-28 00:14 bin
drwxr-xr-x 3 root root 4096 2010-08-28 00:14 conf
drwxr-xr-x 7 root root 4096 2010-08-28 00:14 etc
-rwxr-xr-x 1 root root 5145 2010-08-28 00:14 init
drwxr-xr-x 5 root root 4096 2010-08-28 00:14 lib
drwxr-xr-x 2 root root 4096 2010-08-28 00:14 sbin
drwxr-xr-x 9 root root 4096 2010-08-28 00:14 scripts
drwxr-xr-x 3 root root 4096 2010-08-28 00:14 var

root@tommy-laptop:/home/tommy/initcontents# file init
init: POSIX shell script text executable

root@tommy-laptop:/home/tommy/initcontents# cat init
#!/bin/sh

[ -d /dev ] || mkdir -m 0755 /dev
[ -d /root ] || mkdir -m 0700 /root
[ -d /sys ] || mkdir /sys
[ -d /proc ] || mkdir /proc
[ -d /tmp ] || mkdir /tmp
mkdir -p /var/lock
mount -t sysfs -o nodev,noexec,nosuid none /sys 
mount -t proc -o nodev,noexec,nosuid none /proc 

grep -q '\<quiet\>' /proc/cmdline || echo "Loading, please wait..."

# Note that this only becomes /dev on the real filesystem if udev's scripts
# are used; which they will be, but it's worth pointing out
if ! mount -t devtmpfs -o mode=0755 none /dev; then
	mount -t tmpfs -o mode=0755 none /dev
	mknod -m 0600 /dev/console c 5 1
	mknod /dev/null c 1 3
fi
mkdir /dev/pts
mount -t devpts -o noexec,nosuid,gid=5,mode=0620 none /dev/pts || true
> /dev/.initramfs-tools
mkdir /dev/.initramfs

# Export the dpkg architecture
export DPKG_ARCH=
. /conf/arch.conf

# Set modprobe env
export MODPROBE_OPTIONS="-qb"

# Export relevant variables
export ROOT=
export ROOTDELAY=
export ROOTFLAGS=
export ROOTFSTYPE=
export IPOPTS=
export HWADDR=
export break=
export init=/sbin/init
export quiet=n
export readonly=y
export rootmnt=/root
export debug=
export panic=
export blacklist=
export resume_offset=

# Bring in the main config
. /conf/initramfs.conf
for conf in conf/conf.d/*; do
	[ -f ${conf} ] && . ${conf}
done
. /scripts/functions

# Parse command line options
for x in $(cat /proc/cmdline); do
	case $x in
	init=*)
		init=${x#init=}
		;;
	root=*)
		ROOT=${x#root=}
		case $ROOT in
		LABEL=*)
			ROOT="${ROOT#LABEL=}"

			# support / in LABEL= paths (escape to \x2f)
			case "${ROOT}" in
			*[/]*)
			if [ -x "$(command -v sed)" ]; then
				ROOT="$(echo ${ROOT} | sed 's,/,\\x2f,g')"
			else
				if [ "${ROOT}" != "${ROOT#/}" ]; then
					ROOT="\x2f${ROOT#/}"
				fi
				if [ "${ROOT}" != "${ROOT%/}" ]; then
					ROOT="${ROOT%/}\x2f"
				fi
				IFS='/'
				newroot=
				for s in $ROOT; do
					if [ -z "${newroot}" ]; then
						newroot="${s}"
					else
						newroot="${newroot}\\x2f${s}"
					fi
				done
				unset IFS
				ROOT="${newroot}"
			fi
			esac
			ROOT="/dev/disk/by-label/${ROOT}"
			;;
		UUID=*)
			ROOT="/dev/disk/by-uuid/${ROOT#UUID=}"
			;;
		/dev/nfs)
			[ -z "${BOOT}" ] && BOOT=nfs
			;;
		esac
		;;
	rootflags=*)
		ROOTFLAGS="-o ${x#rootflags=}"
		;;
	rootfstype=*)
		ROOTFSTYPE="${x#rootfstype=}"
		;;
	rootdelay=*)
		ROOTDELAY="${x#rootdelay=}"
		case ${ROOTDELAY} in
		*[![:digit:].]*)
			ROOTDELAY=
			;;
		esac
		;;
	resumedelay=*)
		RESUMEDELAY="${x#resumedelay=}"
		;;
	loop=*)
		LOOP="${x#loop=}"
		;;
	loopflags=*)
		LOOPFLAGS="-o ${x#loopflags=}"
		;;
	loopfstype=*)
		LOOPFSTYPE="${x#loopfstype=}"
		;;
	cryptopts=*)
		cryptopts="${x#cryptopts=}"
		;;
	nfsroot=*)
		NFSROOT="${x#nfsroot=}"
		;;
	netboot=*)
		NETBOOT="${x#netboot=}"
		;;
	ip=*)
		IPOPTS="${x#ip=}"
		;;
	hwaddr=*)
		HWADDR="${x#hwaddr=}"
		;;
	boot=*)
		BOOT=${x#boot=}
		;;
	resume=*)
		RESUME="${x#resume=}"
		;;
	resume_offset=*)
		resume_offset="${x#resume_offset=}"
		;;
	noresume)
		noresume=y
		;;
	panic=*)
		panic="${x#panic=}"
		case ${panic} in
		*[![:digit:].]*)
			panic=
			;;
		esac
		;;
	quiet)
		quiet=y
		;;
	ro)
		readonly=y
		;;
	rw)
		readonly=n
		;;
	debug)
		debug=y
		quiet=n
		exec >/dev/.initramfs/initramfs.debug 2>&1
		set -x
		;;
	debug=*)
		debug=y
		quiet=n
		set -x
		;;
	break=*)
		break=${x#break=}
		;;
	break)
		break=premount
		;;
	blacklist=*)
		blacklist=${x#blacklist=}
		;;
	netconsole=*)
		netconsole=${x#netconsole=}
		;;
	esac
done

if [ -z "${noresume}" ]; then
	export resume=${RESUME}
else
	export noresume
fi

[ -n "${netconsole}" ] && modprobe netconsole netconsole=${netconsole}

maybe_break top

# export BOOT variable value for compcache,
# so we know if we run from casper
export BOOT

# Don't do log messages here to avoid confusing usplash
run_scripts /scripts/init-top

maybe_break modules
log_begin_msg "Loading essential drivers..."
load_modules
log_end_msg

maybe_break premount
[ "$quiet" != "y" ] && log_begin_msg "Running /scripts/init-premount"
run_scripts /scripts/init-premount
[ "$quiet" != "y" ] && log_end_msg

maybe_break mount
log_begin_msg "Mounting root file system..."
. /scripts/${BOOT}
parse_numeric ${ROOT}
mountroot
log_end_msg

maybe_break bottom
[ "$quiet" != "y" ] && log_begin_msg "Running /scripts/init-bottom"
run_scripts /scripts/init-bottom
[ "$quiet" != "y" ] && log_end_msg

# Move virtual filesystems over to the real filesystem
mount -n -o move /sys ${rootmnt}/sys
mount -n -o move /proc ${rootmnt}/proc

# Check init bootarg
if [ -n "${init}" ] && [ ! -x "${rootmnt}${init}" ]; then
	echo "Target filesystem doesn't have ${init}."
	init=
fi

# Search for valid init
if [ -z "${init}" ] ; then
	for init in /sbin/init /etc/init /bin/init /bin/sh; do
		if [ ! -x "${rootmnt}${init}" ]; then
			continue
		fi
		break
	done
fi

# No init on rootmount
if [ ! -x "${rootmnt}${init}" ]; then
	panic "No init found. Try passing init= bootarg."
fi

# Confuses /etc/init.d/rc
if [ -n ${debug} ]; then
	unset debug
fi

# Chain to real filesystem
maybe_break init
exec run-init ${rootmnt} ${init} "$@" <${rootmnt}/dev/console >${rootmnt}/dev/console 2>&1
panic "Could not execute run-init."
root@tommy-laptop:/home/tommy/initcontents#
 
Old 08-27-2010, 11:57 PM   #13
tommylovell
Member
 
Registered: Nov 2005
Distribution: Raspbian, Debian, Ubuntu
Posts: 380

Rep: Reputation: 103Reputation: 103
syg00 and rmknox, LVM2 is improving. It still has bugs. LVM1 was hopeless. Just hopelessly bug ridden.

But even with its warts LVM2 is quite useful at times.

Case 1: one of my home machines - Fedora - multiple drives that I have in RAID1 pairs.

To replace a pair of RAID1 drives: physically add the new drives; partition the new ones; set them up as RAID1; pvcreate the new RAID md device; vgextend the root VG; pvmove the old md device to the new one; install grub on the new drive; vgreduce the root VG to remove the old md device; pvremove the old md device; physically remove the old drives; ta-da, you didn't have to reinstall. A non-boot disk is even easier.

Case 2: In work I have a system with 3.1TB of disk on 127 26GB SAN LUNS.

Upside: you can create some really large filesystems.

Downside: the LVM metadata is written on every LUN. When you make changes or even just do an 'lvs' command it can take a considerable amount of time (I think it has to validate the metadata on every physical volume - all 127 of them.)

Like I said, it's got warts.

(yes, i know that you don't HAVE to put metadata on every drive, but in this case i think you do. what if two LUNS were to come up in a different order? ...)

Last edited by tommylovell; 08-28-2010 at 12:00 AM.
 
Old 08-28-2010, 02:19 AM   #14
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,125

Rep: Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120
The dm (lack of) integration with LVM was what annoyed me. And the apparent design presumption that the user would only ever be expanding allocations.
Things are better, but I just think it's bad design to lump another block device layer on top of what's already there. I wonder if recent changes are in response to things like zfs and btrfs - the latter has a way to go still, but has to be a better option.
IMHO ...
 
Old 08-28-2010, 10:01 AM   #15
rmknox
Member
 
Registered: May 2010
Posts: 354

Original Poster
Rep: Reputation: 34
tommylovell and sysg00

I want to replace my larger than needed single hard drive with a moderately oversized hard drive

While I haven't worked thropugh all the steps yet, it sounds like case1 above is a model for what I want to do.

Am I right?

Dick

tommylovell

Your two examples seem to confirm my impression - that this tool fills a need for sophisticated installations (raid / terrabyte) and that need may not exist for "simple sit at the command line and edit -- complile -- test programs" systems.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
bluetooth before operating system loads schneidz Linux - Embedded & Single-board computer 4 03-15-2010 10:41 AM
Grub confused about File System cov Linux - General 12 05-29-2009 01:46 AM
Suse 9.0 SYSTEM slow, net loads fine... oicdn Linux - Software 0 11-27-2004 10:07 AM
System freezes after 2.6.7 kernel loads R00ts Linux - Software 5 07-26-2004 07:07 PM
System keeps rebooting after Kernel Loads codeviking Linux - Software 4 10-19-2003 09:02 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 03:02 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration