Swapping & Raid 1 In Red Hat Linux
1. SWAPPING COMMANDS
1.1. CREATING A SWAP PARTITION
fdisk –l
fdisk /dev/sda
m //menu for commands using in fdisk
n //add new partition
p //primary partition
3 //numberof partition
//enter for taking default value
+512M //partition size
p //print the partitions
t //change FileSystem of the partition
3 //number of partition
L //if you want to display the listcodes
82 //code for SWAP
p //print the partitions
w //saving changes
partprobe /dev/sda
1.2. MAKING A SWAP PARTITION
mkswap /dev/sda3 //creates a SWAP device
swapon –s //verify that theSWAP is running
swapon /dev/sda3 //enable a SWAP space
swapon –s
blkid
blkid | grep /dev/sda3 >> /etc/fstab
nano /etc/fstab
/dev/sda3 swap swap defaults 0 0 //use TAB to separate each fieldexcept 0 0, which separate in between by one space
ctrl + x //to exit
y //yes to save changes
//enter for saving file with the same name
init 6 //or use the “reboot” command **RECOMMENDED**
1.3.MAKING A SWAP FILE
swapon –s
dd if=/dev/zero of=/mnt/fswap bs=1024 count=500000 //dd=duplicate disk //if=input file //of=output file
ls –lh /mnt/ fswap
mkswap /mnt/fswap
swapon –s
swapon/mnt/fswap
swapon –s
2. RAID 1 COMMANDS
fdisk –l
fdisk /dev/sda
n //add new partition
e //extended partition
//enter for taking default value
+2000M //partition size
n //add new logicpartition
//enter for taking default value
+256M //partition size
n //add new logic partition
//enter for taking default value
+256M //partition size
p //print the partitions
t //change FileSystem ofthe partition L
//if you want to display the list codes
5 //number of partition
fd //code for Linux RAID autodetect
p //print the partitions
t //change FileSystem of the partition
L //if youwant to display the list codes
6 //number of partition
fd //code for Linux RAID autodetect
p //print the partitions
w //saving changes
partprobe /dev/sda
reboot //or use the “init 6” command...
Regístrate para leer el documento completo.