[CentOS] CentOS Live CD for System Rescue - How to get full root access to HD?

Tue Nov 11 14:10:37 UTC 2008
Robert <kerplop at sbcglobal.net>


Lanny Marcus wrote:
> Booting from the CentOS 5.2 Installation DVD (or the first
> Installation CD), one can type "linux rescue" and then "chroot
> /mnt/sysimage" and have full root access to the OS  on the HD. For
> future reference, I would like to know what I did wrong, the past
> couple of days, when trying to use the CentOS 5.2 i386 Live CD, for
> rescue. From a terminal, "su -" did not seem to get me root access to
> the hard drive. What command should I have used, with the Live CD? The
> access I had was read only. (As it turns out, I could have fixed the
> problem, without the LiveCD, but I didn't know that, 3 days ago....
> :-)   )  TIA.  Lanny
>   
Referring to one of your earlier posts,

        [centos at localhost ~]$ mount
        /dev/mapper/livecd-rw on / type ext3 (rw,noatime)
        proc on /proc type proc (rw)
        sysfs on /sys type sysfs (rw)
        devpts on /dev/pts type devpts (rw,gid=5,mode=620)
        tmpfs on /dev/shm type tmpfs (rw)
        none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
        /dev/hdc on /mnt/live type iso9660 (ro)
        /dev/hda2 on /mnt/disc/hda2 type ext3 (ro)
        /dev/mapper/VolGroup00-LogVol00 on /mnt/lvm/VolGroup00-LogVol00 type ext3 (ro)
        sunrpc on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw)

the boot partition, /dev/hda2 was mounted Read-Only (ro).
To work around that little problem, simply:
# mount /dev/hda2 -o rw,remount
which remounts the partition Read-Write so you can work with it instead 
of only observe.
Now, I believe the Live CD is missing the chroot command.  This means 
you have to do the "bookkeeping" manually.  The grub.conf file (normally 
at  /boot/grub/grub.conf) will now appear at 
/mnt/disc/hda2/grub/grub.conf.  Note that there is no "/boot" in that path.

And yes, the farther you are from the monitor, the clearer it all becomes.