hey there welcome back to our channel in
today's tutorial I will explain how to
create partitions in Linux with FIS
command abis command is a powerful
command line tool that allows you to
create modify and delete partitions on
your Linux system before we start ensure
you have the following things in place a
running Linux system root privileges or
sud sudo user with admin Dives basic
understanding of disk and partitions I
have attached 12gb raw dis on on my
Linux system I will be using this dis to
create two partitions of size 5gb and we
format them with extended 4 and xfs file
system respectively let's get started
first step is to identify the newly
attached RW disk for that we can run the
command
sudu f
disk
hphl if you see the output carefully we
have have two dis SL D SDA and/ d/
sdb
SDA is of 30
GB which already has the
partitions and we have sdb2 of size 12gb
and this disc doesn't have any
partitions so we will be using this sdb2
which is a RW desk alternate way to
verify this desk dis run the command
lsblk in the output I can see there is a
disk SDA which has two partition SDA 1
SDA 2 and we have one more
desk with the name
sdb of size 12 GP and it doesn't have
any partitions so this confirms that
this is our newly attached row dis of
size 12 GB so we will be using this disk
to create partitions on
it in order to create partitions on the
target disk that is /d/
sdb we need to run the command
sudu
Fisk followed by the disk
name
sdp hit enter
it will take us to the f disk
interactive
menu if you type M here we will get the
help in order to create a new Partition
Type n
here and hit enter it will prompt you to
enter the partition type first four
partitions on any disk are considered as
primary partitions so Type e
here partition number will be one
enter it enter to accept the default
first
sector in the last sector specify the
size of your
partition let's say I want to give a
size 5gb so type
plus 5
G and hit
enter
output confirms that it has created a
partition of type lenux of size 5 ZB and
partition number is one by default F dis
command creates a partition of type
Linux if you want to change this
partition type you need to change the
toal ID for that partition for that you
need to type T here and hit
enter Type
L so this is the toggle ID for Linux
partition type if you want to change the
tole
ID just type the number here let's say
you want to set it as swap so type 82
here and hit enter in my case I don't
want to change the partition type so I
want this partition as as Linux so type
83 here now create our second partition
Type
n again P for primary
partition this would be our second
partition accept the first sector as
default one and the last sector specify
the size for your
partition say 5G again all right in
order to write these changes to the desk
we need to type w and hit enter this
output confirms that partition table has
been altered let's verify whether the
new partitions are visible under the
disk /d/ sdb for that the
[Music]
command so do f
disk py l/ Dev SL
sdb as you can see we have two
partitions
/d/
sdb1 and
sdb2 of type
lenux and whose togal ID is
83 size is 5G to use these partitions we
have to format these partition
I will format first partition with
extended 4 file system and second one
with xfs file system and the command to
do mkfs mkfs is the command to format
the partitions mkfs dot
ext4
/d/
sdb1
similarly format the second
partition this time it's type would be
xfs output of both the commands confirms
that sdb1 has been formatted
successfully with the type extended four
file system and
sdb2 has been successfully formatted
with the xfs file system next create the
mount point for these partitions so I'm
creating SL opt SL data 1 as a mount
point for sdb1 and/ opt data 2 as amount
point for sdb2 to do
mkd data
one now run the mount command to mount
this partition
in this this is the partition number so
on this dis
sdb1 is the partition number and this is
the Mount point so this partition will
be mounted on this Mount Point hit
enter similarly Mount the second
partition
sdb2 on data
to now run the DF
command in the output you can see
sdb1 is successfully mounted
on/ op / data 1 whose file system type
is extended for size is 5gb similarly
sdb2 is mounted on opt / data 2 whose
file system type is xfs size is 5gb in
order to mount these
partitions on these Mount points
we must
add these partitions entries in the/ cc/
FST file something like
this this is the
partition name this is the Mount point
for this
partition the file system type for this
partition so in this case this it is
extended
4 and then
defaults Z space z similarly add the
entry for sdb2
partition this case File system type is
xfs save and close the file now run to
do Mount hyphen a
now even if this Linux system gets
rebooted these partitions will be
automatically mounted on these Mount
points that's all from this video
tutorial I hope you have found it useful
and informative please do like the video
subscribe to our channel for more Tech
tutorials like this see you in the next
video bye