0% found this document useful (0 votes)
6 views

GrowItg

Gre

Uploaded by

babun.sun
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views

GrowItg

Gre

Uploaded by

babun.sun
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 10

Grow It

Expand the flashed partition(s) to fill


the available drive space
by sudodus alias nio-wiklund at launchpad
Preparation
You need two drives or mass storage devices (pendrive, flash card, HDD, SSD), or one optical
disk (CD, DVD) and one mass storage device. The minimum size is 4 GB for the target, but
obviously the final operating system will soon need more space for your personal files as well as
for additional system files (program packages),

For the target, the final installed operating system, typically an internal drive, but it could also be
connected via USB or eSATA:

A 4 GB USB pendrive will work for a small portable system. A 16 GB USB 3 pendrive will make
a good portable system. Any internal drive from 4 GB will work with the small operating system
Lubuntu, but 8 GB or more is recommended, and will work with all desktop flavours of Ubuntu
and many other linux operating systems, that are portable when installed. See this link

http://help.ubuntu.com/community/Installation/FromUSBStick#Prerequisites

This method works also from optical devices (CD/DVD). It is an option for really old hardware to
boot from CD.

Backup all personal data before trying this method because the target
drive will be overwritten

Installing operating systems and editing partitions may fail and destroy data, so back up your
data before you start. In this particular case, when you install from a compressed image,
partition table of the target drive will be overwritten. One way to avoid mistakes is to disconnect
the other drives during the process.
Installation

Install from compressed image files (img.gz or img.xz files) with mkusb. That procedure is
described in other documents. Such images have a fixed size. The target drive must be at least
that size for the installation to work, and if it is larger, it is possible to grow the partitions.
- Download the quick start manual and mkusb http://phillw.net/isos/one-button-installer/scripts/
- View or download the quick start manual http://ubuntuone.com/13HPbV48PmonVgkac8KK3l
- Check the md5sums http://phillw.net/isos/one-button-in...ums-phillw.txt

Grow It

Unmount all partitions of the drive and swapoff (and unplug and plug in the drive if a USB drive).
Do not run gparted directly after flashing the drive, because it may not work properly. If it is an
internal drive, maybe rebooting helps recognizing the drive properly.

Check mounting with the command

df

You can use the file browser (or gparted itself) to unmount the drive, or of course the command
line:

sudo umount /dev/sdxy # x = device letter, y = partition number


sudo swapoff /dev/sdxy

Gparted is a tool to edit partitions. It uses graphics in an intuitive way, so that it is rather easy to
use. You can use the pull-down menus, right-click on the graphical boxes and even pull or
push the boundaries of the partitions to change the size. Finally, you can enter numbers in
the small digital windows, if you want to get 'exact' values.

Let us say that we have installed an 8 GB system onto a 40 GB internal drive. Then you want to
use the whole drive.

If there is swap, you should move it. It is possible to delete it and create a new swap partition,
but then you have to fit the entry in /etc/fstab to match the UUID, but if you move it, the UUID
remains the same.

Maybe you can increase the size, but only if you have very low RAM, or if you intend to
hibernate. The swap should be at least the same size as the RAM (in Gibibytes) for hibernation,
but it need not be much larger. 1 Gibibyte = 1073741824 bytes, so if you have '1 GB' RAM, you
need at least 1,074 GB swap size. (Drives are usually measured in decimal units.) You may
want some margin, so somewhere between 1.2 and 1.5 GB is good.

Move the swap away so that you can increase the size of the root partition! Then you can
grow the root partition to fill the available unallocated space.

In both cases you can either click and move the boundaries of the graphical 'boxes' or you can
write numbers in the digital windows and press the Enter key for the result to show. When you
have finished editing, you must click on the tick mark at the top of the gparted window in order
to start executing the changes. (This is a safety precaution.) If the disk is big or slow, it can take
long time (from a few seconds to hours to finish depending of how much data must be moved).
Growing a drive is much faster than shrinking a drive (because shrinking means moving a lot of
data). And the swap data are discarded, so it is also easy.

