- Boot the target with root file system over NFS.
- Create the necessary partitions on your disk drive:
you need at last a swap partition and a file system partition.
bash-3.00# fdisk -l
Disk /dev/sda: 36.9 GB, 36951490048 bytes
64 heads, 32 sectors/track, 35239 cylinders
Units = cylinders of 2048 * 512 = 1048576 bytes
Device Boot Start End Blocks Id System
/dev/sda1 1 978 1001456 82 Linux swap / Solaris
/dev/sda2 979 12423 11719680 83 Linux
/dev/sda3 12424 23868 11719680 83 Linux
/dev/sda4 23869 35239 11643904 83 Linux
- Format the partititons:
bash-3.00# mkswap /dev/sda1
bash-3.00# mke2fs -j -m1 /dev/sda2
- Mount the file system:
bash-3.00# mount /dev/sda2 /mnt
- Copy the content of the (NFS) root file system into the mounted file
system:
bash-3.00# tar --one-file-system -c -f - / | ( cd /mnt ; tar xpf - )
- Adjust
/etc/fstab for the disk file system:
bash-3.00# vi /mnt/etc/fstab
bash-3.00# cat /mnt/etc/fstab
/dev/sda2 / ext3 defaults 1 1
/dev/sda1 swap swap defaults 0 0
proc /proc proc defaults 0 0
sysfs /sys sysfs defaults 0 0
- Adjust
/etc/rc.sysinit for running from local disk; remove the
following comments:
bash-3.00# diff -u /mnt/etc/rc.sysinit.ORIG /mnt/etc/rc.sysinit
--- /mnt/etc/rc.sysinit.ORIG 2007-01-21 04:37:00.000000000 +0100
+++ /mnt/etc/rc.sysinit 2007-03-02 10:58:22.000000000 +0100
@@ -460,9 +460,9 @@
# Remount the root filesystem read-write.
update_boot_stage RCmountfs
-#state=`LC_ALL=C awk '/ \/ / && ($3 !~ /rootfs/) { print $4 }' /proc/mounts`
-#[ "$state" != "rw" -a "$READONLY" != "yes" ] && \
-# action $"Remounting root filesystem in read-write mode: " mount -n -o remount,rw /
+state=`LC_ALL=C awk '/ \/ / && ($3 !~ /rootfs/) { print $4 }' /proc/mounts`
+[ "$state" != "rw" -a "$READONLY" != "yes" ] && \
+ action $"Remounting root filesystem in read-write mode: " mount -n -o remount,rw /
# Clean up SELinux labels
if [ -n "$SELINUX" ]; then
- Unmount disk:
bash-3.00# umount /mnt
- Reboot, and adjust boot arguments to use disk partition as root file system
=> setenv diskargs setenv bootargs root=/dev/sda2 ro
=> setenv net_disk 'tftp ${loadaddr} ${bootfile};run diskargs addip addcons;bootm'
=> saveenv
- Boot with these settings
=> run net_disk