Birmingham mumbai


Formatting logical volumes



Download 15,21 Mb.
Pdf ko'rish
bet313/482
Sana13.01.2022
Hajmi15,21 Mb.
#355107
1   ...   309   310   311   312   313   314   315   316   ...   482
Bog'liq
Mastering Ubuntu Server Gain expertise in the art of deploying, configuring, managing, and troubleshooting Ubuntu Server by Jay LaCroix (z-lib.org)

Formatting logical volumes
Next, we need to format our logical volume so that it can be used. However, as 
always, we need to know the name of the device so we know what it is we're 
formatting. With LVM this is easy. The 
lvdisplay
 command gave us this already; 
you can see it in the output (it's the third line down in 
Figure 9.12
, under 
LV Path
). 
Let's format it with the 
ext4
 filesystem:
sudo mkfs.ext4 /dev/vg-test/myvol1


Chapter 9
[
 237 
]
And now this device can be mounted as any other hard disk. I'll mount mine at 
/
mnt/lvm/myvol1
, but you can use any directory name you wish:
sudo mount /dev/vg-test/myvol1 /mnt/lvm/myvol1
To check our work, execute 
df -h
 to ensure that our volume is mounted and shows 
the correct size. We now have an LVM configuration containing just a single disk, so 
this isn't very useful. The 5 GB I've given it will not likely last very long, but there is 
some remaining space we can use that we haven't utilized yet. With the following 
lvextend
 command, I can resize my logical volume to take up the remainder of the 
physical volume:
sudo lvextend -n /dev/vg-test/myvol1 -l +100%FREE
In this case, 
+100%FREE
 is the argument that clarified that we are wanting to use the 
entirety of the remaining space for the logical volume. If done correctly, you should 
see output similar to the following:
Logical volume vg-test/myvol1 successfully resized.
Now my logical volume is using the entire physical volume I assigned to it. Be 
careful, though, because if I had multiple physical volumes assigned, that command 
would've claimed all the space on those as well, giving the logical volume a size that 
is the total of all the space it has available, across all its disks. You may not always 
want to do this, but since I only had one physical volume anyway, I don't mind. Go 
ahead and check your free space again with the 
df -h
 command:
df -h
Unfortunately, it's not showing the extra space we've given the volume. The output 
of 
df
 is still showing the size the volume was before. That's because although we 
have a larger logical volume, and it has all the space assigned to it, we didn't actually 
resize the 
ext4
 filesystem that resides on this logical volume. To do that, we will use 
the 
resize2fs
 command:
sudo resize2fs /dev/mapper/vg--test-myvol1
The double-hyphen in the previous command is intentional, so 
make sure you're typing the command correctly.


Managing Storage Volumes

Download 15,21 Mb.

Do'stlaringiz bilan baham:
1   ...   309   310   311   312   313   314   315   316   ...   482




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