LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 10-10-2010, 06:31 AM   #1
Al-Kateb
LQ Newbie
 
Registered: Oct 2010
Posts: 6

Rep: Reputation: 0
How to install Centos from rescue mode?


Hello, i have a server which i have no physical access to, all i can do is boot in rescue mode from a live debian CD

and i want to know of a way to install CentOS from iso image or maybe NFS? on that server using this debian live CD.

since it's live CD i can't mount the iso image and boot from it cos after reboot nothing will be preserved.

so the case in breif is, i am booted form debian live cd and i want to install CentOS on the machine from that system using iso image

thanks
 
Old 10-10-2010, 08:50 AM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
If your Debian Live CD can see all disks and has a network connection you could:
- partition the first harddisk to at least have one ext2/ext3 primary partition ("/boot"?) that will hold the unpacked kernel and initrd (9 megs total),
- install GRUB in this partition,
- download CentOS-5.5-i386-netinstall.iso, loop-mount it and copy isolinux/initrd.img and isolinux/vmlinuz to the partition,
- edit /boot/grub/grub.conf so it looks something like
Code:
root (hd0,0)
default=0
timeout=0

title netinstall
 root (hd0,0)
 kernel /vmlinuz ks=nfs:192.168.0.1:/kicks/ks.cfg
 initrd /initrd.img
where "ks=" means you're using a previously kickstart file like
Code:
# Kickstart file automatically generated by anaconda.
install
nfs –server=192.168.0.1 –dir=/exports/CentOS_5.5_i386
lang en_US.UTF-8
keyboard us
network –device eth0 –bootproto dhcp –hostname centos
rootpw –iscrypted [INSERTCRYPTEDPASSWORDHERE]
firewall –enabled –port=22:tcp
authconfig –enableshadow –enablemd5
selinux –enforcing
timezone –utc America/New_York
bootloader –location=mbr –driveorder=sda
clearpart –all –drives=sda
part /boot –fstype ext3 –size=100 –ondisk=sda
part pv.2 –size=0 –grow –ondisk=sda
volgroup VolGroup00 –pesize=32768 pv.2
logvol swap –fstype swap –name=LogVol01 –vgname=VolGroup00 –size=256 –grow –maxsize=512
logvol / –fstype ext3 –name=LogVol00 –vgname=VolGroup00 –size=1024 –grow
%packages
@editors
@text-internet
@core
@base
@network-server
@web-server
@server-cfg
@admin-tools
device-mapper-multipath
and "nfs:" means you'll be using a NFS share (you previously set up) at address "192.168.0.1" and where the Kickstart file can be found at ":/kicks/ks.cfg" and the packages from the full ISO at "/exports/CentOS_5.5_i386".
I'm not giving any guarantee this will work and this is only an outline. I suggest you set up VMware, QEmu or VirtualBox to test out this hypothesis. YMMV (VM)

* Another way, if you know the first harddisks HW details and have an exact remote replica to use, could be to perform a minimal CLI-only installation of Centos on that replica and use 'netcat' to 'dd' the remote image directly to the server.
 
1 members found this post helpful.
Old 10-10-2010, 11:28 AM   #3
Al-Kateb
LQ Newbie
 
Registered: Oct 2010
Posts: 6

Original Poster
Rep: Reputation: 0
Thanks a lot for your help, I'm gonna try this on virtual box first as you recommended and see what it will result into.

but i have a question, in this case we mounted the drive on / directory.

and during installation we are reformatting the hard drive! is this ok? things are all loaded to ram removing them won't be a problem?

i have 2 hard drives on that machine so what would i modify in the grub.conf and the ks file to load the files from the other hard drive instead of the network?

now there is the other case i wish you to help me figure:

if say i want to do it in alternative way, i have the CentOS iso image, and i downloaded it on the second hard drive then mounted it.

i have KVM connected so i don't have problem following up the machine while it's booting.

how should i edit grub to make it boot from that iso image?

and after it boots from the iso image! will i be able to unmount the first hard drive so i can be able to partition it again?

i forgot to mention that i already have CentOs installed and all i want is clean re-installation.

so in brief:

