STORAGE MANAGEMENT IN LINUX

Storage in Linux

Similar to all other computing platforms such as Windows,UNIX,Mac, Linux is capable of working with most of the storage technologies that are available in the market today. Common Storage devices:-

1)Hard disk drive (HDD)/ Serial Adv. Technology Attachment (SATA) -
used to hold greater quantities of date and are available in low prices compared to early days of computers.

2)Solid State Drive (SSD) -
SSD uses Integrated Circuit (IC) assemblies to store data using flash memory.

3)USB Flash drive -
A data storage device that includes Flash memory with inbuilt USB interface. This is Plug and Play device.

4)External Storage Devices -
This includes various Optical devices - CD/DVD/Bluray disks and External Hard disk drives.

5)Secure Digital (SD)-
SD cards are a tiny flash memory card storage for small portable devices.

List block devices


#lsblk
      

Create a new partition







#mkdir /mnt/Linux1
#mount /dev/nvme0n1 /mnt/Linux1
#cd /mnt/Linux1
#touch file1 file2 file3
# ls –l
      

Create partition on SATA/SSD Hard disk- on second HDD

1) Intialize fdisk with the following cmd:

#fdisk /dev/sdb
      
2)Now fdisk display following screen:

Command (m for help): m <enter>
Command action
a   toggle a bootable flag
b   edit bsd disklable
c   toggle the dos compatibility flag
d   delete a partition
l   list known partition types
m   print 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 empty sun disklable 
t   change a partition's system id
u   change display/entry units
v   verify the partition table
w   write table to disk and exit
x   extra functionality (experts only)
Command (m for help) :
      
3) We want to add a new partition. Type "n" and press Enter

Command action
e   extended
p   primary partition (1-4)
4) We want to add first primary partition , Enter “p” type 1 for first partition

partition number (1-4)
5) Option will be displayed First Sector : Press Enter
6) Last Sector : +1G for 1GB partition
7) Finally save the partition using :w command
8) Run following command to update changes

#partprobe /dev/sdb
9) See the new partition updated information using

#fdisk –l
10) Create a filesystem xfs

#mkfs.xfs -f /dev/sdb1
11) Create a directory to mount this new partition

#mkdir /mnt/aitvolume
12) Now mount this partition on the directory

#mount /dev/sdb1 /mnt/aitvolume
13) Access this partition

#cd /mnt/aitvolume
#touch file1 file2 file3 file4
#ls –l