Friday, April 30, 2004

Gentoo LVM2 stuff

vgscan - displays the list of volume groups allocated on the system (for my box, I have vgos, vguser, vgtmp and vgmedia)
lvscan - displays the list of virtual partitions inside of the volume groups (for my box, I have 6)
vgdisplay - displays a lot of data bout the volume groups, a good place to find out how much space is free within a particular volume group (vgos has 12GB free, vguser 19GB free, vgtmp 7GB free, vgmedia 92GB free).

Back when I setup the box, I never created any partitions (volumes?) inside the vgmedia volume group. So now I want to think about what sort of media I'm going to be storing, and how to seperate it. Since most audio/video files are larger, I may consider using a larger block size (if that makes sense?). I'm also going to leave a small amount of space for backup files to be written to from the primary drive. So for now, I'll only allocate 32GB out of the 92GB.

lvcreate -L32G -nmedia vgmedia
mke2fs -j -c /dev/vgmedia/media
(then use an editor to add an entry to the /etc/fstab table)
mkdir /media
mount /dev/vgmedia/media /media

Now I'm ready to configure Samba. See the gentoo documentation about Samba.

Thursday, April 29, 2004

Gentoo Next Steps (ssh)

Setting up SSHD on Gentoo (which just covers the basics, also see the sshd manpage and OpenSSH.org).

I have a book called "Building Secure Servers with Linux", and it's extremely poor with regards to actually setting up the sshd system. (Specifically, it completely ignores the topic of how to create the public/private DSA key for the sshd process.) Googling around for how to create the ssh_host_dsa_key netted me a few useful articles.

NCSA OpenSSH Installation Guide
20020124: setting up sshd on Linux

The NCSA link is probably the most useful, except that on my gentoo linux system, configuration stuff is under /etc/ssh instead of /etc/openssh.

# /usr/bin/ssh-keygen -t dsa -b 1024 -f /etc/ssh/ssh_host_dsa_key -N ""
# chmod 600 /etc/ssh/ssh_host_dsa_key
# chmod 644 /etc/ssh/ssh_host_dsa_key.pub

(the two chmod commands weren't really necessary on my gentoo box, they had no effect on the permissions)

To add sshd so it runs at startup (I think the following is correct):
rc-update add sshd default

Now I can administer the box from the laptop (using SecureCRT software), getting it off of my desk and into the server rack where it belongs. Things to do include getting PostgreSQL up and running, Samba, backing up the system, setting up recurring backups and checkout SubVersion as a replacement for Visual SourceSafe / SourceOffSite.

Gentoo Install Troubleshooting

Spoke too soon in my last post. Got a few errors on boot up. First off, a complaint that the kernel was compiled without DEVFS support (not sure what that means off-hand), and none of my LVM2 stuff loaded. Too tired to poke at it tonight, so I'm going to take a break and do some searching tomorrow.

I don't expect it to be difficult to resolve, might have to rebuild the kernel and reinstall the kernel. During bootup, it tells me details about what needs to be done to fix the issue, but that's since scrolled off the screen. Since my LVM2 volumes didn't mount, I can't look at /var/log/messages to see the boot messages. Had to hard-reset since shutdown/reboot commands are hosed.

Okay, specific error message notes as the boot screen flies by:

GRUB is working, I get the boot selection screen with the 30 sec timer. Error message that DEVFS support is required to be built into the kernel. Not much other details then that. I then get a bunch of messages that various LVM2-hosted file systems did not mount properly (No such file or directory while trying to open /dev/.../ and complaints about missing superblocks). According to google for DEVFS, it stands for "device file system".

So... time to put the LiveCD back in, walk through the commands to get me back to the building a kernel stage:

mount /dev//hda2 /mnt/gentoo
mount /dev/hda1 /mnt/gentoo/boot
mount -t proc none /mnt/gentoo/proc

modprobe dm-mod
vgchange -ay

mount /dev/vgos/opt /mnt/gentoo/opt
mount /dev/vgos/usr /mnt/gentoo/usr
mount /dev/vgos/var /mnt/gentoo/var
mount /dev/vguser/home /mnt/gentoo/home
mount /dev/vgtmp/tmp /mnt/gentoo/tmp
mount /dev/vgtmp/vartmp /mnt/gentoo/var/tmp

chroot /mnt/gentoo /bin/bash
env-update
source /etc/profile

At this point, I'm back to where I'm ready to configure the kernel (previous attempt). I don't need to emerge the kernel sources again (AFAIK), just reconfigure. Flip back to chapter 7c in the gentoo handbook. I think my old configuration should be in /usr/src/linux/.config (that's a hidden file). First thing I did was make a copy of that file "cat .config >> my-first-config". Then I did the "make menuconfig" command, which did load my existing settings from the .config file.

