Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Setting up gentoo via ssh
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Installing Gentoo
View previous topic :: View next topic  
Author Message
chi86
Apprentice
Apprentice


Joined: 30 Jul 2013
Posts: 164
Location: Austria

PostPosted: Thu Feb 12, 2015 11:39 am    Post subject: Setting up gentoo via ssh Reply with quote

Hello!
I have to set up a server and the problem is it is in an server room in some other building. Therefor I wanted to ask if it is possible to do that via ssh? The main problem why I have to setup this mashine is that it was never updated and now it is working on an really old gentoo version. Also the "/" partition almost complelty full (97%).
Has anyone ever done anyting similar and can help me with that or do I have to do the installation directly at the server?
Back to top
View user's profile Send private message
massimo
Veteran
Veteran


Joined: 22 Jun 2003
Posts: 1226

PostPosted: Thu Feb 12, 2015 12:09 pm    Post subject: Reply with quote

I usually do this using a live CD, i.e., boot and unless this does not happen automatically aassign IP address and start sshd. If some kind of ILO is available you might also be able to do this remotely.
_________________
Hello 911? How are you?
Back to top
View user's profile Send private message
chi86
Apprentice
Apprentice


Joined: 30 Jul 2013
Posts: 164
Location: Austria

PostPosted: Thu Feb 12, 2015 12:16 pm    Post subject: Reply with quote

The advantage of this would be that I can again assign the first partition to "/" because if I do it on the running system in can't overwrite the root disk, can't I?

Ok this mean freezing in the server room :wink:
Back to top
View user's profile Send private message
229566
Tux's lil' helper
Tux's lil' helper


Joined: 16 Aug 2010
Posts: 127

PostPosted: Thu Feb 12, 2015 12:42 pm    Post subject: Reply with quote

If you have some kind of RAID 1 there you can break the array, detach a drive and install to it, update the bootloader and boot into that other drive, proceed from there. It's doable, I did that a couple of times on a remote server rented from a hosting company. And from another OS installed (Debian). :)

Otherwise you could reuse the swap partition to boot into a basic stage3 (with sshd enabled), and install your regular partition from there.

All this is assuming you will completely destroy the current installation and bring back data from some kind of backup.

Or you could go to the server room and freeze just enough to plug in the LiveDVD USB, I don't remember now if it is set up for ssh, but you could stay there just long enough to boot into it and enable ssh then bolt back to the warmth of your office and proceed from there. :)

At any rate I'd advise preparing the bin packages beforehand instead of building them on the server, at least those minimally required for swap trickery if you're confined with space.
Back to top
View user's profile Send private message
chi86
Apprentice
Apprentice


Joined: 30 Jul 2013
Posts: 164
Location: Austria

PostPosted: Thu Feb 12, 2015 1:34 pm    Post subject: Reply with quote

GrueXYZ wrote:
If you have some kind of RAID 1 there you can break the array, detach a drive and install to it, update the bootloader and boot into that other drive, proceed from there. It's doable, I did that a couple of times on a remote server rented from a hosting company. And from another OS installed (Debian). :)


There is not enough free space to do that so this I can't do.

GrueXYZ wrote:
Otherwise you could reuse the swap partition to boot into a basic stage3 (with sshd enabled), and install your regular partition from there.


But this I really like! The thing I don't understand is, how can I log into the system because if it is a stage3 tarball I have no user configurated ....
Back to top
View user's profile Send private message
229566
Tux's lil' helper
Tux's lil' helper


Joined: 16 Aug 2010
Posts: 127

PostPosted: Thu Feb 12, 2015 1:50 pm    Post subject: Reply with quote

chi86 wrote:
There is not enough free space to do that so this I can't do.


Not sure what you mean. If you have RAID mirroring, you can detach one drive and use it entirely.


chi86 wrote:
But this I really like! The thing I don't understand is, how can I log into the system because if it is a stage3 tarball I have no user configurated ....


