Portal Home > Knowledgebase > Articles Database > Format Server & Install OS Over SSH


Format Server & Install OS Over SSH




Posted by acompw, 03-26-2005, 02:27 PM
Hello, How can format a remote server over ssh, preserve a ssh session, and install an operating system such as CentOS or Fedora via SSH? I need the entire server hard drive formatted. I am sure I can do it through fdisk but I am a bit rusty with my linux. I would appreciate any help. Acompw

Posted by vpnwifi, 03-26-2005, 03:48 PM
Dear acompw, The problem with formatting a computer that is currently running the ssh session is that once you delete the ssh binary you will have no more ssh. I have no idea what you setup is, but a few suggestions would be. Get someone who works at the data center to boot the computer off a cd so you can do work on the HD while you are logged into the computer that is booted of the cdrom. Or what you could do if you have the ability to change the partition size then you can make a new partition or a second HD to install the new OS onto. So you leave the old OS alone install the new OS and then just change around the grub.conf or the lilo.conf. There are other sutch options, sutch as KVM over ip or serial connections but those are the two that are most likely suitable for your needs.

Posted by hytek, 03-26-2005, 03:50 PM
A solution that provides real console access would let you do this provided you have everything planned out. It usually is just much easier to let your provider do the reformat and re-install.

Posted by cperciva, 03-26-2005, 03:59 PM
I've done this using my depenguinator. The idea is to load the operating system (including sshd) into a memory disk and run out of that until you've finished formatting and installing onto the hard drive.

Posted by error404, 03-26-2005, 05:21 PM
If you're targeting a Debian-based distribution, there's always debootstrap as well.

Posted by acompw, 03-26-2005, 05:26 PM
Problem resolved but I was looking for an apple like that. Thanks

Posted by sehe, 03-26-2005, 06:27 PM
bit late, but wanted to test it first, custom initrd which boots basic system with sshd, this way you dont need to write to the disk while its still mounted

Posted by EXOWorks, 03-27-2005, 04:43 AM
lol @ de-penguinate !! I don't like daemons .. They are evil Well that's really good information ..

Posted by EgyKit, 03-06-2012, 03:23 PM
Hello, I know this is a very old thread, but I have an important comment I had a vps before and it was deleted and the vps host said that some hacker get into my vps and forced the OS to reload and all data has been deleted!!!! Now after I saw this thread and verified that it can't be made via SSH or php script like they have said, I'm sure now that this was made intentionally and they deleted my vps and they have stolen me Last edited by EgyKit; 03-06-2012 at 03:34 PM.



Was this answer helpful?

Add to Favourites Add to Favourites    Print this Article Print this Article

Also Read
Could you tracert (Views: 831)
SecuredServers down? (Views: 826)

Language: