Linux partition.2
Linux partition.2
In Linux, disk partitioning is the process of dividing a hard disk into multiple
logical storage units . Each partition is a separate section of the hard drive that can
be used to store files, data, and operating system files.
1. Organize data: By creating different partitions, you can organize your data
into different categories, such as system files, user files, and application
files. This can help make it easier to manage and maintain your files.
2. Increase security: You can also use partitions to increase security. For
example, you could create a separate partition for sensitive data that requires
extra protection
3. Backup and recovery: Finally, partitions can be useful for backup and
recovery purposes. By creating separate partitions for your data, you can
easily back up and restore important files without affecting other parts of
your system.
What is a primary partition?
The primary partition is a type of hard disk partition that can contain both an
operating system and user data. This is the only partition type that can be set
active. The BIOS on a system can only detect this type of partition, and you can
only boot from this primary partition.
For example, if you want to install Windows or another OS its boot files should be
located on a primary partition otherwise it will not be able to boot.
An extended partition is a partition that can be divided into several partitions called
logical partitions. You don’t need to assign a drive letter and install a filesystem. It
acts as a container to logical partitions on a system.
Logical disk partitions are no different from other types in terms of use and
function; however you can not boot an operating system from a logical partition.
One or more logical partitions can be contained in an extended partition.
In this step-by-step tutorial, you will learn how to create a partition using the
Linux fdisk command.f
Step 1 :add a new hard disk
settings>>storage
4)select VHD
5)select fixed size
6)and select the size of the new virtual hard disk
sudo fdisk -l
4. After that, you are asked for the starting and ending sector of your hard drive. It
is best to type the default number in this section (3622912).
5. The last prompt is related to the size of the partition. You can choose to have
several sectors or to set the size in megabytes or gigabytes. Type +2GB to set the
size of the partition to 2GB.
sudo fdisk -l
As you can see, the partition /dev/sdb1 has been created.
To make stable the mounting, fstab option should be used with some statement
entry in “fstab” file is required.
To do this
1)open the /etc/fstab file
Sudo vim /etc/fstab
top-It displays system resource usage, including CPU usage, memory usage, and
system load averages, and it updates this information continuously, allowing you to
monitor the system's performance and identify resource-intensive processes.
df-command in Linux is used to display information about the file system disk free
space .
df command displays file system sizes in 1 kilobyte (1024 bytes) blocks. However,
you can use the -h option to display sizes in a human-readable format, such as
"GB" or "MB".
df-h
du - command in Linux is used to estimate the space used by files and directories
By default, du shows the space used by each file and directory in bytes. However,
you can use the -h option to display sizes in a human-readable format, such as
"GB" or "MB"
du -h.