This page should apply to any Ubuntu version.

If you find that this information does not apply to some versions/releases, please edit this page and modify this header to reflect that. Please also include any necessary modifications for this information to apply to the additional versions.


Introduction

GParted is a partition editing program. It is sometimes desirable to run it locally on a thin client, for example to create a swap or a local /home partition. While it is possible to execute GParted from a live CD or a USB stick, running it as a screen script in the memory-optimized LTSP environment enables it to run on clients with as little as 64MB RAM.

Installation

Run the following commands to install gparted and some of its dependencies to your LTSP chroot:

ROOT="/opt/ltsp/i386"
sudo chroot "$ROOT" mount -t proc proc /proc
sudo mount --bind /var/cache/apt/archives "$ROOT/var/cache/apt/archives"
sudo cp /etc/resolv.conf "$ROOT/etc/"
sudo LTSP_HANDLE_DAEMONS=false chroot "$ROOT" apt-get install gparted ntfsprogs dosfstools
sudo umount "$ROOT/var/cache/apt/archives"    

Creating the screen script

Save the following commands to /opt/ltsp/i386/usr/share/ltsp/screen.d/gparted.

Warning: because of some wiki syntax restrictions, there's an extra space in the first #!/bin/sh line, please remove it before saving the file.

# !/bin/sh
# Starts gparted, usually to create a swap partition on the clients.
# To use, specify SCREEN_07=gparted in lts.conf.
#
# Copyright 2010 Alkis Georgopoulos
#
# This program is free software; you can redistribute it and/or modify it under
# the terms of the GNU General Public License as published by the Free Software
# Foundation; either version 2, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful, but WITHOUT ANY
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.  See the GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License with your
# Debian GNU system, in /usr/share/common-licenses/GPL.  If not, write to the
# Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
# 02111-1307, USA.

#
# Get the common code for X screen scripts
#

. /usr/share/ltsp/screen-x-common

if [ -x /usr/share/ltsp/xinitrc ]; then
    xinitrc=/usr/share/ltsp/xinitrc
fi

if [ -x /usr/sbin/gparted ]; then
    xinit $xinitrc /usr/sbin/gparted ${GPARTED_OPTIONS} -- ${DISPLAY} vt${TTY} ${X_ARGS} -br >/dev/null 2>&1
else
    xinit $xinitrc /usr/bin/xmessage "Gparted is not installed" -- ${DISPLAY} vt${TTY} ${X_ARGS} -br >/dev/null 2>&1
fi

Then, make it executable by running:

sudo chmod +x /opt/ltsp/i386/usr/share/ltsp/screen.d/gparted

Finally, don't forget to compress your chroot:

sudo ltsp-update-image

Configuring lts.conf

To use the gparted screen script, you need to put:

SCREEN_07=gparted

in your lts.conf, either under the [Default] section, or under a specific [ma:ca:dd:re:ss] section.

For clients with only 64MB RAM, you might want to add

NBD_SWAP=True

as well to give them some network swap space while running gparted.

See Also

  • UbuntuLTSP - Community Ubuntu LTSP Documentation.

  • GParted - The Gnome Partition Editor.

UbuntuLTSP/GParted (last edited 2010-05-31 15:51:09 by alkisg)