If I create a snapshot say:
lvcreate --size 100M --snapshot --name homeSnap /dev/vg1/home
then i back up this snapshot:
dd if=/dev/vg1/homeSnap of=/mnt/data/backup.img
then create a new logical volume
lvcreate --size 50G --name test vg1
then copy the snapshot to the new logical drive:
dd if=/mnt/data/backup.img of=/dev/vg1/test
Now say that the original /dev/vg1/home is only 10G size. The /dev/vg1/test is 50G. What happens to the other 40G will i be able to use this as normal or does the new /dev/vg1/test only become 10G and I lose the 40G without some type of resizing?
It of course depends on whatever you have on the
/dev/vg1/homeSnap
volume. But most filesystems will not automatically resize, you must issue a command to resize the filesystem.In a comment you mentioned XFS, the command you want is xfs_growfs, I believe maybe
xfs_growfs /dev/vg1/test
in your situation.One other thing you might need to watch out for is that some filesystems have a unique ID, and if you try to mount two copies of the filesystem that have the same unique ID you can have problems. I am not sure about the current state, but in the past XFS required special steps like generating a new ID, or passing a mount option to ignore the ID.