Re: auto-assembling arrays without a configuration file

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 14:48, Keld Jørn Simonsen wrote:

> Hmm, I am still looking for a way to boot a linúx raid as root.

Here's an init script that works for me on a server that has its root
partition on a software raid5 on /dev/md1. It uses busybox for all
commands except mdadm.

	#! /bin/sh
	export PATH=/bin:/sbin
	echo initramfs startup

	cat > /etc/fstab << EOF
	proc /proc proc defaults 0 0
	sysfs /sys sysfs rw 0 0
	EOF

	cat > /etc/mdev.conf << EOF
	null 0:0 666
	ptmx 0:0 666
	EOF

	mount /proc
	mount /sys
	mdev -s
	mknod /dev/md1 b 9 1
	echo 'DEVICE partitions' > /etc/mdadm/mdadm.conf
	mdadm -E --scan >> /etc/mdadm/mdadm.conf
	mdadm -A --scan || sh
	mount -oro /dev/md1 /mnt || sh
	mount --move /proc /mnt/proc
	mount --move /sys /mnt/sys
	cd /mnt
	mount --move . /
	exec chroot . /sbin/init 2 > /dev/console 2>/dev/console < /dev/console

Andre
-- 
The only person who always got his work done by Friday was Robinson Crusoe

Attachment: signature.asc
Description: Digital signature


[Index of Archives]     [Linux RAID Wiki]     [ATA RAID]     [Linux SCSI Target Infrastructure]     [Linux Block]     [Linux IDE]     [Linux SCSI]     [Linux Hams]     [Device Mapper]     [Device Mapper Cryptographics]     [Kernel]     [Linux Admin]     [Linux Net]     [GFS]     [RPM]     [git]     [Yosemite Forum]


  Powered by Linux