i have debian live CD in the CD-ROM
i have KVM over IP
i have 2 hard drives sda and sdb
i have Centos isntalled on one sda
and i have Centos installation iso on sdb

i assume the procedure will be:

booting into my system normally and mounting the iso image:
Quote:
mount /hard2/centos.iso /mnt/iso/ -t iso9660 -o ro,loop=/dev/loop0
i can't figure how to edit grub though

then after that i will find the option in the grub loader? to boot from the iso file? after that i will be able to continue with the installation since I'm now booted from the iso image to format the first hard drive and reinstall the the centos.

when the installation is complete i should reboot to see the new grub loader and chose boot from the new system

is what i mention above possible? cos i did some search and found couple of ppl saying it's not possible to boot from iso image.

waiting for your replies

thanks
 
Old 10-10-2010, 04:30 PM   #4
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Quote:
Originally Posted by Al-Kateb View Post
in this case we mounted the drive on / directory. and during installation we are reformatting the hard drive! is this ok? things are all loaded to ram removing them won't be a problem?
Which drive? When booting the kernel will load in RAM so it doesn't matter where you mounted the ISO previously.


Quote:
Originally Posted by Al-Kateb View Post
i have 2 hard drives on that machine so what would i modify in the grub.conf and the ks file to load the files from the other hard drive instead of the network?
Since you have KVM access I'd say just get GRUB to boot the extracted netinstall ISO kernel, forget the Kickstart ks file and just do a network installation. Using a regular Centos CDROM or DVD it should offer file:// and http:// install but I'm not sure the netinstall will. Check the Centos Wiki or Red Hat documentation to make certain (or just boot the ISO in your VMware, QEmu or VirtualBox).


Quote:
Originally Posted by Al-Kateb View Post
how should i edit grub to make it boot from that iso image?
As far as I know the version of GRUB Centos uses doesn't do ISO boots, you'd need GRUB 2 for that. Installing that shouldn't be a problem either as the installation will overwrite GRUB anyway.


Quote:
Originally Posted by Al-Kateb View Post
and after it boots from the iso image! will i be able to unmount the first hard drive so i can be able to partition it again?
Extracted kernel boots Linux in RAM, shoud not be a problem.


Quote:
Originally Posted by Al-Kateb View Post
i forgot to mention that i already have CentOs installed and all i want is clean re-installation.
Any particular reason why? Since you already have a Centos installation you only need to extract the kernel as instructed before, add it to GRUB, boot it and proceed with the installation.
 
1 members found this post helpful.
Old 10-12-2010, 05:47 AM   #5
Al-Kateb
LQ Newbie
 
Registered: Oct 2010
Posts: 6

Original Poster
Rep: Reputation: 0
Quote:
Any particular reason why? Since you already have a Centos installation you only need to extract the kernel as instructed before, add it to GRUB, boot it and proceed with the installation.
Thanks a lot for your help, everything is working fine on the virtual box so i should be fine to proceed and do it on the server.

well as for re-installation, this server is a testing server and i messed it up very bad and now lots of files are missing and there are lots of applications installed on it.

i decided to lunch web hosting service on that server, and will install cPanel and you know cPanel needs fresh server otherwise things might not work as expected. so i will re-install CentOS for that.

after all i guess i might just ask the provider to insert a CentOS installation DVD in the DVD-ROM tray, this will make it much faster and easier.
 
Old 10-13-2010, 05:17 PM   #6
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Quote:
Originally Posted by Al-Kateb View Post
i might just ask the provider to insert a CentOS installation DVD
ROTFL. Indeed that should be the most efficient option.
 
  


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
initrd and rescue mode Centos quinox10 Linux - General 2 03-11-2009 03:22 AM
CentOS: how to launch it into rescue mode? concoran Linux - Newbie 1 05-23-2008 06:24 AM
Howto use a rescue mode install cd ....with images for some problems aus9 LinuxQuestions.org Member Success Stories 1 03-13-2008 12:33 AM
Linux Rescue script question, in rescue mode vijay_aras Linux - General 1 01-09-2008 05:03 PM
how to install grub using fc 4 installation cd .the cd has rescue mode amolgupta Linux - Software 2 03-15-2006 02:14 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 03:37 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