Showing posts with label dd. Show all posts
Showing posts with label dd. Show all posts

Tuesday, July 8, 2008

Creation of ISO Image of CD/DVD

If you want to create ISO image of CD/DVD in the
optical drive, please give the following command:

$ dd if=/dev/hdc of=/path/of/iso/image/xyz.iso

You can replace /dev/hdc (for Secondary Master)
with the CD/DVD drive path on your system. like

/dev/hdb (for Primary Slave)
/dev/sdc (for SATA optical drive,
or newer drive naming convention)

Monday, March 31, 2008

Dynamic Swap on File

1. Create a 500MB swap file.

$ dd if=/dev/zero of=/mnt/WinD/Swap500M bs=1024 count=500000
$ mkswap /mnt/WinD/Swap500M



2. Change variables according to your configuration (or liking) in
the following Shell script (my_swapon.sh).

#!/bin/sh

## Turns on swap ##

SWAP_PARTITION="/mnt/WinD"
SWAP_DEV="$SWAP_PARTITION/Swap500M"
if [[ -e $SWAP_DEV ]]
then
echo "$SWAP_DEV is already mounted."
else
mount $SWAP_PARTITION
fi

IS_ON=`grep -c $SWAP_DEV /proc/swaps`

if [ $IS_ON -eq 1 ]
then
echo "$SWAP_DEV is already turned on."
else
swapon $SWAP_DEV
fi


3. Run this script as root user whenever you want to
use extra swap space. (Above steps 1 and 2, need
to be done only once).

$ sudo ./my_swapon.sh