Topics Covered in this videos:
To view the existing partitions
#fdisk –l (or) parted –l
Partition Administration using fdisk
To enter into disk utility, the syntax is
#fdisk disk name
#fdisk /dev/sda
Creating a new partition
#fdisk /dev/sda
1.Use p to list out the partition information first and
2.Use n to create a new partition
Deleting a partition
Let’s delete the partition we’ve created above i.e. /dev/sda7
Use d to delete a partition and specify the device name, in our case it is 7.
Note:- Never delete the system partitions i.e. 1-7
Saving the partition changes
Every time you make a partition or delete a partition, the changes made has to be saved using
w, otherwise the creation and deletion will not be considered to be happen. For practice
purpose you can make any no. of partition and delete it and just quit using q so that it will not
be saved.
Updating the partition table without restarting the system:
After creating or deleting a partition the changes will be effected in the partition table only
after the restart of the system. But there is a way to avoid this circumstance. We can use
partprobe or partx command to update the partition information without restarting the system
#partprobe /dev/sda
Or
#partx –a /dev/sda
Or
#kpartx /dev/sda
Formatting a partition with ext4 filesystem:
After creating a partition we need to assign some file system to it so that we can start storing
the data into it. To format a partition the following syntax is used.
#mkfs.file system type partition name
#mkfs.ext4 /dev/sda7 (where sda7 is our newly created partition)
•Likewise you can format the different partitions with different file systems like
#mkfs.ext3 /dev/sda8
#mkfs.vfat /dev/sda9
Mounting a partition:
Mounting is a procedure where we attach a directory to the file system. There are two types of
mounting which will be used in Linux or any UNIX.
1. Temporary Mounting
2. Permanent Mounting
Temporary Mounting:
In a temporary mount point we will create a directory and mount it, but this mount point will
last only till the system is up, once it is rebooted the mounting will be lost.
Syntax:
#mount device name directory name (mount point)
#mount /dev/sda7 /mnt/kernel
To View all the mounted partitions
#mount
To add the data access the mount point:
#cd /kernel
Add the data and exit the directory
Unmounting a partition
#umount mount point directory
#umount /kernel
verify it with mount command.
Permanent Mounting :
Permanent mounting procedure is exactly same like temp mounting, but here we will update
the /etc/fstab file with the mounting details, so that it will be mounted even after the system is
reboot.
Steps To make a permanent mount point:
1.Make a directory or use an existing directory
2.Add entry in /etc/fstab file
3.Use mount –a command to check it is mounting. (mount –a will mount all the entry placed in /etc/fstab)
4.Here we will be using our existing /kernel directory as mount point which is created previously.
#vim /etc/fstab
/dev/sda4 /mnt/newM etx4 defaults 0 0
#mount –a
To view the usage information of mounted partition:
To view the usage information of mounted partition use the command df –h
#df -h
To view the usage information of files and directories:
#du –h
du -h /mnt/newM/
du -h /root
Assigning label to the partition:
#e2label partition name label To check the label
#e2label /dev/sda7 ktdisk
To check the label:
#e2label /dev/sda7
Mounting a partition using its label:
Mounting a /dev/sda7 partition with its label GREEN, verify it with mount command
#mkdir /mnt/MM
#mount /dev/sda7 /mnt/MM
#e2label /dev/sda7 GREEN
#e2label /dev/sda7
#mount -l
Making a permanent mount point using label
As we know that to make a permanent mount point, an entry has to be made in /etc/fstab file.
#vim /etc/fstab
LABEL=GREEN /mnt/MM ext4 defaults 0 0
Now use mount –a command and verify it with mount command whether it is mounted or
not.
Mounting a partition permanently with its block id (UUID)
label,mkfs.etx4,mkfs.xfs,umount,linux,ext4,file system,fdisk command,fdisk command linux,xfs file system,ext2,rhce,cli,ext4 file system,Manage Linux Drives,Ext4 vs XFS,Linux Disk Setup,linux commands,mkfs.exfat install,disk partitioning,linux file system,directory structure,linux directories,fdisk command in linux,partition,oscp,mkfs command in linux,Linux Partitions and File Systems Advanced Techniques, fdisk,Linux, Tutorial, Howto, Guide, Distro, Learn Linux, operating system, os, gnu/linux, LearnLinuxTV, storage, linux storage, volumes, store, disk, virtual disk, mount command, mount, lsblk, fdisk, ext4, exfat, mkfs, mkfs.ext4, mkfs.exfat command not found, mkfs.exfat install, mkfs.exfat ubuntu, information technology, how to, linux tutorial, linux commands, for beginners, linux for beginners 2021,Maximize Linux Performance with These Partitioning Tips
#LinuxPartitions
#FileSystems
#LinuxAdministration
#LinuxTutorial
#LinuxFileSystem
Информация по комментариям в разработке