Disk Managment Linux Cli
Disk Managment Linux Cli
Disk Managment Linux Cli
Then
[root@localhost ~]# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 30G 0 disk
├─sda1 8:1 0 9.3G 0 part /boot
└─sda2 8:2 0 19.6G 0 part
├─cl-root 253:0 0 13G 0 lvm /
└─cl-swap 253:1 0 6.5G 0 lvm [SWAP]
sdb 8:16 0 50G 0 disk
sr0 11:0 1 1024M 0 rom
DOS (MBR)
a toggle a bootable flag
b edit nested BSD disklabel
c toggle the dos compatibility flag
Generic
d delete a partition
F list free unpartitioned space
l list known partition types
n add a new partition
p print the partition table
t change a partition type
v verify the partition table
i print information about a partition
Misc
m print this menu
u change display/entry units
x extra functionality (experts only)
Script
I load disk layout from sfdisk script file
O dump disk layout to sfdisk script file
Mount Point - By default we can not access the hdd directly in linux system. For
this case we have to create a folder and
link it to the partion. This process is called mounting .
The Folder is called the mount point of the hdd.
[root@localhost ~]#
[root@localhost ~]# #how to use the partion#
[root@localhost ~]#
[root@localhost ~]# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 30G 0 disk
├─sda1 8:1 0 9.3G 0 part /boot
└─sda2 8:2 0 19.6G 0 part
├─cl-root 253:0 0 13G 0 lvm /
└─cl-swap 253:1 0 6.5G 0 lvm [SWAP]
sdb 8:16 0 50G 0 disk
├─sdb1 8:17 0 10G 0 part
├─sdb2 8:18 0 20G 0 part
└─sdb3 8:19 0 10G 0 part
sr0 11:0 1 1024M 0 rom
[root@localhost ~]#
[root@localhost ~]# pwd
/root
[root@localhost ~]# cd /root/Desktop/
[root@localhost Desktop]#
[root@localhost Desktop]# mkdir AWS-Sunday-Mount
[root@localhost Desktop]#
[root@localhost Desktop]#
[root@localhost Desktop]# #mount the /dev/sdb2 to /root/Desktop/AWS-Sunday-Mount/#
[root@localhost Desktop]#
[root@localhost Desktop]#
[root@localhost Desktop]# mount /dev/sdb2 /root/Desktop/AWS-Sunday-Mount/
[root@localhost Desktop]#
[root@localhost Desktop]# df -Th
Filesystem Type Size Used Avail Use% Mounted on
devtmpfs devtmpfs 867M 0 867M 0% /dev
tmpfs tmpfs 896M 0 896M 0% /dev/shm
tmpfs tmpfs 896M 9.5M 886M 2% /run
tmpfs tmpfs 896M 0 896M 0% /sys/fs/cgroup
/dev/mapper/cl-root xfs 14G 4.6G 8.6G 35% /
/dev/sda1 xfs 9.4G 382M 9.0G 5% /boot
tmpfs tmpfs 180M 4.6M 175M 3% /run/user/0
/dev/sdb2 ext4 20G 45M 19G 1% /root/Desktop/AWS-Sunday-Mount
[root@localhost Desktop]#