If you move the head end of the root partition (or boot partition, if separate), you must reinstall
the bootloader, which is straight-forward, but a complication. So avoid moving the head end
(the left edge of the graphical box) of the root partition.

Now let us discuss a case with a larger drive, say 500 GB. It is not necessary with more than
20-40 GB for the linux root partition. Some people have a larger home partition. Some people
have a large data partition.

If it is an internal drive (and you have installed from a compressed image file), you do not intend
to use Windows on that drive, but maybe you dual boot Windows from another drive. And it
might be a good idea to have the NTFS file system on the data partition, so that it is available
from linux as well as Windows.

But it is certainly possible to have a huge root partition, except in some computers, where it
might not boot, if the boot files are located more than 137 GB from the head end of the drive.
You can also have several small partitions, where you test new versions and flavours of linux.

See the following sequence of screen-shots.

This first picture shows gparted in LXDE in Debian Wheezy. There is a green circle with an
arrow instead of a tick, where to click in order to perform the edits in the partition table.
The following pictures show gparted in Xubuntu 12.04 LTS, and it is simlar in most Ubuntus.
The installed system

The old style:

The original installed systems are similar to the original version of Lubuntu 13.04, basically the
same as in

http://help.ubuntu.com/community/InstalledSystemFakePAE

and the way to install without the standard installers have developed gradually as described in

https://help.ubuntu.com/community/OBI

so the username is guru and the password is changeme. You should change the password, but
keep guru as the administrator user, and create new users instead of trying to change the name
of guru. The original user can be the administrator's account.

The new style

Some of the 13.10 systems (except Lubuntu Core Saucy) are prepared for the end user (via the
OEM procedure) and you will select the user id and password after the installation.

Computer name

If several computers are to be run in the same LAN, you should create individual computer
names (in /etc/hosts and /etc/hostname).

Update and upgrade and install programs


like you would with any normal installed Ubuntu based system.

Install a new language


The end user is given the opportunity to select language, but it will not be installed properly at
the installation via the OEM dialogue (at least not Swedish, that I tested). But when the user
selects (from the main menu in Lubuntu)

Preferences--Language Support

and installs the relevant language, it will work after the next reboot.

The Trusty pre-beta versions need the keyboard layout to be set separately: 'add language' in
Xubuntu and 'select input method' (and select your language) in Lubuntu.
The mount options noatime and discard
If the drive is a hard disk drive, use no mount options noatime or discard in /etc/fstab
An SSD should have noatime and can have discard in /etc/fstab
A simple flash drive (USB pendrive or flash card) should have noatime in /etc/fstab

The swap partition


If on flash memory, this swap partition is only for rare peaks in memory usage. You are
recommended to add a swap partition on an internal hard disk drive if swap will be used
regularly. That HDD swap partition should be addressed in /etc/fstab instead of the one on the
flash drive.

Observe that 13.04 Raring end of life is January 2014


Look for a new Lubuntu 13.10 'Saucy' or some of the other Ubuntu based flavours and re-spins!

If you want to change the name of the computer and add a new user
Changing the name of the computer should be easy. It is enough to edit /etc/hostname and
/etc/hosts. But it is easier to create a new user instead of changing the existing user. But don't
remove the original one unless the new user is member of the sudo group and you have verified
that it is able to perform system tasks. This issue may arise for the systems, where the user
guru is preinstalled.

'floppy-off' when some commands are very slow

This tweak helps, when blkid, parted -l and fdisk -lu are very slow

http://unix.stackexchange.com/questions/53513/linux-disable-dev-fd0-floppy

On Ubuntu, the floppy driver is loaded as a module. You can blacklist this
module so it doesn't get loaded:

echo "blacklist floppy" | sudo tee /etc/modprobe.d/blacklist-floppy.conf


sudo rmmod floppy
sudo update-initramfs -u

Immediately and upon rebooting, the floppy driver should be banished for good.

You might also like