Under (F)ile systems, (P)seudo filesystems, I had to turn on "/dev file system suppport (OBSOLETE)". Apparently, while obsolete, it's still required by 2.6.3. I also turned on "Automatically mount at boot". Exited, saved changes, re-make the kernel, re-install the kernel.

Then cross my fingers and reboot... and it boots! Saw a few errors related to USB/Firewire devices - I may go back into the module autoload file and remove the USB/firewire stuff (don't need).

Other things to do:

- Look at /var/run/shutdown.pid, figure out where to stick the umount commands for all of my volumes when I use the shutdown command. Also mentioned is /dev/initctl.

Wednesday, April 28, 2004

Gentoo EPIA Install (part 6)

(previous entry)

Now to start with chapter 7e, installing extra kernel modules. I didn't see any extra modules that needed to be emerge'd, so I skipped straight to the editing of the autoload file. Actually I lie, I have to add in LVM2 module support. So I need to follow the steps in step 13 of the LVM install guide and add LVM to the auto-load listing.

nano -w /etc/modules.autoload.d/kernel-2.6

Oh boy, a big empty file. I know I need to add LVM here ("dm-mod"), plus building the LVM package ("emerge lvm2") and configuring lvm to not auto-probe the CD-ROM ("echo 'devices { filter=["r/cdrom/"] }' >> /etc/lvm/lvm.conf"). For now, I added the "dm-mod" line, exited out and did the emerge for LVM2. (FYI, I didn't have an lvm directory under /etc so I had to mkdir /etc/lvm before I could run the echo command.)

Looking at the contents of my /lib/modules/2.6.3/kernel folder using the find command shows the following modules:

crypt modules: aes.ko, blowfish.ko, cast5.ko, cast6.ko, crypto_null.ko, deflate.ko, des.ko, md4.ko, md5.ko, serpent.ko, sha1,ko, sha256.ko, sha512.ko, tcrypt.ko, twofish.ko

drivers/md/dm-mod.ko
drivers/net/dummy.ko
lib/zlib_deflate/zlib_deflate.ko
lib/zlib_inflate/zlib_inflate.ko

Not sure why modules like mii, via-rhine, and the like aren't in the /lib/modules tree, could be a goof-up.

Following the sample autoload file from the MP3 server article, I ended up with the following lines in my config file:

#LVM2
dm-mod

#ethernet
mii
via-rhine

#firewire
ieee1394
ohci1394

#usb
usbcore
uhci
ehci-hcd
usb-storage

Don't forget to run "modules-update" when done. Onward to chapter 8, configuring your system. First up is editing the "/etc/fstab" table, which controls what gets mounted at startup. I'm using a rather complex partitioning system, plus LVM2, so this will look a bit wild. It also helps to refer back to the mount commands used earlier.

/dev/hda1 /boot ext2 noauto,noatime 1 2
/dev/hda2 / ext3 natime 0 1
/dev/hdc1 none swap sw 0 0
/dev/cdroms/cdrom0 /mnt/cdrom auto noauto,user 0 0

/dev/vgos/opt /opt ext3 noatime 0 3
/dev/vgos/usr /usr ext3 noatime 0 3
/dev/vgos/var /var ext3 noatime 0 3
/dev/vguser/home /home ext3 noatime 0 0
/dev/vgtmp/tmp /tmp ext2 noatime 0 3
/dev/vgtmp/vartmp /var/tmp ext2 noatime 0 3

none /proc proc defaults 0 0
none /dev/shm tmpfs defaults 0 0

Next, do your hostname and dnsdomainname settings (/etc/hostname and /etc/dnsdomainname) and run the "rc-update add domainname default" command. Edit your networking ("nano -w /etc/conf.d/net"). Most folks probably use DHCP, but I configured a static address (the iface_eth0 line) as well as uncommenting and configuring the gateway line. Save and exit, then use "rc-update add net.eth0 default" to add networking to the default runlevel. Also "cat /etc/resolv.conf" and see if your DNS servers are properly listed (only do this if you used a static IP address like I did, if you're using DHCP those will be automatically set).

The next big task is to edit the local configuration ("nano -w /etc/rc.conf"). I'll only list the changes that I made:

CLOCK="local"

Yeah... big changes! Er, yah, um onward to chapter 9, configuring the bootloader.

I'm 99% sure I didn't turn on frame-buffer support, so skip the first section. I'm also going to use GRUB instead of LILO (personal preference and I've heard that GRUB isn't as fragile as LILO, but on a single-boot system that might be a moot point).

emerge --usepkg grub
(wait a few minutes)
grub

grub> root (hd0,0)
grub> setup (hd0)
grub> quit

The above assumes that your /boot partition is on /dev/hda1 (convert the 'hda' to 'hd0' and subtract 1 from '1' to get '0'). Edit your grub config file using "nano -w /boot/grub/grub.conf" and follow along in the second half of 9b, configuring grub. Here's what mine ended up looking like:

default 0
timeout 30
title=Gentoo Linux 2.6.3
root (hd0,0)
kernel /kernel-2.6.3-gentoo root=/dev/hda2

Save, exit, on to chapter 10, installing the system tools. I went with a lot of defaults here, just going to short-list the commands. (Info on dcron.)

emerge syslog-ng
rc-update add syslog-ng default
emerge dcron
rc-update add dcron default
crontab /etc/crontab

Okay, looks like getting close to the end. Chapter 11, finalizing the install.

passwd
useradd john -m -G users,wheel,audio -s /bin/bash
passwd john

exit
cd /
umount ... (insert list of mounted file systems)
reboot

Reboot, go into the BIOS and change the boot order to bypass the CD-ROM (or simply remove the LiveCD), and refer to chapter 12, where do I go from here in the gentoo handbook. I might jot down some additional notes in the future, but we'll have to see.

Gentoo EPIA Install (part 5)

(previous entry)

Well, that took somewhere around 2 hours to import and build the kernel from the development-sources package. Now I need to configure the kernel (per chapter 7c of the handbook). There are also notes over at epiawiki.org and building a small MP3 server about configuring that I'll need to investigate (specifically looking at their copy of the make config file which goes in "/usr/src/linux/.config").

I'm going with the manual option, so "cd /usr/src/linux" then "make menuconfig". Anywhere I say "turn ON" means to use the "Y" key to turn an option on as built-in, I'll specifically say MODULE if I loaded the option as a module.

Linux Kernel v2.6.3 Configuration
(C)ode maturity level options
(G)eneral setup
(L)oadable module support
(P)rocessor type and features
--> (P)rocessor family (changed to "CyrixIII/VIA-C3")
--> (S)ymetric multi-processing support (turned this one OFF)
--> M(a)chine Check Exception (turned this OFF)
(P)ower management options (ACPI, APM)
(B)us options (PCI, PCMCIA, EISA< MCA, ISA)
(E)xecutable file formats
(D)evice drivers
--> (P)arallel port support (turned mine OFF)
--> (A)TA/ATAPI/MFM/RLL support (turned ON the VIA82CXXX chipset support as built-in)
--> M(u)lti-device support (turn it ON, set Device mapper support to MODULE, per section 13 of LVM2 guide)
--> N(e)tworking support (look under Ethernet 10/100Mbit, turn OFF the RealTek RTL-8139 option, turn ON the VIA Rhine option, also turn ON the MMIO instead of PIO option)
--> (C)haracter Devices (under the AGP support section, I turned OFF the Intel 440... support option and turned ON the VIA chipset support option, turn ON the Intel/AMD/VIA HW RNG support, )
--> (I)2C support (turn this option ON, then see the rest of this list, heavily reliant on building an MP3 server for thse options)
-->--> (I)2C device interface (turned ON, epiawiki says to turn on, MP3 server article leaves it off)
-->--> (I)2C Algorithms (turn ON bit-banging)
-->--> (I)2C Hardware Bus (turn ON the VIA 82C586B support... this is the old "VIA" option, not sure how to decide between that one and the 82C596/82C686/823x, a.k.a. VIAPRO option though so I flipped a coin)
-->--> (I)2C Hardware Sensors Chip (turn ON the VIA686A option)
-->--> (I)2C Core debugging messages (left alone)
-->--> (I)2C Bus debugging messages (left alone)
-->--> (I)2C Chip debugging messages (left alone)
--> M(u)ltimedia devices (left this alone since I'm not interested in using the video-out features)
(F)ile systems
--> (D)OS/FAT/NT Filesystems (turned ON the built-in NTFS filesystem, including debugging/write support)
--> You may also need to turn on "/dev file system support (OBSOLETE)" under (P)seudo filesystems, also turn on "Automatically mount at boot".
(P)rofiling support
(K)ernel hacking
(S)ecurity options
(C)ryptographic options (turned ON, then turned ON the HMAC, everything else as MODULE)
(L)ibrary routines

Hit "Exit" when done and save your new kernel configuration. Use "make && make modules_install" to build the kernel, then follow the instructions to install the kernel (last part of chapter 7c). I should also go back and do a genkernel (section 7d) and compare it to what I picked. The kernel took under an hour to compile. The last few commands of section 7c:

# cp arch/i386/boot/bzImage /boot/kernel-2.6.3-gentoo
# cp System.map /boot/System.map-2.6.3-gentoo
# cp .config /boot/config-2.6.3-gentoo

(next entry)

Gentoo EPIA Install (part 4)

(previous blog entry)

Stage 2 compile is finished (step 6d in the handbook). Not bad, emerge system took about 5.5 hours to run on my little VIA EPIA ME6000. Now for step 7, configuring the kernel

Oh heck, I was trying to see what is in the various timezone files and now my screen fonts are screwed. So now I guess I get to find out what happens if I reboot at this point! First thing I did was "passwd" and set the root password to something that I know, then I do a "shutdown -h now" to take the box down immediately. I also changed memory modules (to use an older 512MB ECC PC2100 stick). The motherboard seems to be okay with the ECC memory, not sure if it actually supports the ECC functionality or not.

Well, I got the error message, "Boot failer: Error loading operating system" on the reboot. Guess I still need to boot from the LiveCD in order to get a functional system. Upon reboot, nothing in the /mnt/gentoo tree, which means that I need to remount those folders:

mount /dev//hda2 /mnt/gentoo
mount /dev/hda1 /mnt/gentoo/boot
mount -t proc none /mnt/gentoo/proc

All of the LVM stuff doesn't show up right off the bat when booting from the LiveCD, have to start LVM and then get it running. (Helpful link about activating a LVM set.) The "vgscan" command is more of a FYI command then a required command, the real deal is the "vgchange -ay" command (which loads all available volume groups). The "vg*" items should now show up in the /dev/ directory.

modprobe dm-mod
vgscan
vgchange -ay

mount /dev/vgos/opt /mnt/gentoo/opt
mount /dev/vgos/usr /mnt/gentoo/usr
mount /dev/vgos/var /mnt/gentoo/var
mount /dev/vguser/home /mnt/gentoo/home
mount /dev/vgtmp/tmp /mnt/gentoo/tmp
mount /dev/vgtmp/vartmp /mnt/gentoo/var/tmp

Have to chroot again (I think)

chroot /mnt/gentoo /bin/bash
env-update
source /etc/profile

Now I should be good to go in order to pickup again with chapter 7. Not sure if I need EST or EST5EDT timezone file (which is what I was attempting to look at the contents of those files for). Ah, "zdump" to the rescue. First off, do a "zdump GMT" to find out what GMT the system thinks it is (e.g. mine says 15:23 at the moment). "zdump EST" reports 10:23 while "zdump EST5EDT" reports a time of 11:23. So... according to time.gov, the eastern seaboard is currently 4 hours behind GMT. Which means I should use EST5EDT to account for daylight savings time. Use "zdump GMT" to verify that your GMT time is still correct after you set the local date.

ln -sf /usr/share/zoneinfo/EST5EDT /etc/localtime
date 04281528
zdump GMT

Picking a kernel is tough... (make sure to read gentoo kernel guide). I could try the epia kernal over at epiawiki.org, but they only have the 2.4 available and 2.6 has been out for a while. I also need to remember to configure the kernel with LVM support (step 13). Initial thinking is that I'm either going to go with development-sources or gs-sources (this is a development server, not a multimedia box). You can get a list of sources by doing "emerge -s sources | less". Also see building an mp3 server for a discussion of some things.

"development-sources" is at 2.6.3 currently. "gentoo-sources" is at 2.4.22-r7. "gs-sources" is at 2.4.25_pre7-r2. "hardened-sources" is at 2.4.24-r1. "selinux-sources" is at 2.4.24-r2.

(flips a coin and goes with "development-sources")

# emerge development-sources

(next entry)

Gentoo EPIA Install (part 3)

(Previous blog entry)

While I'm not exactly sure when the first phase finished overnight, it was probably around 8-12 hours. I don't see any errors on the screen, so I'm assuming that I'm good to go for the next step in the handbook (chapter 6d).

One of the things I"m not sure about at this stage in the game is how to set the root password or what would happen if a reboot would occur. Poking around on the hard drive failed to turn up the passwd command, although I can see that the root account has already been assigned a password in the shadow password file. I'm guessing that I'd boot the LiveCD again, skip to the part where I chroot from the CD to the hard disk (after mounting all of my volumes by hand), then pickup whereever I left off.

Anyway, not much to this step, and it's another one that takes a while to run:

emerge system

Back in a few... (next entry).

Tuesday, April 27, 2004

Gentoo EPIA Install (part 2)

Picking up at chapter 5c of the Gentoo Handbook, Using a Stage from the LiveCD. (Also see my previous post where I configured the disks.) Here is where it gets fun... I'm going to try starting with the x86 stage1 file:

cd /mnt/gentoo
tar -xvjpf /mnt/cdrom/stages/stage1-x86-20040218.tar.bz2

That will extract a *whole* bunch of stuff onto your system, pickup with chapter 5d in the handbook. Next, I grabbed the snapshot of the portage folder off the CD-ROM and stuck it in /mnt/gentoo/usr.

tar -xvjf /mnt/cdrom/snapshots/portage-20040223.tar.bz2 -C /mnt/gentoo/usr
mkdir /mnt/gentoo/usr/portage/distfiles
cp /mnt/cdrom/distfiles/* /mnt/gentoo/usr/portage/distfiles/

That populates the /mnt/gentoo/usr/portage tree, also copies all of the source code off of the CD-ROM. Onward to chapter 5e (configuring the compiler). Use "nano -w /mnt/gentoo/etc/make.conf" to pull up the make.conf file. Here's what mine looked like by default:

CFLAGS="-O2 -mcpu=i686 -fomit-frame-pointer"
CHOST="i386-pc-linux-gnu"
USE=""
CXXFLAGS="$(CFLAGS)"

Now, supposedly GCC 3.3 allows the use of "-march=C3". You may also want to look at /mnt/gentoo/etc/make.conf.example and poke around the documentation in there. Looks like you use either "-march=XXX" or "-mcpu=XXX", not both at the same time. Doing a bit of googling, looks like the Gentoo 2004.0 universal CD does not come with GCC 3.3.2 so the "-march=C3" won't work. The twiki also indicates a preference for "-Os" instead of the other optimization levels due to the small (64KB) cache on the C3 processor. I'm going to try the following (notice that I changed CHOST as well):

CFLAGS="-Os -march=i586 -m3dnow -fomit-frame-pointer"
CHOST="i586-pc-linux-gnu"
USE=""
CXXFLAGS="$(CFLAGS)"

Onward to step 6, Installing the Gentoo Base System. The mirrorselect application chose "pair.com" as my mirror (which is fine, that's where I downloaded the ISOs from). Alternate site is datapipe.net. Not going to muck with the default USE flags at the moment, instead I'm going to step right into 6c (progressing from stage1 to stage2). This will take a while (if it works!).

(Next blog entry)

VIA EPIA Links

Identify Ezra-T/Nehemiah M10000 (finding out if you have the Ezra or Nehemiah CPU core, I already know I have a Samuel 2 by doing a "cat /proc/cpuinfo")

linITX.org forums: Processor family (discusses the -march=C3 flag for GCC)

linITX.org forums: Gentoo on CL6000/Eden (someone with a Samuel 2 who is trying to install Gentoo 2004.0)

Courville.org EPIA M Wiki (lots of links)

Building a mini MP3 server (using gentoo)

Gentoo EPIA Install (part 1)

So... time to install Gentoo (also see epiawiki.org - Installing Gentoo on an EPIA system). A good book to have handy during the install is "Linux in a Nutshell", especially for looking up option flags for the various commands.

Popped the boot CD (Universal CD for 2004.0 Gentoo) in and let it boot up. It reports my hardware as a "VIA Samuel 2 599MHz, 64KB cache". It's now sitting at the '#' prompt (er, shell prompt). When I was setting up the BIOS, I changed the shared memory for the video card from 128MB (default) to 32MB. I also disabled things like the audio ports, serial ports, parallel port, leaving only ethernet, firewire and USB.

Looking at the content of /dev/ ("cd /dev", "ls -l hd*"), I see that I have (3) hard disk devices (DVD-ROM counts as a "hd" device) labeled hda, hdc and hdd. "hda" is my primary IDE, master drive (the 7200rpm 80GB). "hdc" is my secondary IDE, master drive (the 5400rpm 120GB). "hdd" is my DVD-ROM. Each of the two hard-drives have 1 partition each (hda1 and hdc1) which I'll be wiping out when I setup Gentoo. Using the "hdparm -i /dev/hda" command will display a quick summary about hda.

Verify networking using "/sbin/ifconfig". My box automatically grabbed a DHCP address from my network's DHCP server so I'm good to go.

Time to partition the drive. I actually planned this out a few days ago, but I might make a few changes. My plan is to use the primary disk for the operating system, and use the secondary disk for any temporary files and swap. I also want to limit the amount of space set aside for the operating system and keep it all in a seperate area from any user-data to make backing up the config with Norton Ghost easier. Things are a bit complicated as I plan on using LVM to manage portions of the disk instead of creating individual partitions for some things. Basic steps that I did (have to exit out of fdisk using the 'w' command to switch drives):

1. Wipe out all partitions on /dev/hda and /dev/hdc
2. Create the boot partition on /dev/hda (primary, active, 64MB)
3. Create the swap partition on /dev/hdc (primary, 2048MB)
4. Create the root partition on /dev/hda (primary, 2048MB)
5. Create LVM partition #1 on /dev/hda (primary, 24576MB)
6. Create 2nd LVM partition on /dev/hda (primary, rest of disk)
7. Create backup root partition on /dev/hdc (primary, 2048MB)
8. Create 1st LVM partition on /dev/hdc (primary, 16384MB)
9. Create 2nd LVM partition on /dev/hdc (primary, rest of disk)

Basically, I have a 2GB root partition, a 2GB swap file, a 2GB backup root on the 2nd disk, 24GB of operating-system space on the primary disk, 16GB of temporary file space on the second disk. User space on disk 1 is around 50GB and around 95GB on disk 2. I plan on having (4) seperate LVM volume groups (vgos, vgtmp, vguser, vgmedia) rather then combining all (4) partitions into a single volume group.

Time to create the file systems, and setup the LVM volume groups. Boot volume (/dev/hda1) is ext2, root (/dev/hda2) and root mirror (/dev/hdc2) are ext3. Swap partition is /dev/hdc1, LVM partitions are vgos (/dev/hda3), vguser (/dev/hdd4), vgtmp (/dev/hdc3) and vgmedia (/dev/hdc4).

mke2fs /dev/hda1
mke2fs -j /dev/hda2
mke2fs -j /dev/hdc2
mkswap /dev/hdc1
swapon /dev/hdc1
pvcreate /dev/hda3 /dev/hda4 /dev/hdc3 /dev/hdc4
vgcreate vgos /dev/hda3
vgcreate vguser /dev/hda4
vgcreate vgtmp /dev/hdc3
vgcreate vgmedia /dev/hdc4

To create the logical volumes inside each volume group, I used the following commands. "vgos" is going to hold /opt (2GB), /usr (4GB), and /var (4GB). "vguser" is going to hold /home (32GB to start). "vgtmp" is holding /tmp (4GB) and /var/tmp (4GB).

lvcreate -L2G -nopt vgos
lvcreate -L4G -nusr vgos
lvcreate -L4G -nvar vgos
lvcreate -L32G -nhome vguser
lvcreate -L4G -ntmp vgtmp
lvcreate -L4G -nvartmp vgtmp

mke2fs -j /dev/vgos/opt
mke2fs -j /dev/vgos/usr
mke2fs -j /dev/vgos/var
mke2fs -j /dev/vguser/home
mke2fs /dev/vgtmp/tmp
mke2fs /dev/vgtmp/vartmp

What fun! Time to mount all of the volumes (no need to mkdir the "root" partition, which is why the first command here is a mount instead of a mkdir):

mount /dev//hda2 /mnt/gentoo
mkdir /mnt/gentoo/boot
mount /dev/hda1 /mnt/gentoo/boot

Mount the LVM managed volumes:

mkdir /mnt/gentoo/opt
mount /dev/vgos/opt /mnt/gentoo/opt
mkdir /mnt/gentoo/usr
mount /dev/vgos/usr /mnt/gentoo/usr
mkdir /mnt/gentoo/var
mount /dev/vgos/var /mnt/gentoo/var
mkdir /mnt/gentoo/home
mount /dev/vguser/home /mnt/gentoo/home

Mounting the two temporary folders requires special permissions to be set (per chapter 4e of the handbook).

mkdir /mnt/gentoo/tmp
mount /dev/vgtmp/tmp /mnt/gentoo/tmp
chmod 1777 /mnt/gentoo/tmp

mkdir /mnt/gentoo/var/tmp
mount /dev/vgtmp/vartmp /mnt/gentoo/var/tmp
chmod 1777 /mnt/gentoo/var/tmp

And the "proc" file system (last bit of chapter 4e in the handbook)

mkdir /mnt/gentoo/proc
mount -t proc none /mnt/gentoo/proc

Taking a break for a bit. (continued in next post)

VIA EPIA Gentoo Build

Got the VIA EPIA ME6000 system today. Only gltich off the bat was that the first 7200rpm drive that I used draws slightly too much power which resulted in the system refusing to power-up. (Hooking up an external 300W ATX power-supply proved that the components work fine.) Fortunately, I had another 7200rpm laying around with lower power requirements. (The problem drive was 500mA 3V 700mA 5V, the replacement drive is only 300mA 3V 500mA 5V. Oddly, both drives are 80GB IBM DeskStars.) A 5400rpm drive would've probably drawn even less power. So my config at the moment (unless I change drives again):

IDE0/PRI: 80GB IBM DeskStar 7200rpm
IDE0/SEC: (nothing)
IDE1/PRI: 120GB Western Digital 5400rpm
IDE1/SEC: DVD-ROM

No PCI card installed, and a 3.5" floppy-drive up front.

Now, the 120GB Western Digital has a nasty bearing whine at the moment, so I think I'll be swapping that out pretty quick for a better drive. It's definitely the loudest thing in the case, and very annoying. Haven't decided if I'll replace the 7200rpm drive with a 5400 as well (probably will, if only for power/heat reasons). The new 160GB 5400rpm drive isn't slated to arrive until Thursday, which is why things are as they are for the moment.

The Morex Venus 668 case isn't a bad little case, a bit larger then I expected. Hold a pair of paperback books up, spine-to-spine and you'll get an idea of how big the front of it is. Installing the components wasn't too bad, but it's best if you remove the power-supply during the initial installation and work from the bottom-up. A short (4") phillips-head screwdriver might have been easier to use then the regular sized ratchet screwdriver that I use.

Saturday, April 24, 2004

Gentoo Partitioning Plans

[gentoo-user] Help with new system (discusses partition sizes)

Possible partitions:

/boot ext2 64MB
- handbook says 32MB
- needs to be a primary partition, type "linux native"
- can be mounted read-only

(swap) 512MB / 1GB / 2GB
- some places say 2x physical memory, others say twice what you think you use
- I'm probably going to go with 2GB and put it on the root of the 2nd drive

/ (root) ext3
- 1GB?, should only hold selected trees such as /etc, /dev, /proc, /root, /bin, /sbin, /lib

(rootmirror) ext3
- a mirror of the root partition, typically not mounted, same size as /

Note: /home, /opt, /usr, and /var can be handled with LVM. The LVM doc suggests /usr (10GB), /home (5GB), /opt (5GB), /var (10GB), /tmp (2GB).

/home ext3
- user files, I'll probably go with a default of 5GB as any really large files (e.g. Samba shares or multi-media files) I'll stick in a seperate partition and symlink
- /home will probably end up in a seperate partition by itself, along with the multi-media storage so that I can handle that with regular backups

/opt ext3
- game servers store a bit of stuff here, I don't expect my /opt to use much, so 2GB in LVM

/tmp ext2
- same issues as /var/tmp (not sure if gentoo uses /tmp), probably

/usr ext3
- possibly mounted read-only? suggestions indicate 2-3GB

/usr/portage
- source-code, 6-8GB

/var ext3
- mail servers store mail queues here (/var/mail?), print spools also end up under /var (/var/spool?)

/var/log ext3? 3GB
- log files, good to have in seperate partition so they don't fill the server

/var/tmp ext2 8GB
- temp files, can get away with less space if /var/tmp/portage is in a seperate location (maybe only 1-4GB)
- probably put this on the 2nd drive in the system

/var/tmp/portage ext2 or ext3 5GB
- this is where gentoo compiles, I've seen statements that 5GB is not unreasonable, good candidate for putting on the 2nd drive in the system

Decisions (probably how I'll allocate it):

DISK 1:
/boot ext2 64MB
/ (root) ext3 2GB
LVM #1 24GB
/opt 2GB
/usr 4GB
/var 4GB
LVM #2 (rest of disk)
/home

DISK 2:
(swap) 2GB
/tmp ext2 4GB
/var/tmp ext2 8GB
(root mirror) 2GB
(backup partition)

Linix distros for a mini-ITX server

I'm going to build a mini-ITX file server using linux with part of my tax refund, so I'm busy trying to figure out which distro to use. So far the list is RedHat 8/9, Suse Linux 9.something, Debian, Mandrake 9.1 or 10.0 (not out yet), or Gentoo.

Yesterday, I was leaning towards Mandrake 9.1. I have the 3 CDs downloaded, but looking around I'm not sure that Samba 3.x (for file serving) is included in the 9.1 distro that I have. Plus, 9.1 is 6-10 months old (Aug 2003?), so support and updates would be drying up sooner then a newer release. I'd consider 10.0, but the ISOs aren't released yet, and there's also some questions that I have about support.

Suse I can't get ISOs for... not familiar with the Red Hat line, Debian is a maybe.

So right now, I'm seriously considering going hardcore and using Gentoo. I'm not really interested in the sound/video capabilities of the ME6000 EPIA board as this is going to be a headless file server. I'm also trying to find a linux distro to use for a file server at work (although with beefier hardware), so I need to start somewhere. At least with Gentoo I have a reference wiki about installing Gentoo on a EPIA board.

Now I just need to plow through all of the Gentoo articles on SlashDot. (Usually, if you read at level 2 or 3 you can get a good overview of what techies think about a particular product.)

The EPIA box is going to cost around $500. I went with the ME6000 board (fanless), 512MB DDR266 of memory, and the Morex Venus 668 Black case (from logicsupply.com) for $340. Add a black floppy and DVD drive and a 160GB 5400rpm drive for another $160. Should be a dead-quiet little file server. I'll probably add another 160GB drive in a few weeks once I get the system up and running. Plus, it'll give me a linux box to install PostgreSQL on so I can evaluate moving away from MySQL.

Saturday, April 03, 2004

GeekMail folds up shop

GeekMail will be discontinuing service on April 9, 2004. According to the e-mail, it sounded like an internal business dispute gone wrong.

So now I have to go shopping for a new e-mail provider (since I don't want to host my own SMTP server). The e-mail notice suggests looking at FuseMail as a replacement service. However, FuseMail doesn't support any method of accessing the mail server over a secure/encrypted link (one of the main selling points of GeekMail).