Disks: 1 (sda, sdb)
LV: 3 (/, swap, home)
I unmounted /home from the LVM and all the data disapperaed from /home. (same path)
* Remmounted the disk as before
* Copied data to /tmp
* Unmounted the disk and copied the data back
* Restored SELinux security context.
Looking forward for an explanation. Thank you guys.
Maybe I'm not understanding you correctly, but these are my comments.
You say that you unmounted the LV volume for /home and the data was all gone. They are gone because the data was stored on the LV volume and when you unmount the volume the data are not shown anymore because the /home is not a part of the / logical volume. The data is still there as you saw yourself, but they are only stored on the part of the disk where the logical volume is stored (the home lv).
What you have done now appears to be that you have copied the data from the logical volume to another area on disk that also contains a logical volume but this time the / volume.
I suggest reading up on LVM to get a better understanding of how it works.
@exceedI will thank you.
I got confused only because when we are mouting a directory to a new LV , at that time all the existing data remains as it is. But unmounting had this behaviour which I saw for the first time. Anyways thank you for your response, I will look it up. Cheers!
Hi @AffanMeh ,
Yes you can use a better way of doing this.
1. Please pefrom a clean unmount if you are unmounting the data . umount -l is a good option.
2. use fsck or e2fsck or xfs_repair for FS cehck and repair ( there may be FS integrity issues or damage ).
3. Please esure you are using any available backup technology to backup your data.
If you use forceful unmount or if there is any interruption to service like power or connectivity there can be a damage to filesystem data if the FS was in use. Clean unmount means FS is in consistent state and data on the filesystem is flushed to disk and all of the open files are closed. You can use umount -l /home for the same.
A collaborative learning environment, enabling open source skill development.