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

swap questions



Hi,

> > It boots fine except we are seeing.
> > Activating swap...done.
>
> that 'Activating swap' comes from the initscript from the normal system.
> it enables, if any, a swap partition found in /etc/fstab.
>
> /etc/fstab contains automatically a swap partition if live-initramfs has
> found any usable swap partition on the machine.
>
> > Warning! dirs delete and imap options to remount are ignored
>
> this is a message from unionfs and has nothing directly to do with swap,
> but may have been triggered by an initscript before.
>
> in any case, you can ignore that message anyway.
Thanks.

>
> > 2. We would like as much free RAM as possible. Is using a nbd for swap
> > a good idea?
>
> depends. by default, a live system requires around 50mb because of
> 'modifications' on the rootfs during system startup. these modifications
> consume ram.
>
> if you use lenny or sid, live-initramfs will require a bit less memory
> because it mounts rootfs with noatime.
>
> > I've tried it on one diskless server but can see that I'm going to
> > need to tell each individual server the nbd port to use.
> > How would you do that? With a persistent partition? Or perhaps this
> > can be done with initramfs scripting?
>
> the easiest, fastest and best thing would be, that you have a local
> harddisk with a linux swappartition on it. this way, you don't need to
> configure anything and it's beeing used automatically.
>
> if that doesn't suit your needs, i'd go for an additional initscript
> setting up the swap, or by modifying the swap script in
> casper/live-initramfs.
>
I've used AoE to export a swap partition.
And some (probably incorrect) hacks in live-inistramfs

# vim /etc/initramfs-tools/scripts/live
aoeswapdev=*)
    AOESWAPDEV="${ARGUMENT#aoeswapdev=}"
    export AOESWAPDEV
    ;;

# vim /etc/initramfs-tools/scripts/live-bottom/13swap

.......
log_begin_msg "Setting up swap..."

# live-initramfs script

FSTAB=/root/etc/fstab

if [ -n "${AOESWAPDEV}" ]
then
{
        modprobe aoe
        while [ 1 ]
        do
             ls /dev | grep -q etherd && break || echo -n .
             sleep 1
        done
        while [ 1 ]
        do
             echo > /dev/etherd/discover
             sleep 1
             ls /dev/etherd | grep -q 'e[0-9][0-9]*\.[0-9][0-9]*' &&
break || echo -n .
        done
        sleep 1
        cat >> $FSTAB <<EOF
"${AOESWAPDEV}" swap swap defaults 0 0
EOF
}
else
{
devices=""
for device in /dev/[hs]d[a-z][0-9]*; do
    if ! [ -b "$device" ]; then
......
}
fi

It works... but I'd like to know if you think it's done properly.

Thanks.
Chris.

> --
> Address:        Daniel Baumann, Burgunderstrasse 3, CH-4562 Biberist
> Email:          daniel.baumann at panthera-systems.net
> Internet:       http://people.panthera-systems.net/~daniel-baumann/
>
> _______________________________________________
> debian-live-devel mailing list
> debian-live-devel at lists.alioth.debian.org
> http://lists.alioth.debian.org/mailman/listinfo/debian-live-devel
>



Reply to: