I have a lot of linux systems running in places where I can only access them over SSH, the problem is that I need to write over the system harddrive on those systems to update them. I wonder about the best way to do this?
3 Answers
I would suggest creating a 2. Partition, install everything chrooted to this Partition and configure Grub to try to boot the new system on startup, I would also configure a Fail over so that Grub only tires to boot the new system the next time, and then again boots the old system if it fails and you reboot again. When everything is running fine configure Grub to boot the new system by default, and you can erease the old one. After all is done you can recombine the Partions if you like, but it might be smart to keep them around just in case you are doing something like this again.
-
-
Well I don't see anything you can't do via SSH, partition creation can bedone via fdisk ie, I don't know from the top of my head wether it can shrik Partitions but there is a way to do this. Configuring Grub is just a Textfile, and issue a reboot command is not a problem, as well as installing a System in a chroot. I guess the only problem would be a 2. reboot if the new system fails to boot, but even a really simple host offers some way to reboot the server. Feb 12, 2010 at 14:04
-
I was thinking about something like this, I was also wondering if I could make a ramdisk and chroot to that one and work from there so I don't have to reboot in between only after the work is done. But I don't know if this is possible.– OlaFeb 12, 2010 at 15:51
There are ways with some kickstart trickery, but it shouldn't really be done. Someone has to have physical access to the machine, why can't they do it?
-
This might have nontrivial costs for a VPS, depending on the plan. Feb 12, 2010 at 14:49
-
The reason to do this is costs, as I mentioned above I have a lot of these systems (>300) and they are part of a bigger machine and not easy accessible so it will take time to get physical access to all of them. So if I spend 1 week scripting an automated update over ssh I will save a lot of time.– OlaFeb 12, 2010 at 15:48