0

I have a problem with mounting my lvm partition.

  1. First I created file with a size of 7 GB

    sudo truncate -s 7G fooFile
    
  2. Setting as a loop device. After this command I can see loop device via lsblk command (/dev/loop0)

    sudo losetup -Pf foofile
    
  3. I set disk partition table via cfdisk

    sudo cfdisk /dev/loop0
    # I choose dos as a disk label and create new partition with a size of 5 GB
    # I can see loop0p1 (5 GB) partition via lsblk command 
    
  4. I created a physical volume from this loop device

    sudo pvcreate /dev/loop0p1
    
  5. Then I created volume group via vgcreate

    sudo vgcreate fooVG /dev/loop0p1
    
  6. I created logical volume via lvcreate with a size of 3 GB

    sudo lvcreate -L 3G -n fooLV fooVG
    
  7. Activating volume group

    sudo vgchange -ay fooVG
    
  8. Creating directory

    sudo mkdir -vp /mnt/myMountPoint
    
  9. Last step :) mounting

    sudo mount /dev/fooVG/fooLV /mnt/myMountPoint
    # Two command have same error
    sudo mount /dev/mapper/fooVG-fooLV /mnt/myMountPoint
    
    mount: /mnt/myMountPoint/fooLV: wrong fs type, bad option, bad superblock on /dev/mapper/fooVG-fooLV, missing codepage or helper program, or other error.
    

How can i solve this error?

1
  • 2
    You forgot to make a filesystem on the logical volume. Apr 9 at 15:59
1

You have created a logical volume (LV) but you haven't yet created a filesystem on it. Here's an example to create an ext4 filesystem with a label fooLV

mkfs -t ext4 -L fooLV /dev/fooVG/fooLV

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.