Linux with Operating System Concepts



Download 5,65 Mb.
Pdf ko'rish
bet153/254
Sana22.07.2022
Hajmi5,65 Mb.
#840170
1   ...   149   150   151   152   153   154   155   156   ...   254
Bog'liq
Linux-with-Operating-System-Concepts-Fox-Richard-CRC-Press-2014


Parted Commands
Command/Syntax
Meaning
check NUMBER
Perform a simple check on the specified partition
cp FROM TO
Copy the file system on the partition numbered FROM to the partition 
numbered TO; this can permit you to copy a file system to another 
device
mkfs NUMBER TYPE
Create a file system of type TYPE on the partition NUMBER
mkpart TYPE START END
Create a partition of the specified TYPE (one of primary, logical, 
extended) where START and END are disk locations indicated by 
byte position (e.g., 512 GB, 1024 GB), percentage of total capacity or 
sector number
mkpartfs TYPE FS-TYPE START 
END
Create a partition of the specified TYPE and assign it a file system of 
type FS-TYPE
move NUMBER START END
Move the partition NUMBER to the specified location
name NUMBER NAME
Assign NAME to the partition NUMBER
print [devices|free|list|all|NUMBER] List the partitions based on the parameter provided (e.g., all partitions
the partition numbered NUMBER), list and all do the same thing
rescue NUMBER START END
Rescue a lost partition near START
resize NUMBER START END
Alter partition NUMBER’s size as specified
rm NUMBER
Delete the partition NUMBER


The Linux File System

413
This minimum size dictates the number of initial PEs allocated to that logical volume. The 
estimated total size is only a suggestion of how many PEs the volume might eventually use.
As the logical volume grows in size, it is allocated more PEs. In this way, a poorly esti-
mated total size should not require repartitioning. As long as PEs are available, any of the 
logical volumes (partitions) can grow. In addition, if disk space is freed up from a parti-
tion (for instance, by deleting unnecessary files), those PEs are handed back to the pool for 
reuse for any of the logical volumes.
Figure 10.7 provides an illustration of the concepts described here. We see all of the 
available physical volumes (two disks in this example) united together as a single volume 
group. Each physical volume has PEs. A logical volume is a collection of PEs. The PEs are 
allocated on an as-needed basis. Because of this, a logical volume’s PEs are not all located 
within one section of a disk drive but instead can range to include space from all of the 
physical devices.
There are many reasons to use LVM over physical disk partitioning (recall that disk 
partitioning does not physically alter the disk but portions out the disk space for different 
uses). The biggest advantage of LVM is that the system administrator will not have to worry 
about creating too small a partition, which later might need resizing. The LVM greatly 
simplifies any disk maintenance that the administrator may be involved with. Another 
benefit of LVM is in creating a backup of a partition. This can be done using LVM without 
interfering with the accessibility of that partition. LVMs are also easily capable of incorpo-
rating more hard disk space as hard disk drives are added to the system without having to 
repartition or partition anew the added space. In essence, a new hard disk is added to the 
single volume group providing additional PEs to the available pool. You can also establish 
redundancy with LVM, simulating RAID technology.
There are some reasons for not using LVMs. First, the LVM introduces an added layer 
of indirection in that access to a partition now requires identifying the PEs of the parti-
tion. This can lead to challenges in disaster recovery efforts as well as complications to 
the boot process. Additionally, as a partition may no longer occupy disk blocks in close 
2 Physical volumes made up of numerous PEs
(not shown to scale)
1 Volume group
4 Logical volumes made up of PEs as needed
FIGURE 10.7 
Implementing logical volumes out of physical volumes using LVM.


414

Linux with Operating System Concepts
proximity to each other but instead may be widely distributed because the PEs are pro-
vided on an as-needed basis, the efficiency of accessing large portions of the partition at 
one time decreases. In Figure 10.7, we see that one of the logical volumes (the third from 
the left) exists on two separate devices.
As booting takes place prior to the mounting of the file systems, the boot sector needs 
to reside in an expected location. If the /boot partition were handled by the LVM, then its 
placement is not predictable. Therefore, we separate the /boot partition from LVM, creat-
ing (at least) two physical partitions, one containing /boot and the other containing our 
volume group(s). If we have one volume group, then we have two physical partitions. The 
volume group partition(s) then contain all of our logical partitions. If you reexamine the 
first example of partitioning that we covered in Section 8.3.2 of Chapter 8 when we used 
the LVM, you will see that we did exactly this: two partitions of /boot and a volume group, 
the latter of which was partitioned using an LVM.
You establish your disk partitioning using LVM at the time you initially partition your 
file space. However, you can modify the physical and logical volumes later through a suite 
of commands. A few of the more useful commands are provided in Table 10.4. These com-
mands are also available through the interactive, text-based 
lvm2
program (which is usu-
ally called lvm in Linux systems). The lvm2 program is a front-end or interface for the 
programs listed in Table 10.4. Note that Table 10.4 is only a partial listing of the LVM 
programs available for creating and maintaining LVM-based partitions.
10.4.6 Mounting and Unmounting File Systems
Let us focus again on file systems with a discussion of mounting and unmounting them. 
We use 
mount
and 
umount
to handle these tasks. Unfortunately, the mount command 
can be complicated. We will focus on its more basic options.
At its simplest form, the mount command expects two arguments: the file system to 
mount and the mount point. The mount point must already exist. For instance, if we want 
to mount a new file system to /home2, we would first have to create /home2. After issuing 
the command 
mkdir /home2
, we would have an empty directory. This is the mount 
TABLE 10.4 
Logical Volume Manager Commands

Download 5,65 Mb.

Do'stlaringiz bilan baham:
1   ...   149   150   151   152   153   154   155   156   ...   254




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©hozir.org 2024
ma'muriyatiga murojaat qiling

kiriting | ro'yxatdan o'tish
    Bosh sahifa
юртда тантана
Боғда битган
Бугун юртда
Эшитганлар жилманглар
Эшитмадим деманглар
битган бодомлар
Yangiariq tumani
qitish marakazi
Raqamli texnologiyalar
ilishida muhokamadan
tasdiqqa tavsiya
tavsiya etilgan
iqtisodiyot kafedrasi
steiermarkischen landesregierung
asarlaringizni yuboring
o'zingizning asarlaringizni
Iltimos faqat
faqat o'zingizning
steierm rkischen
landesregierung fachabteilung
rkischen landesregierung
hamshira loyihasi
loyihasi mavsum
faolyatining oqibatlari
asosiy adabiyotlar
fakulteti ahborot
ahborot havfsizligi
havfsizligi kafedrasi
fanidan bo’yicha
fakulteti iqtisodiyot
boshqaruv fakulteti
chiqarishda boshqaruv
ishlab chiqarishda
iqtisodiyot fakultet
multiservis tarmoqlari
fanidan asosiy
Uzbek fanidan
mavzulari potok
asosidagi multiservis
'aliyyil a'ziym
billahil 'aliyyil
illaa billahil
quvvata illaa
falah' deganida
Kompyuter savodxonligi
bo’yicha mustaqil
'alal falah'
Hayya 'alal
'alas soloh
Hayya 'alas
mavsum boyicha


yuklab olish