When you created your logical volume using:
lvcreate -L 20G -n iew-vm-lv /dev/ubuntu-vg
You've successfully created a new storage volume, but it's not yet ready for use. The error message you received indicates the system can't find mounting instructions for your new LV.
Before mounting, you need to create a filesystem on your LV. For an ext4 filesystem:
mkfs.ext4 /dev/ubuntu-vg/iew-vm-lv
For XFS (common in enterprise environments):
mkfs.xfs /dev/ubuntu-vg/iew-vm-lv
Choose or create a directory where your LV will be mounted:
mkdir -p /mnt/iew-vm
Test mounting the volume without modifying system files:
mount /dev/ubuntu-vg/iew-vm-lv /mnt/iew-vm
Verify the mount worked:
df -h | grep iew-vm
To make the mount persistent across reboots, edit /etc/fstab. The safest approach is to use UUID:
blkid /dev/ubuntu-vg/iew-vm-lv
Then add to /etc/fstab:
UUID=your-uuid-here /mnt/iew-vm ext4 defaults 0 2
Alternatively, using the device mapper path:
/dev/mapper/ubuntu--vg-iew--vm--lv /mnt/iew-vm ext4 defaults 0 2
After editing fstab, test your configuration:
mount -a
Check for errors and verify with:
mount | grep iew-vm
The /etc/mtab file is automatically maintained by the mount command. You should never edit it manually. It simply reflects currently mounted filesystems.
For production systems, consider these additional parameters in fstab:
UUID=your-uuid /mnt/iew-vm ext4 rw,relatime,data=ordered 0 2
Or for XFS:
UUID=your-uuid /mnt/iew-vm xfs defaults,nofail 0 2
If you encounter issues:
dmesg | tail
Check system logs:
journalctl -xe
Verify LVM status:
vgdisplay
lvdisplay
When you created your logical volume with lvcreate -L 20G -n iew-vm-lv /dev/ubuntu-vg
, you've only allocated the storage space but haven't made it accessible to the system. The mount error occurs because the system doesn't know where or how to mount this new volume.
First, let's create a filesystem on the new LV:
mkfs.ext4 /dev/ubuntu-vg/iew-vm-lv
Create a mount point (directory) for the new volume:
mkdir /mnt/iew-vm-volume
For temporary mounting (won't survive reboot):
mount /dev/ubuntu-vg/iew-vm-lv /mnt/iew-vm-volume
For permanent mounting, you need to edit /etc/fstab. Here's the proper entry to add:
/dev/ubuntu-vg/iew-vm-lv /mnt/iew-vm-volume ext4 defaults 0 2
For more reliability (recommended in production environments), use UUID instead of device path:
blkid /dev/ubuntu-vg/iew-vm-lv
Then use the output UUID in your fstab:
UUID=your-uuid-here /mnt/iew-vm-volume ext4 defaults 0 2
After editing fstab, always test your configuration before rebooting:
mount -a
Check if the volume mounted correctly:
df -h
lsblk
The six fields in your fstab entry represent:
- Device/UUID
- Mount point
- Filesystem type
- Mount options
- Dump utility flag
- Filesystem check order
If you encounter errors after editing fstab:
- Check for typos in the fstab file
- Ensure the mount point directory exists
- Verify the filesystem type matches what you created
- Check system logs for detailed error messages