Partition PDF

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 18

1

1
Partitioning

Pre-Installation tool
Disk Druid
Post-Installation tools
Fdisk
Parted
Cfdisk
sfdisk

2
Naming Conventions

Controller Master / Slave Linux Solaris

Primary Master hda c0d0


IDE-0
Primary Slave hdb c0d1

Secondary Master hdc c1d0


IDE-1
Secondary Slave hdd c1d1

3
Commands

To
Toview
viewlist
listof
ofpartitions
partitions
[root@comp1
[root@comp1 ~]#fdisk -l <devicename>
~]#fdisk -l <device name>

4
Creation of Partition

Creating
Creatingaanew
newpartition
partition
[root@comp1
[root@comp1 ~]#fdisk <devicename>
~]#fdisk <device name>

5
Creation of Partition

Creating
Creatingaanew newpartition
partition
[root@comp1
[root@comp1~]# ~]#fdisk /dev/hda
The
Thenumber
numberof ofcylinders
cylindersfor
forthis
thisdisk
diskisisset
settoto4865.
4865.
There
Thereisisnothing
nothingwrong
wrongwith
withthat,
that,but
butthis
thisisislarger
largerthan
than1024,
1024,
and
andcould
couldinincertain
certainsetups
setupscause
causeproblems
problemswith: with:
1) software that runs at boot time (e.g., old versions of
1) software that runs at boot time (e.g., old versions of LILO) LILO)
2)
2)booting
bootingand
andpartitioning
partitioningsoftware
softwarefrom
fromother
otherOSs
OSs
(e.g.,
(e.g.,DOS
DOSFDISK,
FDISK,OS/2
OS/2FDISK)
FDISK)
Command
Command(m
(mfor
forhelp):
help):m
Command
Commandaction
action
aa toggle
toggleaabootable
bootableflag
flag
bb edit
editbsd
bsddisklabel
disklabel
cc toggle
togglethe thedos
doscompatibility
compatibilityflag
flag
dd delete
deleteaapartition
partition
ll list known partition types
list known partition types
mm print
printthis
thismenu
menu
nn add
addaanewnewpartition
partition
oo create
create a newempty
a new emptyDOSDOSpartition
partitiontable
table
pp print
printthe
thepartition
partitiontable
table
qq quit
quitwithout
withoutsaving
savingchanges
changes
ss create
createaanew newempty
emptySunSundisklabel
disklabel
tt change
changeaapartition's
partition'ssystem
systemidid
uu change display/entry
change display/entry units units
vv verify
verifythethepartition
partitiontable
table
ww write
writetable
tabletotodisk
diskand
andexit
exit
xx extra
extrafunctionality
functionality(experts
(expertsonly)
only)
Command
6
Command(m
(mfor
forhelp):
help):

6
Commands

Updates
Updatesthe
thepartition
partitiontable
tableto
tokernel
kernelwithout
withoutrestarting
restarting
[root@comp1 ~]#partprobe
[root@comp1 ~]#partprobe

7
Ext2 vs Ext3

Ext2 Ext3

No journaling support Journaling supported

Less speed More speed

Less secure More secure

8
Formatting of partition

To
Toformat
format partition
partitionusing
usingext3
ext3filesystem
filesystem
[root@comp1 ~]#mkfs.ext3 <partition>
[root@comp1 ~]#mkfs.ext3 <partition>

To
Toformat
format partition
partitionusing
usingext2
ext2filesystem
filesystem
[root@comp1
[root@comp1~]#mkfs.ext2
~]#mkfs.ext2 <partition>
<partition>

To
Toformat
formatpartition
partitionusing
usingvfat
vfatfilesystem
filesystem
[root@comp1 ~]#mkfs.vfat <partition>
[root@comp1 ~]#mkfs.vfat <partition>

9
Mounting Filesystem

Created
Createdaadirectory
directoryfor
formounting
mountingthe
thepartition
partition
[root@comp1 ~]#mkdir <directory name>
[root@comp1 ~]#mkdir <directory name>

To
Tomount
mountthe
thefilesystem
filesystem on
onthe
the created
createddirectory
directory
[root@comp1
[root@comp1~]#mount
~]#mount <partition>
<partition> <directory
<directoryname>
name>

To
Tounmount
unmountthe
thefilesystem
filesystem
[root@comp1
[root@comp1~]#umount
~]#umount <directory
<directoryname>
name>

10

10
Mounting Filesystem - Permanently

To
Tomount
mountfilesystem
filesystempermanently
permanently
[root@comp1
[root@comp1~]#vi
~]#vi /etc/fstab
/etc/fstab

