Mia mikrh apogohteush

Alexios Chouchoulas alexios at vennea.demon.co.uk
Fri Feb 28 06:25:06 EET 1997


> Pou to ftiaxno? 8elo na po den prepei na xalaso ena partition?
> Dhaldh an "koco" ena meros apo to partition tou linux den 8a xreiastei
> format kai ola apo thn arxh?

  An den exeis partition kai den theleis na ftiakseis kainourio (den
xreiazetai format, mporeis na kaneis non-destructive repartitioning -- des
to FIPS.EXE sta CD tou Linux) mporeis na ftiakseis arxeio. Na mia kapws pio
asfalhs kai genikevmenh parallagh tou script pou emfanisthke prin apo kati
wres sth lista (treksto xwris parametrous gia na sou pei ti kanei).


#!/bin/bash

# Elegxoume gia swsth syntaksh

if [ .$1 = . -o .$2 = . ]; then
        echo Syntax: $0 swapfile_filespec size_in_MBytes
        echo         eg $0 /swap/new_swap 16
        exit
fi

fname=$1
blocks=$[$2<<10]


# Elegxoume an to arxeio einai absolute filename (dhl arxizei apo to root
# directory).

if [ `echo $fname|cut -b 1` \!= / ]; then
        echo You MUST use an absolute filename.
        echo For example, \"/boot/swap/new_swap\", NOT just \"new_swap\"
        exit
fi


# Den peirazoume arxeia pou yparxoun hdh.

if [ -e $fname ]; then
        echo File $fname already exists.
        exit
fi


# Ok, fygame.

echo Creating swapfile $fname, $blocks kbytes.
dd if=/dev/zero of=$fname bs=1024 count=$blocks &&
sync &&  # Afto deixnei na xreiazetai, xmmmm.
mkswap $fname $blocks &&
sync &&
swapon $fname &&
cp /etc/fstab{,-old} &&
echo $fname none swap defaults 1 1 >>/etc/fstab &&
echo Done, old /etc/fstab saved as /etc/fstab-old

A.

Alexios Chouchoulas          '88    ,88'   ,88'     alexios at vennea.demon.co.uk
The Unpronouncable One      ,o88oooo88ooooo88oo,              axc at dcs.ed.ac.uk
==================================================================
For help on using this list (linux-greek-users), send a message to
"majordomo at argeas.argos.hol.gr" with one line of text: "help".
For any problem send e-mail to owner-linux-greek-users
==================================================================



More information about the Linux-greek-users mailing list