Steps to configure a Standard Partition and mounting a file system to the server
Steps to configure a Standard Partition and mounting a file system to the server
Step 1.
Login server with the IP address and user credential
(Login
as a root if root access is denied the need to enter sudo before all the
following commands)
Step 2
Add a hard disk to the server.
Step 3:
Once the Hard disk is inserted into the server make sure
that HDD is reflating in the server while executing the below command and to
find the info (kindly refer to the below note)
Note: the primary HDD is will be enabled in the name of
/dev/sda and if you are adding more HDD to the server, it will be increased in
alphabetic order (example: sdb, sdc, sde)
Like below snap
To check the overall insert & partitioned HDD list
$[root@localhost ~]# lsblk -l
Step 4: now we know that HDD is connected and HDD is
reflecting in the server, hence we will start to do the partition on the newly
connected HDD.
Go to inside à
newly added HDD à
with the help of the below command.
[root@localhost ~]# fdisk /dev/sdb
To see the option and helps enter below a command
Command (m for help): m (marked in yellow color)
To initiate a partition, press enter n (add new partition)
Command (m for help): n
1 Partition type:
p primary (0 primary, 0 extended, 4 free)
e extended
2 Need to choose Partition type: p (default)
3 First sector (2048-209715199, default 2048): +1024MB(we
can assign space in MB)
4 Last sector, +sectors or +size {K,M,G} (2000000-209715199,
default 209715199): +10000MB( assign size which you required in the HDD)
5, once the partition is created below messages, will appear
(Partition 1 of type Linux
and of size 9.3 GiB is set)
All steps marked in the below snap
To confirm the changes is done below popup message will appear in CLI
Calling ioctl() to re-read partition table.
Example: I have created a new directory inside the /home
directory
Go to à
home directory using ($cd /home)à
once get into the home directory using à
below command create a directory
[root@Kalyanimotors home]# mkdir backup_hdd ( to create a directory)
[root@Kalyanimotors backup_hdd]# mkfs.xfs /dev/sdb1 (to create an xfs file system with partition)
Once executed above command output will be
Till now we have completed the Partition on the newly inserted HDD-&Now we will see how to mount the filesystem on a newly created directory;
[root@Kalyanimotors backup_hdd]# mount /dev/sdb1
/home/backup_hdd (to mount a file sytem
to directory)
Step 8: make sure that the mounting process is completed. Hence run the below command
# df -h (to check the
file system in Linux)
after running the above command mounted file system should
be reflected like below.
/dev/sdb1 1.9T 33M
1.9T 1% /home/backup_hdd
Step 9:
Note
IMP: To save the above mounting file system permanently we need to update the
fstab file. ( because if the server is rebooted mounted file system will be
unmounted, hence we need to remount again the same to avoid this must need to
update the fstab file.
--------------------------------Before editing fstab file
---------------------------------------------------------------
# cat /etc/fstab (to read a fstab file use this command)
------------------------------After editing fstab file---------------------------------------------------------------------------------
You have to edit your config info into the fstab file
[root@Kalyanimotors backup_hdd]# vi /etc/fstab (to edit a fstab file)
Example: /dev/sdb1 /home/backup_hdd xfs
defaults 0 0 (this
info I have configured in my server)
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!Here we goooooooooo!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
We have successfully
completed the partition and mounted the file system on the server
Thank you
Comments
Post a Comment