11

11
/etc/fstab

To
Toadd
addthe
theentry
entry
##This
Thisfile
fileisisedited
editedby
byfstab-sync
fstab-sync--see
see'man
'manfstab-sync'
fstab-sync'for
fordetails
details
LABEL=/1
LABEL=/1 // ext3
ext3 defaults
defaults 0000
/dev/hda1
/dev/hda1 /boot
/boot ext3
ext3 defaults
defaults 1122

None
None /dev/pts
/dev/pts devpts
devpts gid=5,mode=620
gid=5,mode=620 0000
None
None /dev/shm
/dev/shm tmpfs
tmpfs defaults
defaults 0000

LABEL=/home1
LABEL=/home1 /home
/home ext3
ext3 defaults
defaults 0000

none
none /proc
/proc proc
proc defaults
defaults 0000

none
none /sys
/sys sysfs
sysfs defaults
defaults 0000

/dev/hda2
/dev/hda2 /usr
/usr ext3
ext3 defaults
defaults 0000
LABEL=/var1
LABEL=/var1 /var
/var ext3
ext3 defaults
defaults 1122
LABEL=SWAP-hda7
LABEL=SWAP-hda7 swap
swap swap
swap defaults
defaults 0000
/dev/hdd
/dev/hdd /media/cdrom
/media/cdrom auto
auto pamconsole,exec,noauto,managed
pamconsole,exec,noauto,managed0000
/dev/hda10
/dev/hda10 /mnt
/mnt ext3
ext3 defaults
defaults 0000

12

12
Converting from Ext2 to Ext3

Unmount
Unmountthe
thepartition
partition
[root@comp1 ~]#umount <partition>
[root@comp1 ~]#umount <partition>

Converting
Convertingfrom
fromExt2
Ext2to
toExt3
Ext3filesystem
filesystem
[root@comp1
[root@comp1~]#tune2fs
~]#tune2fs jj <partition>
<partition>

Mount
Mountthe
thepartition
partitionto
touse
useitit
[root@comp1
[root@comp1 ~]#mount <partition> <directoryname>
~]#mount <partition> <directory name>
[root@comp1
[root@comp1~]#mount
~]#mount

13

13
Converting from Ext3 to Ext2

Unmount
Unmountthe
thepartition
partition
[root@comp1 ~]#umount <partition>
[root@comp1 ~]#umount <partition>

Converting
Convertingfrom
fromExt3
Ext3to
toExt2
Ext2filesystem
filesystem
[root@comp1
[root@comp1~]#tune2fs
~]#tune2fs O O^has_
^has_journal
journal <partition>
<partition>

Mount
Mountthe
thepartition
partitionto
touse
useitit
[root@comp1
[root@comp1 ~]#mount <partition> <directoryname>
~]#mount <partition> <directory name>
[root@comp1
[root@comp1~]#mount
~]#mount

14

14
Label

To
Toassign
assignlabel
label
[root@comp1
[root@comp1 ~]#e2label <partition> <label_name>
~]#e2label <partition> <label_name>

To
Toview
viewexisting
existinglabel
label
[root@comp1
[root@comp1~]#e2label
~]#e2label <partition>
<partition>

To
Tosee
seemounted
mountedpartition
partitionwith
withLabel
Label
[root@comp1 ~]#mount -l
[root@comp1 ~]#mount -l

15

15
How swap works ?

New
New
Process Process D
Process

RAM HDD
Swap
Process C Partition

Process B hda3

Idle
Idle Process A hda2

Operating hda1
System

RAM
RAM
FULL
FULL

16

16
Creation of Swap partition

Creating
Creatingaanew
newpartition
partition
[root@comp1
[root@comp1 ~]#fdisk <options> <partition>
~]#fdisk <options> <partition>

To
Tomake
makeaapartition
partitionswap
swappartition
partition
[root@comp1
[root@comp1~]#mkswap
~]#mkswap<partition>
<partition>

17

17
Swap Partition

To
Toenable
enableswap
swapon
onthe
theswap
swappartition
partition
[root@comp1 ~]#swapon <partition>
[root@comp1 ~]#swapon <partition>

To
Tocheck
checkthe
thestatus
statusof
ofswap
swapused
used
[root@comp1
[root@comp1~]#swapon
~]#swapon -s-s<partition>
<partition>

To
Todisable
disablethe
theswap
swappartition
partition
[root@comp1
[root@comp1~]#swapoff
~]#swapoff <partition>
<partition>

18

18

You might also like