PDA

Bekijk de volledige versie : Swap is not mounted



tuxianer
06-02-2008, 14:56
hi,
i have configured this:



mkdir -p /usr/local/sbin/
touch /usr/local/sbin/post-boot
touch /usr/local/sbin/post-firewall
touch /usr/local/sbin/post-mount
touch /usr/local/sbin/pre-shutdown
chmod +x /usr/local/sbin/*

fdisk /dev/discs/disc0/disc //create partitions

mkswap /dev/discs/disc0/part1
swapon /dev/discs/disc0/part1

mke2fs -j /dev/discs/disc0/part2
mke2fs -j /dev/discs/disc0/part3

vi /usr/local/sbin/post-boot

flashfs save && flashfs commit && flashfs enable && reboot


post-boot:

# test if USB disc has been attached
# if not - then insert needed modules
#
# Die folgenden 4 Rauten entfernen, wenn eine USB-Platte angeschlossen ist. Beim WL-HDD nicht notwendig, da IDE.
#if [ ! -d /dev/discs ]
#then
#insmod scsi_mod && insmod sd_mod && insmod usb-storage && sleep 5s
#fi

#Wait for /opt to mount
mount /dev/discs/disc0/part2 /opt
i=0
while [ $i -le 30 ]
do
if [ -d /opt/etc ]
then
break
fi
sleep 1
i=`expr $i + 1`
done

# Activate swap
swapon /dev/discs/disc0/part1

# Mount the rest
mount /dev/discs/disc0/part3 /tmp/harddisk

# Run all active services - active means starts with S
/opt/etc/init.d/rc.unslung


[admin@WL-HDD root]$ free
total used free shared buffers
Mem: 13876 11060 2816 0 1364
Swap: 0 0 0
Total: 13876 11060 2816

[admin@WL-HDD root]$ df
Filesystem 1k-blocks Used Available Use% Mounted on
/dev/root 3008 3008 0 100% /
/dev/discs/disc0/part2 988244 16432 921612 2% /tmp/harddisk
/dev/discs/disc0/part3 37017900 131228 35006264 0% /tmp/harddisk/part1

[admin@WL-HDD root]$ fdisk -l

Disk /dev/ide/host0/bus0/target0/lun0/disc: 40.0 GB, 40060403712 bytes
255 heads, 63 sectors/track, 4870 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/ide/host0/bus0/target0/lun0/part1 1 63 506016 82 Linux swap
/dev/ide/host0/bus0/target0/lun0/part2 64 188 1004062+ 83 Linux
/dev/ide/host0/bus0/target0/lun0/part3 189 4870 37608165 83 Linux


swap is not mounted and part2 is not mounted in /opt

al37919
06-02-2008, 15:51
as to "part2 is not mounted in /opt":
you may try to insert

sleep 15s
before

mount /dev/discs/disc0/part2 /opt
Alternatively you may try to use:

mount -o bind /tmp/harddisk /opt
If it helps you may try to decrease the above mentioned delay.