LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   studying for rhcsa - help with logical volume theory and extending lv size required (https://www.linuxquestions.org/questions/linux-newbie-8/studying-for-rhcsa-help-with-logical-volume-theory-and-extending-lv-size-required-4175578200/)

and1_hotsauce 04-24-2016 04:01 AM

studying for rhcsa - help with logical volume theory and extending lv size required
 
Hi all,
When I try to resize my partition, I keep getting the following:
Code:

open: Is a directory while opening /mnt/mymount/
These are my steps:
Code:

  1  pvcreate /dev/xvdf1
  2  vgcreate battlestar /dev/xvdf1
  3 lvcreate -L 192M -n galactica battlestar
  4  mkdir /mnt/mymount
  5  mount /dev/battlestar/galactica /mnt/mymount
  6  mkfs.ext4 /dev/battlestar/galactica
  7  mount /dev/battlestar/galactica /mnt/mymount
  8  lvextend -L +60 /dev/battlestar/galactica
  9  resize2fs /mnt/mymount/
  10 resize2fs /dev/mapper/battlestar-galactica

line 9 does not work but line 10 does. Why?
Why doesn't the size of mymount increase after line 8? Why do I need to type resize2fs


Also, could someone please verify my understanding of pv,lg,lv (diagram is found here: http://imgur.com/qVtTcrE)

At first, I partitioned xvdf (1GB).
Next, I created a physical volume, and then a volume group. This volume group may have multiple physical volumes, but at the moment, we only have 1(xvdf1). After that, I created a logical volume, essentially, carving out 200MB of memory from PV.

Once the LV is created, this "storage device" needs a filesystem. I used the mkfs.ext4 command to do this. Once this was created, I now need to mount this storage device using the mount command.

malekmustaq 04-24-2016 04:54 AM

Quote:

line 9 does not work but line 10 does. Why?
Because you don't resize a mount point. You may resize a file system in a partition.

You may extend the size of a logical volume too, but this you cannot resize a mount point because mount point is merely a pointer, node or a file.

Read the manual:
Code:

man resize2fs
man lvextend

Hope that helps.

m.m.

sundialsvcs 04-24-2016 08:04 AM

Be sure that you clearly understand the intent and purpose of "logical volumes." The concept is simply to extend what Linux sees as "a single [logical ...] volume" across multiple "physical" storage devices, with the ability to change the physical volume layout ... as it were ... "right under Linux's nose." :)

For instance, when a drive begins to make ominous clicking noises . . . :eek:

Some things don't change: the volume, be it an LVM or a single drive, is still "mounted" at some location in the filesystem, and that mount-point is still represented by a directory.


All times are GMT -5. The time now is 09:15 AM.