[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Lower memory install tip (example from yesterday's meeting)

On Mon, Nov 27, 2017 at 7:25 AM, Michael Paoli <Michael.Paoli@cal.berkeley.edu> wrote:
Lower memory install tip (example from yesterday's meeting)

Got an installation that's a bit intensive on memory, struggling with /
not quite making it through the installation on account of that?
But ... the distribution/installation itself is (semi-?)reasonable as
far as (virtual) memory goes ... at least once it's been installed?
Installing from ISO image on USB flash?
But the flash is fair bit bigger than the size of the ISO image itself?
Well, try adding, early in the installation process, some swap on that
USB flash!

Nice writeup of this!
OTOH, I've found that another easier and faster option is to use a partition on the pre-existing hard-disk drive that's dedicated to swap.
How might you go about this?

1. You'd first have to obtain a good live-media (liveUSB) rescue-type distro to dedicate onto a separate USB flash drive.
I myself highly recommend using KNOPPIX for this [1] because this distro is so incredibly versatile for this and for practicaliy any other task you might want to perform with such live-media (see [2]). KNOPPIX 8.x is also flexible enough to support low-memory i686 machines in addition to low-memory machines with amd64 CPU's. Another good live-media rescue-type distro I and many others have used for this purpose in the past is SystemRescueCd [3].  

2. Once you've downloaded and successfully created your liveUSB flash drive, you'd use it to boot up your machine in question; preferably using the option to boot into a command-line for a low-memory machine ---- for an amd64 machine using KNOPPPIX, that's entering "knoppix64 2" at the initial boot-prompt.
I'm assuming for the sake of these instructions that the pre-existing hard-disk drive is recognized as "/dev/sda".

3. Once you have just the command-line (a.k.a., the terminal) up and running, you'd then probably want to repartition the pre-existing hard drive -- maybe by running fdisk/cfdisk -- to delete and recreate a few of the drive's partitions that you'll need. You can almost always go back to resize these very hard drive partitions using gparted from your installed desktop environment/window manager at a later time. I myself like to create a 1GB /boot partition on /dev/sda1 (default type 83) followed by the required swap partition on /dev/sda2 (sized as 1.5 x physical RAM, type 82). Once this initial partitioning is complete, then I'd *immediately* run a formatting and disk integrity check on both partitions using something like
'mke2fs -t ext4 -ccvv /dev/sda1 && mkswap /dev/sda2 && badblocks -svvn /dev/sda2' (a better check on the swap partition if you have more time is using the write option on the badblocks command, as in 'badblocks -svvw /dev/sda2')
-----> Please check the results of this disk integrity check!
If the badblocks disk integrity check on both partitions finishes without error
  then you'd go ahead and activate the swap partition with 'swapon /dev/sda2'
Else (if the disk integrity checks shows disk errors on *either* (partition)
  then you should seriously reconsider using that particular hard drive for your Linux installation

4. Once you've successfully activated the hard disk's swap partition using your liveUSB flash drive, then you would shutdown your machine, remove this rescue-type USB drive, grab your *installation* USB with your Linux distro of choice, and then boot up your machine using the latter.
On the vast majority of every Linux distros I've used (Debian, Ubuntu, Mint, Slackware, Arch-based, RPM-based, ...etc.), there's almost always an opportunity to activate that pre-existing hard drive swap partition in order to gain more useful memory resources before proceeding with a full distro installation on low-memory machines.      
IIRC, Ubuntu and Mint allow you to run an xterminal session from the initial GUI (before full installation is started) and to then switch to the root user via 'sudo su -' before running 'swapon /dev/sda2' to activate the required hard drive swap partition. Other distros allow you to open a command-line virtual terminal during installation to activate the swap partition, e.g., by hitting the Ctl-Alt-F2 keyboard combination, becoming the root user if not already, and then entering 'swapon /dev/sda2'.

Using such a hard drive swap partition instead of a USB flash drive's might even save a bit of wear-and-tear for repeated installations using that same USB flash drive.

[1] http://www.knopper.net/knoppix-info/index-en.html
[2] http://www.knopper.net/knoppix-mirrors/index-en.html
[3] http://www.system-rescue-cd.org/


You received this message because you are subscribed to the Google Groups "BerkeleyLUG" group.
To unsubscribe from this group and stop receiving emails from it, send an email to berkeleylug+unsubscribe@googlegroups.com.
To post to this group, send email to berkeleylug@googlegroups.com.
Visit this group at https://groups.google.com/group/berkeleylug.
For more options, visit https://groups.google.com/d/optout.