<<

Partitioning

• Pre-Installation tool – Disk Druid • Post-Installation tools – – Parted – Cfdisk – Naming Conventions

Controller Master / Slave Solaris

Primary Master hda c0d0 IDE-0 Primary Slave hdb c0d1

Secondary Master hdc c1d0 IDE-1 Secondary Slave hdd c1d1 Commands

To view list of partitions [root@comp1 ~]#fdisk -l Creation of Partition

Creating a new partition [root@comp1 ~]#fdisk Creation of Partition

Creating a new partition [root@comp1 ~]#fdisk /dev/hda The number of cylinders for this disk is set to 4865. There is nothing wrong with that, but this is larger than 1024, and could in certain setups cause problems with: 1) that runs boot (e.g., old versions of LILO) 2) booting and partitioning software from other OSs (e.g., DOS FDISK, OS/2 FDISK)

Command (m for ): m Command action a toggle a bootable flag b edit bsd disklabel c toggle the compatibility flag d delete a partition l list known partition types m this menu n add a new partition o create a new empty DOS partition table p print the partition table q quit without saving changes s create a new empty Sun disklabel t change a partition's system id u change display/entry units v verify the partition table w write table to disk and x extra functionality (experts only)

Command (m for help): Commands

Updates the partition table to kernel without restarting [root@comp1 ~]#partprobe vs Ext3

Ext2 Ext3

• No journaling support • Journaling supported

• Less speed • speed

• Less secure • More secure Formatting of partition

To partition using ext3 filesystem [root@comp1 ~]#mkfs.ext3

To format partition using ext2 filesystem [root@comp1 ~]#mkfs.ext2

To format partition using vfat filesystem [root@comp1 ~]#mkfs.vfat Mounting Filesystem

Created a directory for mounting the partition [root@comp1 ~]#

To the filesystem on the created directory [root@comp1 ~]#mount

To unmount the filesystem [root@comp1 ~]#umount Mounting Filesystem - Permanently

To mount filesystem permanently [root@comp1 ~]#vi /etc/fstab /etc/fstab

To add the entry # This file is edited by fstab-sync - see 'man fstab-sync' for details LABEL=/1 / ext3 defaults 0 0 /dev/hda1 /boot ext3 defaults 1 2 None /dev/pts devpts gid=5,mode=620 0 0 None /dev/shm tmpfs defaults 0 0 LABEL=/home1 /home ext3 defaults 0 0 none /proc proc defaults 0 0 none / sysfs defaults 0 0 /dev/hda2 /usr ext3 defaults 0 0 LABEL=/var1 /var ext3 defaults 1 2 LABEL=SWAP-hda7 swap swap defaults 0 0 /dev/hdd /media/cdrom auto pamconsole,exec,noauto,managed 0 0 /dev/hda10 /mnt ext3 defaults 0 0 Converting from Ext2 to Ext3

Unmount the partition [root@comp1 ~]#umount

Converting from Ext2 to Ext3 filesystem [root@comp1 ~]#tune2fs –j

Mount the partition to use it [root@comp1 ~]#mount [root@comp1 ~]#mount Converting from Ext3 to Ext2

Unmount the partition [root@comp1 ~]#umount

Converting from Ext3 to Ext2 filesystem [root@comp1 ~]#tune2fs –O ^has_ journal

Mount the partition to use it [root@comp1 ~]#mount [root@comp1 ~]#mount Label

To assign label [root@comp1 ~]#e2label

To view existing label [root@comp1 ~]#e2label

To see mounted partition with Label [root@comp1 ~]#mount -l How swap works ?

New Process D Process

RAM HDD Swap Process C Partition

Process B hda3

Idle Process A hda2

Operating hda1 System

RAM FULL Creation of Swap partition

Creating a new partition [root@comp1 ~]#fdisk

To make a partition swap partition [root@comp1 ~]#mkswap Swap Partition

To enable swap on the swap partition [root@comp1 ~]#swapon

To check the status of swap used [root@comp1 ~]#swapon -s

To disable the swap partition [root@comp1 ~]#swapoff