|
Installing Linux
Guides and distributions
Installation history
2006-05-03: starting the grub console
If grub starts but doesn't display anything, try pressing c to get the console and "help" to get the
list of commands -- one of them is FIND <filename>. Try
FIND /boot/grub/menu.lst
and it should find the boot partition. It could still be confused, so
generally a fresh install is better if you're moving from one disk to
another, but this is an emergency solution.
2006-03-25: Recovering from a grub error 15
On boot, you get "GRUB loading stage 1.5" and then "Grub Error 15".
Boot with an installation disk, continue the installation remotely, mount / and /boot, and then chroot into /target. Issue:
# grub
GNU GRUB version 0.97
grub> root (hd0,0)
root (hd0,0)
Filesystem type is ext2fs, partition type 0x83
grub> setup (hd0)
setup (hd0)
Checking if "/boot/grub/stage1" exists... no
Checking if "/grub/stage1" exists... yes
Checking if "/grub/stage2" exists... yes
Checking if "/grub/e2fs_stage1_5" exists... yes
Running "embed /grub/e2fs_stage1_5 (hd0)"... 16 sectors are embedded.
succeeded
Running "install /grub/stage1 (hd0) (hd0)1+16 p (hd0,0)/grub/stage2 /grub/menu.lst"... succeeded
Done.
Note the first command just asks for information; the second writes the bootloader chain in the MBR.
2006-02-22: Copying Chianti onto a spare drive for Steve Peterson
Steve wanted a clone of the Chianti installation and I did the following:
- Attach the drive on hdc, check dmesg
- Format with QTParted
- Format the partitions
- tune2fs -j /dev/hdc1
- tune2fs -j /dev/hdc2
- tune2fs -j /dev/hdc3
- mkswap /dev/hdc5
- tune2fs -j /dev/hdc6
- tune2fs -j /dev/hdc7
- mkfs.xfs /dev/hdc8 -f
- Label the partitions
- tune2fs -L boot /dev/hdc1
- tune2fs -L root1 /dev/hdc2
- tune2fs -L root2 /dev/hdc3
- tune2fs -L home /dev/hdc6
- tune2fs -L db /dev/hdc7
- xfs_admin -L spare /dev/hdc8
- Make a record of the results
- Clone MBR
- dd if=/dev/hda of=/dev/hdc bs=446 count=1
- Clone /boot
- dd if=/dev/hda1 of=/dev/hdc1
- e2fsck -f /dev/hdc1
- Create some empty system directories in the new /stv/root1 (the new machine's /):
- mount /stv/root1
- cd /stv/root1
- md dev
- md home
- md proc
- md tmp
- md sys
- Copy some trivial directories in / to /stv/root1:
- cp -a /cdrom .
- cp -a /lib64 .
- cp -a /media
- cp -a /media .
- cp -a /mnt .
- Tar and copy files from the OS directories (cf. Clitunno's SuSE installation):
- md /stv/root1/bin && cd /bin && tar -cSpf - . | tar -xvSpf - -C /stv/root1/bin
- repeat for emul etc lib etc lib opt root sbin usr var
- Check the file system
- umount /stv/root1
- e2fsck -f /dev/hdc2
- Make adjustments:
- mount /stv/root1
- clean up /root, including .ssh
- clean up /var/tmp and /var/mail
- adjust /etc/hostname, mailname, motd, exports, hosts, hosts.allow, and fstab
- Check the boot partition
Keeping Chianti's boot partition, I added an entry for the new drive in grub and booted into it.
The procedure was not successful. First grub failed, then an
initial console wasn't found, then the kernel wouldn't build (lacking
mschimek's home directory), then the new kernel crashed. The only
reliable way to do this is to clone the whole drive.
For the initial console problem, I used this ingenious workaround:
Create a console device node in dev on / behind the tmpfs mount that udev uses:
# mkdir /tmp/root
# mount --bind / /tmp/root
# mknod /tmp/root/dev/console c 5 1
Incredibly, this worked.
A better method would be this:
I am curious why you have chosen to clone the drive
with dd? I have always used a different route for cloning a
system (see also "Duping a Drive Under Linux", http://linuxgazette.net/issue64/tag/12.html):
1. Partition the new drive as necessary
2. Mount the partitions in the right order under your existing system (for instance in /mnt)
3. Copy the complete system with cp -ax
4. Use grub to install it to the MBR of the new drive
5. Transfer the drive to your new system
This route has an additional advantage: you can change the size of any
partition if necessary, and even use a totally different partition
layout! I never encountered any problems on this route.
The "cp -ax" copies archive and "stay within this file system" -- not sure exactly what that does...
8 November 2004 update -- identifying the drivers needed
Here are some hints from Harald Dunkel <harald.dunkel@t-online.de> on locating which modules you need:
How can I figure out which sata drivers I need to add to /etc/mkinitrd/modules?
You should check the output of lspci and lspci -n for your sata controller. lspci | grep -i sata returns for my PC:
0000:01:07.0 RAID bus controller: Silicon Image, Inc.
(formerly CMD Technology Inc) SiI 3512 [SATALink/SATARaid] Serial ATA
Controller (rev 01)
^^^^^^^^^^^^
lspci -n | grep 0000:01:07.0 says
0000:01:07.0 0104: 1095:3512 (rev 01)
^^^^ ^^^^
Next step is to search for 1095 and 3512 in /lib/modules/2.6.9/modules.pcimap:
% grep 1095 /lib/modules/2.6.9/modules.pcimap | grep 3512
sata_sil
0x00001095 0x00003512 0xffffffff 0xffffffff 0x00000000 0x00000000 0x0
^^^^^^^^
^^^^ ^^^^
In this example "sata_sil" is the module name to add to
/etc/mkinitrd/modules. Since modules.pcimap is generated using
information compiled into the kernel modules, only the modules you have
built are listed.
10 October 2004 update: building debian packages from source
If you get a tarball without a debian directory, you may be able to generate the environment for making a debian package.
- ./configure (if there's a configure file)
- dh_make -s
- pico debian/rules (add the configuration options you discovered in First)
- fakeroot dpkg-buildpackage
Wow!
Once dh_make is run, you may be able to run checkinstall -D.
September 2002 installation plan
- The systems are doing well right now -- gubbio just got
2.4.19-ac4
- Don't mess with the systems unless there's a big gain
- Put Debian on gubbio; when it's stable, copy it to cyberspace
(or get a new machine)
- For a future version, consider using sinstall,
a script for building linux from scratch
July 2002 Distro choice history
As of 28 July 2002, there's little doubt that Debian is the way to go
for servers, and possibly Gentoo for desktops. In August I ordered
Debian 3 DVD. In early September 2002, I ordered Libranet 2.7 Linux,
a Debian derivative; see details.
I once considered Linux
from Scratch an attractive alternative-- this was my own idea way
back of installing SuSE 7.3 so that you have all the tools and
compilers, and then building a second bare-boned and fully understood
and controlled installation at a different partition on the
harddrive. Newsgroups at news://news.linuxfromscratch.org.
For a general guide, see also the excellent From Power Up To
Bash Prompt. It explains the part I had difficulties with --
namely the parameter files that drive the booting process. The other
maddening issue is the disorganized state of the file tree,
particularly in regard to libraries. Linux from Scratch does a good
job teaching you about setting up symbolic links and generally
maintaining the coherence of dynamic linking to libraries.
Another cutting-edge distro that looks promising is Gentoo -- they have
their own elegant update system, see review
at Newsforge. This is an increasingly popular distro -- the choice is
basically between Gentoo and Debian.
Sorcerer looks like a lot
of fun! See the DistroWatch
review here.
To install a new kernel, see the guidelines in the New Year kernel build.
See also Linux at the
KFA
April 2002 installation plan
- Make sure you have a boot disk --
make another attempt to create one
- Your next system should be either Debian or Gentoo -- SuSE is a
waste of time
- Enabling condition: get Codeweaver and run Windows on
gubbio
- Move the 3 gubbio harddrives over to spello and rename it
gubbio
- Put Debian on the remaining gubbio and use it as a web server
-- it will become the new cyberspace
- Add 100GB drive and DVD-RW to the old cyberspace and rename it
X
- Put Gentoo on X and use it as 1223 multimedia machine
January 2002 installation plan
- Leave the SuSE 7.3 installation at the base, but add KDE
3.1
- Update to the new kernel when 2.4.20 is reached
- Build Linux from scratch on a new partition called LFS?
- Make a copy of this base installation called Base
- Install XFree86 4.2
(done)
- Make a copy of this installation, called X11
That would leave you with three different Linux installations,
Base, X11, and KDE, in addition to the initial LFS insallation. You
can then use the LFS installation, or a copy of any of the other
installations, to experiment with digital video and TV capture. So
the idea is to set up three completely tidy and stable source
configurations -- Base, X11, and KDE -- and then only work with
copies of these. With 160GB of space, that shouldn't be a problem.
All of these systems should be included in a single Lilo, but they
should also have a rescue disk that allows them to be started from
floppy.
So what you need to pay attention to when you learn how to build
Linux from scratch is the final step of which components need to be
in which /boot directory or MBR for booting to work. If you do this
right, you shouldn't ever have to perform a reinstallation -- you
should build a perfectly stable system and know how to administer it.
So that's the goal. In the meantime, you'll have your SuSE
installation to use if you want a full distro.
System tracker
- Spello is the new Win system, a gift from CLICC; see details under
Panel. It currently has a single 10GB HDD, a DVD drive, a
250MB Zip drive, and a floppy drive. It's pretty much updated
with applications and files. It has 2 x 128MB RAM of the PC100
kind, the second stick being taken from Cyberspace.
- Cyberspace is the second gift PC from CLICC. It is
running SuSE Linux 7.3, with a few upgrades -- see Cyberspace installation. It
has the same hardware as Spello, except it only has one 128MB
stick of RAM, which was taken from gubbio.
- gubbio is my own PC, dual-boot. See /Proc information. It has a firewire
card and three harddrives:
- 160GB formatted for Linux
- 15GB 7200rpm formatted for Linux, in several partitions
- 13GB running Win98
The difficulty here is what do do with gubbio. On the one hand, I
would like to keep it dual boot, on the other, I would like to
transfer the fast drive, which also happens to be a quiet drive.
For the moment, it's not necessary to do anything.
Plans
- Cyberspace needs to have a new kernel, patched for the
gigadrive. The ideal way to do this would be to patch the SuSE
2.4.16 source code, which I've already downloaded (10 Mar 02) and
placed in /usr/src/linux (cf. SuSE's
kernel rpm instructions). If this works, you can change the
configuration based on the current configuration -- in fact, it's
not really clear you even need to change the configuration, as
the new kernel I made was no smaller than SuSE's kernel (SuSE
uses lots of modules). So the quick fix would be to patch the
SuSE kernel with the gigadrive
patch and compile it.
- Cyberspace should get a firewire card once she's got the
gigadrive -- you could get a new card and keep one in gubbio.
- Since changing harddrives is a hassle, you can just buy
Cyberspace a new harddrive.
Download methods
|
|