On 4/22/05, Logu <[EMAIL PROTECTED]> wrote: > Hi, > > I have gone through the pivot_root man pages and some internet pages. But I > could not clearly understand the command (or system call) syntax which says > "pivot_root new_root put_old". > >
Read the initrd.txt file in the kernel/Documentation. It is the way most of the systems like redhat boot with the initrd file. The initrd file is a small ram based file system which is used for loading some basic modules. Mostly the ext3fs modules in redhat. You can try gunzip ing and mounting the initrd file using a loop back device. On my FC3 [EMAIL PROTECTED] boot]# cp initrd-2.6.9-1.667.img /root/initrd.gz [EMAIL PROTECTED] boot]# cd [EMAIL PROTECTED] ~]# gunzip initrd.gz OMG, its not working. I am not sure wats new with initrd. Did redhat/fedora do something with the initrd file? I tried the usual stuff i do with redhat 7.3 or redhat 9.0... [EMAIL PROTECTED] ~]# cp /boot/initrd-2.4.20-8.img initrd.gz [EMAIL PROTECTED] ~]# gunzip initrd.gz [EMAIL PROTECTED] ~]# mount -o loop initrd /temp2 [EMAIL PROTECTED] ~]# cat /temp2/linuxrc #!/bin/nash echo "Loading jbd.o module" insmod /lib/jbd.o echo "Loading ext3.o module" insmod /lib/ext3.o echo Mounting /proc filesystem mount -t proc /proc /proc echo Creating block devices mkdevices /dev echo Creating root device mkrootdev /dev/root echo 0x0100 > /proc/sys/kernel/real-root-dev echo Mounting root filesystem mount -o defaults --ro -t ext3 /dev/root /sysroot pivot_root /sysroot /sysroot/initrd umount /initrd/proc There you can see pivot_root being called. Redhat maintains a directory /initrd which is used as an old root. Try deleting this directory and you system will not boot!! old root is the small filesystem (initrd) that was used to load the modules and has some very basic set of utilities. new root is the actual root file system that needs to be booted. ------------------------------------------------------- SF email is sponsored by - The IT Product Guide Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_ide95&alloc_id396&op=click _______________________________________________ linux-india-help mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/linux-india-help