Well obviously you chroot into it and set up a minimally working bootable installation with sshd, into which you reboot, ssh into and set up your main partition from a stage3 again. It's "stage 3 sokoban" but eh, if you have no other option...

Personally, I'd just go over there and stick the LiveDVD USB into it, boot into that, set up ssh and walk back to the office to proceed from there via ssh.
Back to top
View user's profile Send private message
chi86
Apprentice
Apprentice


Joined: 30 Jul 2013
Posts: 164
Location: Austria

PostPosted: Thu Feb 12, 2015 1:54 pm    Post subject: Reply with quote

Oh sorry I forgot to answer that ... no there is n RAID.

Ok I think you are right ... I get my winter coat and try my luck with LiveDVD USB. Thanks
Back to top
View user's profile Send private message
krinn
Watchman
Watchman


Joined: 02 May 2003
Posts: 7071

PostPosted: Thu Feb 12, 2015 2:08 pm    Post subject: Reply with quote

Why do you want boot the livecd on the server???
You said it is an old gentoo running on it, so we could safely assume it have an ssh running.
From any other hosts, use a livecd with an ssh in it, boot it, ssh to your server and upgrade.
You can easy get lot of space from distfiles or /var/tmp/portage in all gentoo.

But:
- if your server have no ssh running: get your coat on and install ssh on it or run it
- if your server lack so much free space, what let you think newer programs (update) would take less space, generally newer version add stuff, and adding stuff make the application size growing not shrinking. If your server space is that low because nothing could be remove without loosing functionality, it mean prior to upgrade it, you need to update its disk size to a bigger one. (again taking coat, plug new disk, duplicate, unplug old one, but now you even have a copy of it, not so bad so).
Back to top
View user's profile Send private message
chi86
Apprentice
Apprentice


Joined: 30 Jul 2013
Posts: 164
Location: Austria

PostPosted: Thu Feb 12, 2015 2:42 pm    Post subject: Reply with quote

krinn wrote:
You can easy get lot of space from distfiles or /var/tmp/portage in all gentoo.


How do you mean that ... can I delete these without damaging my system?
Back to top
View user's profile Send private message
krinn
Watchman
Watchman


Joined: 02 May 2003
Posts: 7071

PostPosted: Thu Feb 12, 2015 2:50 pm    Post subject: Reply with quote

By itself you will not damage your system, but loosing distfiles content you will loose source package, that's not any issue for a recent package, you can just re-download it, but for an old gentoo, it might bug you, as if you need re-emerge an old package, you will have hard time to get it, as your mirror sure doesn't have anymore that package version.

So yes, safe. But no if you want re-emerge something (this in itself doesn't break anything, but if you break anything, you will be in "little" trouble)
hint: remember, removing something from somewhere doesn't mean you cannot move it elsewhere. Use the free space of the computer you are ssh into the server to hold the distfiles content of the server (you'll see the wonder of scp). So getting back server space, while keeping distfiles content safe somewhere: both of the world == happy admin.

What you should do in all case: backup the server prior to update as for me, you seems a bit into fog for the task, better stay safe than crying.
Back to top
View user's profile Send private message
chi86
Apprentice
Apprentice


Joined: 30 Jul 2013
Posts: 164
Location: Austria

PostPosted: Thu Feb 12, 2015 3:01 pm    Post subject: Reply with quote

Yes i remember what was the problem when I got this server it was supposed to be regulary updated but it was not and I did a:

Code:
emerge --sync


after that it said:

Code:

 * An update to portage is available. It is _highly_ recommended
 * that you update portage now, before any other packages are updated.



and than:

Code:
!!! Unable to parse profile: '/etc/make.profile'
!!! ParseError: Profile contains unsupported EAPI '5': '/usr/portage/profiles/hardened/linux/amd64/eapi'
!!! If you have just changed your profile configuration, you should revert
!!! back to the previous configuration. Due to your current profile being
!!! invalid, allowed actions are limited to --help, --info, --sync, and
!!! --version.


Which was the point where I surrendered :oops:
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Installing Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum