PDA

View Full Version : Smaller or custom filesystem images?


mopo3
01-30-2006, 03:55 PM
Is it possible to use a custom filesystem image, or request a specific image to be put in place? Are there any specific requirements for the images, like specific packages or kernel modules required by the Unixshell Xen setup?

I have my own Xen 3 setup for development and I use the images from http://jailtime.org. I have had great success with these images, they are tweaked for Xen 3, and are extremely minimal. For example, the Unixshell Fedora 4 image is just under 1 Gig, whereas the jailtime.org Fedora 4 image is just under 400 Meg. This would save me having to sort through what is not necessary in the Unixshell image.

matta
01-30-2006, 05:52 PM
We'll soon have functionality to upload a snapshot, so you could turn the filesystem into a properly named tgz, upload, and restore. We're having some problems related to PHP and max upload size, timeouts, etc so the feature will not be available anytime "real soon now".

I'll take a look at the jailtime images, there is no license mentioned on the site. If they are of good quality I may offer them as a supplement to our own.

mopo3
01-30-2006, 06:31 PM
I don't want to push at all, just curious if I can wait on a yes or no for the images from jailtime.org, and how long before they might be available. Or is there any way for me to put them in place on my vps only?

I'm under some pretty tight deadlines to get my servers setup and would really like to start from the smallest install possible. Once I start I won't be able to go back and start again from the smaller images.

BTW, you guys have been great so far, very impressed with your service.

matta
01-30-2006, 08:05 PM
If you really want to use their image the following will probably work.

1. Download their image for FC4. Install our FC4 image on your VM.
2. rsync their image over your installation.

rsync -avP -e ssh --delete /path/to/jailtimefc4/* root@your.ip:/

3. Reboot as many binaries will no doubt change.
4. You'll need to login to the SSH console to reconfigure the networking with your IP, gateway, etc.

jbw
01-31-2006, 04:11 AM
[QUOTE=matta]We'll soon have functionality to upload a snapshot, so you could turn the filesystem into a properly named tgz, upload, and restore. We're having some problems related to PHP and max upload size, timeouts, etc so the feature will not be available anytime "real soon now".
[/QUOTE]


Use perl to handle the file uploads, and/or offer ftp as an upload path?

I am guessing you already tried all the obvious php knobs?

mgoodman
01-31-2006, 10:28 AM
Hello, here are some steps to install your own image. It's beyond the scope of these steps to preserve SSH host keys or duplicate your existing networking setup. These steps do not require console access. The mount points are arbitrary.

On a host that can make loopback mounts:

# Found at http://www.tux.org/pub/people/kent-robotti/looplinux/rip/
wget http://www.tux.org/pub/people/kent-robotti/looplinux/rip/RIP-14.9.grub.iso
mkdir rip
mount -o loop RIP-14.9.grub.iso rip
mkdir rootfs
cd rootfs
gunzip <../rip/boot/rootfs.cgz | cpio --extract
umount ../rip

On the Xen host:

swapoff /dev/sda2
mke2fs -j /dev/sda2
mkdir /mnt/sda2
mount /dev/sda2 /mnt/sda2

On the host that can make loopback mounts:

rsync --archive --verbose --compress . root@$XEN_HOST:/mnt/sda2

On the Xen host:

mkdir /mnt/sda2/old
pivot_root /mnt/sda2 /mnt/sda2/old
mount -t proc none /proc
mount -t devpts none /dev/pts
passwd
nohup /bin/sh /etc/rc.d/rc.sshd restart

# Relogin here.

init u
kill $(lsof -t +D /old)
umount $(cat /proc/mounts | awk '{print $2}' | egrep ^/old | sort -r)
mke2fs -j /dev/sda1
mount /dev/sda1 /mnt/linux

# Do your install here.

/sbin/reboot

On the Xen host:

mkswap /dev/sda2
swapon /dev/sda2

mopo3
01-31-2006, 07:56 PM
Well I tried the simple rsync method and got an error during the rsync. The install seemed to function though, as I rebooted and everything seemed to work fine. The original image shows as 398 Meg on my dev system, while my vps showed 560 Meg. Possibly from the FS block size? I updated and triple checked /etc/hosts, /etc/resolv.conf, /etc/sysconfig/network, and /etc/sysconfig/network-scripts/ifcfg-eth0 but I couldn't get domains to resolve (DNS). So of course yum couldn't find it's repositories.

Since rsync gave me an error, I decided to try the more involved method above from mgoodman. Everything went fine. I worked from the console and got booted during part of the process, but could ssh in no problem. So, messing up at the wrong moment could mean having to reinstall from teknic and start over. The system rebooted fine, but again, nothing would resolve.

So obviously something is missing in my settings or from my image. I know the image does work on a class C network, as I use the exact image (minus the hosts, resolv.conf, network settings) on my dev server.

Any ideas on what could be causing domains to not resolve?
Here's the services and daemons on the system:

# service --status-all
auditd is stopped
netplugd is stopped
Configured devices:
lo eth0
Currently active devices:
lo eth0
rdisc is stopped
saslauthd is stopped
sshd (pid 1456) is running...
syslogd (pid 1447) is running...
klogd (pid 1449) is running...
Nightly yum update is disabled.

# chkconfig --list
auditd 0:off 1:off 2:on 3:off 4:on 5:on 6:off
netfs 0:off 1:off 2:off 3:off 4:on 5:on 6:off
netplugd 0:off 1:off 2:off 3:off 4:off 5:off 6:off
network 0:off 1:off 2:on 3:on 4:on 5:on 6:off
rdisc 0:off 1:off 2:off 3:off 4:off 5:off 6:off
saslauthd 0:off 1:off 2:off 3:off 4:off 5:off 6:off
sshd 0:off 1:off 2:on 3:on 4:on 5:on 6:off
syslog 0:off 1:off 2:on 3:on 4:on 5:on 6:off
yum 0:off 1:off 2:off 3:off 4:off 5:off 6:off

matta
01-31-2006, 08:26 PM
Make sure you set the default route to 169.254.1.1. That is the only thing I can think of you may not be setting correctly.

PS: If you need more information this has been discussed on the forums previously.

mopo3
01-31-2006, 11:57 PM
Well it is my opinion that one can install a custom filesystem. I think the straight rsync over an existing setup would work, not sure what the rsync error I got was from. May have been network related or something.

The method outlined above by mgoodman definitely seemed to work well and is probably the "correct" way to go about it.

Unfortunately, I think there are config issues with my image and the routing as you have it set up. I will probably not troubleshoot it as I'm really pressed for time.

I read elswhere that soon we will be able to boot up a recovery system and mount our filesystem? That would make a lot of things much easier.

Anyway, that should probab;y wrap up this thread? Maybe the procedure outlined by mgoodman should go in the "howto" forum?

yokem55
02-06-2006, 10:00 PM
I've done this some with installing a custom uclibc image. I uploaded the uclibc system in a tarball via scp and unpacked it on my host in a directory (say /mnt/sys-uclibc). I then bind mounted the root file system into /mnt/sys-uclibc/mnt/ with something like:
$ mount -o bind / /mnt/sys-uclibc/mnt/.

I then chrooted into the new environement and then: 1) deleted the root fs from the mnt directory (but not delete the mnt directory inside the bind mount, that is where the new system is!), and then copied the new sytem into the bind mount.

This method is a little tricky, but it does work....