Changing a Linux Server Partitions With a GUI

Changing a Linux Server Partitions With a GUI

Continuing my "avoid the console" series, I'm going to cover remotely managing partitions on a Linux server. Yes, this will involve a bit of console, but this will set you on a path to using GUI tools on your servers without having to install a complete windowing environment. Installing a complete desktop-like environment is a waste of resources for most servers, so keeping things to a minimum helps to streamline and allow your servers to do more things with less hardware.

A lot of new Linux users don't realize it, but a Linux desktop has both a "server" and a "client" for drawing things on the screen. This allows you to separate the program's interface from the machine it's running on and display it remotely.

The most powerful way to remotely manage Linux servers is using the SSH (Secure SHell.) It's like a DOS prompt for your server that you can use securely and remotely. The beauty is that if set up properly, it can tunnel a windowed program through that connection to display on your local desktop. Just don't get confused as to what is running where.

For starters, on the server you will need to make certain that X11Forwarding is enabled for SSH. Unfortunately this is the one step that will require a console or command line to do, simply because there will be no windowed environment running on the server by default.

To start the process, on your Linux desktop open a terminal command prompt. In Ubuntu this is done through the Applications + Accessories + Terminal menu. Connect to your server with:

ssh -l [username] [server IP]

For instance:

ssh -l tony 192.168.1.5

Note, that's a lowercase letter "L" not a number one before the username.

Most likely you will be asked to provide your password.

Once connected, do the following:

sudo nano /etc/ssh/sshd_config
Scroll down and make sure the following line is set:
X11Forwarding yes

Then press CTRL-X to exit, and enter "Y" to save your changes.

Now just to be safe, let's restart the SSH server:

sudo /etc/init.d/ssh restart

You may need to log out and log back in for the change to take effect.

Next, on the server let's install "gparted", which is a graphical hard disk partitioning tool.

sudo apt-get install gparted

Once installed, you can run it from inside the server console, but it will appear on your local desktop:

sudo gparted
On your local desktop something like the following window should appear:

From here, it's pretty self-evident how to manage the partitions on the server. Just remember you can't really mess with the main partition without goofing up a running server, but it's great for adding extra hard drives late in the game.

This same "trick" of enabling X11 forwarding and installing X11 windowed applications is great for a lot of things on a remote server, such as package management with Synaptic, managing virtual machines with the Virtual Machine Manager or simply using gedit to edit a configuration file. Once it's been set up, it's an easy thing to use, and you aren't wasting any processor resources by running an entire desktop windowed environment on your server.

Posted by Tony on Sep 01, 2010 | Servers, Linux Tricks