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)


$ fdisk -l to list out the inserted HDD disk in the server

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


Primary HDD: sda1 sda2


Newly added HDD: sdb


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                                                                                                                                                                                                                                                                                                                                                                                                                                                           

After following all steps need to enter the w command.    
Command (m for help): w    

To confirm the changes is done below popup message will appear in CLI

Calling ioctl() to re-read partition table.

Syncing disks.   

Note: The mentioned command will be saved the changes (intimating to a kernel that we have done some changes in the partition table changes). 

  6: need to enter the below command to sync up the changes  

partprobe /dev/sdb  ( to intimate the kernel without rebooting the server that the partition table has been modified )                                                                                                                                                                                                                                                                                                                             

                        
                                                                                                                                              Step 5: Create one directory in the server (anywhere inside the server).

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)



Step 6: now we need to create  a filesystem using the below commands;

[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;

 Step 7: We have mounted the file system to the 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)



Now if u reboot also file system will not impact anything……

 

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!Here we  goooooooooo!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

We have successfully completed the partition and mounted the file system on the server

Thank you


Comments

Popular posts from this blog

SAP B1SiteUser Password Reset || SAP Business One

Service pack migration SLES 15 SP1 to SLES 15 SP5 x86_64

SAP HANA Server (SUSE) – Service Restart Procedure || Server Maintance