Score:0

Resize logical volume in ubuntu without damaging

ie flag

When I run lsblk i get as below

vda                       252:0    0   150G  0 disk 
├─vda1                    252:1    0     1M  0 part 
├─vda2                    252:2    0   1.5G  0 part /boot
└─vda3                    252:3    0 148.5G  0 part 
  └─ubuntu--vg-ubuntu--lv 253:0    0  74.3G  0 lvm  /

now i want to inrease size of ubuntu--vg-ubuntu--lv by writing

sudo lvextend -L +70G /dev/mapper/ubuntu--vg-ubuntu--lv
sudo resize2fs /dev/mapper/ubuntu--vg-ubuntu--lv

my ubuntu--vg-ubuntu--lv is in production. My database and website is there. Resizing can damage it anyhow?

Marco avatar
br flag
With sudo, you can damage anything anytime. That's why production systems should have a backup from which you can recover. Some admins have a minimal clone of the production to do testing as you want.
Elvin Jafarov avatar
ie flag
@Marco but in this scenario, can it delete or kill something? had u have experience with it?
Marco avatar
br flag
I assume "+120G" will not work, because 74+120 > 150. In **most** cases `lvextend` and `resize2fs` will prevent you from killing the system. But it can always happen.
Score:0
ie flag

I ran those two commands safely without any problem:

sudo lvextend -L +70G /dev/mapper/ubuntu--vg-ubuntu--lv
sudo resize2fs /dev/mapper/ubuntu--vg-ubuntu--lv
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.