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

Re: Running Squeeze on a 2 GB usb stick?



On 28/06/11 14:17, Mark wrote:
> Hi - I have a work laptop with Windows and since it tracks basically
> everything I do, I'd like to install Squeeze to a 2 GB usb stick I have
> laying around so I can boot to that instead of the internal hdd for
> personal use.� I plan on doing the Expert Install and was wondering if
> there is advice on recommended packages other than the base system for
> my given circumstances?� Here's what I was thinking of installing in
> addition to the base system:
> 
> -GParted
> -gedit
> -Iceweasel
> -Synaptic Package Manager
> -Update Manager
> -Network Manager (or wicd)
> -A few things under Preferences like Appearance, Screensaver, Power
> Management
> 
> Am I silly to think I'll be able to do this on 2 GB?� The laptop has 4
> GB RAM so I'm not worried about swap space.
> 
> Thank you for any input.
> 
> Mark
If you're willing to do a little work - then yes, under 1.2GB is
possible. The trick is not to do the build/install on the USBkey (move
it there after building and stripping).

You will have to sacrifice some unnecessary things on your wish list:-
Synaptic (learn to use apt or aptitude)
Update Manager (ditto)
NetworkManager
Screensavers and PowerManagement
Any other "dancing bears"

Process:-
Boot the laptop from a live Debian CD and note down the x packages used.
Install to a virtualbox machine, a larger USB key (8GB), or a spare hdd.
When the build is finished just copy it to your usbkey.

At the first gui screen of d-i choose help which will take you to the cli.
enter "expert" and hit Enter
choose manual partitioning, create a single primary partition, ext3 or
4, noatime.
Do not create a swap partition.
At package selection choose basic system and laptop - do not choose
desktop or server options.
After the install is completed login as root to you basic, non-X install.
You now have a small, basic Debian install - before adding packages you
want to remove anything unneeded, and set apt to install only necessary
packages:-
# nano /etc/apt/apt.conf.d/03recommends
and paste the following code into 03recommends (ignore the =====)
==============
APT
{
	Install-Recommends "false";
	Install-Suggests "false";
};
==============
Hit F2 to save, enter Y when asked.

NOTE: recommended is not the same as essential.

Use:-
# dpkg --get-selections | grep -v deinstall | more

to review what you have already installed. If you see anything you don't
want/need:-

# apt-get -s remove package_not_wanted | more

and see what the effect of removing it will be. If it isn't going to
create a nightmare:-

# apt-get --purge remove package_not_wanted

eg. if you don't plan on using nfs:-
root@apache:~# dpkg --get-selections | grep -v deinstall | grep nfs
libnfsidmap2                                    install
nfs-common                                      install
root@apache:~# apt-get -s remove nfs-common libnfsidmap2 | more
Reading package lists...
Building dependency tree...
Reading state information...
The following packages will be REMOVED:
  libnfsidmap2 nfs-common
0 upgraded, 0 newly installed, 2 to remove and 27 not upgraded.
Remv nfs-common [1:1.2.2-4]
Remv libnfsidmap2 [0.23-2]
root@apache:~# apt-get --purge remove nfs-common libnfsidmap2

You probably won't need exim:-
root@apache:~# dpkg --get-selections | grep exim | more
exim4                                           install
exim4-base                                      install
exim4-config                                    install
exim4-daemon-light                              install
root@apache:~# apt-get -s remove exim4* | more
Reading package lists...
Building dependency tree...
Reading state information...
Package exim4-daemon-heavy-dbg is not installed, so not removed
Package exim4-daemon-heavy is not installed, so not removed
Package exim4-daemon-light-dbg is not installed, so not removed
Package exim4-dbg is not installed, so not removed
Package exim4-dev is not installed, so not removed
Package eximon4 is not installed, so not removed
Package exim4-doc-html is not installed, so not removed
Package exim4-doc-info is not installed, so not removed
Package gforge-mta-exim4 is not installed, so not removed
Package geximon is not installed, so not removed
Package rexima is not installed, so not removed
Package sa-exim is not installed, so not removed
The following packages will be REMOVED:
  bsd-mailx exim4 exim4-base exim4-config exim4-daemon-light
0 upgraded, 0 newly installed, 5 to remove and 27 not upgraded.
Remv bsd-mailx [8.1.2-0.20100314cvs-1]
Remv exim4 [4.72-6+squeeze2]
Remv exim4-daemon-light [4.72-6+squeeze2]
Remv exim4-base [4.72-6+squeeze2]
Remv exim4-config [4.72-6+squeeze2]
root@apache:~# apt-get --purge remove exim4*

Continue stripping out packages until you are happy then start adding
packages.
Tip: keep a note of what is recommended in addition to what package/s
you select to install - if something fails to function review these
(sic) notes for useful clues. The files are tiny.
eg:-
# apt-get -s install deborphan purgelocales | more
will show you debfoster and bleachbit are recommended, probably dialog
will be too (I'm going from memory) - in this case I'd recommend you
don't want debfoster or bleachbit, but you do want dialog so:-

# apt-get -s install deborphan purgelocales dialog >
/root/deborphan_purgelocale

A file called deborphan_purgelocale will be created in /root for later
use if required.

then do the actual install:-
# apt-get install deborphan purgelocales dialog

Purgelocales will ask some basic questions then keep your system free of
unwanted locales (and man files).

# deborphan
will list "orphaned" files - remove them:-
# apt-get --purge remove `deborphan`

Install additional "core" tools:-
(note: don't forget to use the -s option first to review the recommended
packages, followed by piping the output to a file in root for later
reference).
# apt-get install mc bzip2 arj zip unzip rar unrar

If you're not familiar with cli you'll find mc useful

Then install just the minimum x packages required for you laptop and the
core/base packages for your desktop choice.
eg:-
[1]
# apt-get -s install kde-core kdm | more
or
[2]
# apt-get -s install gnome-core gdm | more
Install just the x packages required for your laptop - *then* repeat [1]
or [2] and make sure you are not missing any needed x packages *before*
running [1] or [2]. Make sure to pipe the output of the simulated
apt-get install (-s) to a file in root for later reference.
At a minimum you'll need xserver-xorg-core.

Carefully go through and remove any unneeded packages. (games,
screensavers, desktop backgrounds, additional icons etc)
Trim unneeded stuff like man and doc directories, also clean the
apt-cache, run deborphan again, and apt-get autoremove.
Remove unneeded drivers eg:-
# rm -R /lib/modules/`uname -r`/kernel/drivers/isdn
Check the space used by your new install:-
$ df -h
It should be a little over
1.2GB (for KDE, don't know about Gnome, Fluxbox et al should be smaller)
- and it's quite possible to make it far smaller than that!

Format your usbkey as ext3 or 4 and use the noatime option (forget about
swap) - single partition.
Copy the install across to the usbkey, modify fstab if required, ditto
/etc/host.
Use a supergrub disk to boot into the usbkey installation.
#update-grub

useful refs:-
http://wiki.debian.org/DebianLive/HowTo/SmallSizeImage
http://wiki.debian.org/DebianEeePC/Software/DesktopEnvironment

Alternatively go to slax.org and build and download the custom slax of
your choice. They work nicely and easily fit on your size key - hope you
like KDE :-)

I regret that I don't have the time to document the entire process in
detail for you (or even to proof read this!). I also think if fully
documented the information would be better on the wiki.debian.org (hint)

Cheers

-- 
"I have a scoop for you. I stole his act.
I camouflaged it with punchlines, and to really throw people off, I did
it before he did."
~ Bill Hicks (on Dennis Leary)


Reply to: