Page 1 of 3 123 LastLast
Results 1 to 10 of 25

Thread: LVM setup - files have disappeared

  1. #1

    Exclamation LVM setup - files have disappeared

    Not sure how this happened but I have a LVM setup which seems to be ok from what I can gather but all the files have disappeared on it.

    Code:
    vgdisplay:
    
      --- Volume group ---
      VG Name               datavg
      System ID
      Format                lvm2
      Metadata Areas        2
      Metadata Sequence No  2
      VG Access             read/write
      VG Status             resizable
      MAX LV                0
      Cur LV                1
      Open LV               1
      Max PV                0
      Cur PV                2
      Act PV                2
      VG Size               <1.82 TiB
      PE Size               4.00 MiB
      Total PE              476934
      Alloc PE / Size       476934 / <1.82 TiB
      Free  PE / Size       0 / 0
      VG UUID               detds1-pfeV-2Jjj-65oJ-J9oA-pI2g-zYHDEe
    
    
    pvdisplay:
    
      --- Physical volume ---
      PV Name               /dev/sdb
      VG Name               datavg
      PV Size               931.51 GiB / not usable 1.71 MiB
      Allocatable           yes (but full)
      PE Size               4.00 MiB
      Total PE              238467
      Free PE               0
      Allocated PE          238467
      PV UUID               ohtweF-CVp9-WT0G-0gfq-FLF6-RWDq-fmraXw
    
      --- Physical volume ---
      PV Name               /dev/sdc
      VG Name               datavg
      PV Size               931.51 GiB / not usable 1.71 MiB
      Allocatable           yes (but full)
      PE Size               4.00 MiB
      Total PE              238467
      Free PE               0
      Allocated PE          238467
      PV UUID               DiC5yX-q1QN-ckk8-CFwP-2Fms-bfGe-CSZyke
    
    
    mount:
    
    /dev/mapper/datavg-lv--0 on /home type ext4 (rw,relatime)
    
    fstab:
    
    UUID=67d38d79-36cf-425d-9473-0e6d0a1464fa /home ext4 defaults 0 0
    
    lsblk:
    
    sda                         8:0    0 931.5G  0 disk
    ├─sda1                      8:1    0   512M  0 part /boot/efi
    ├─sda2                      8:2    0     1G  0 part /boot
    └─sda3                      8:3    0   930G  0 part
      └─ubuntu--vg-ubuntu--lv 253:1    0   930G  0 lvm  /
    sdb                         8:16   0 931.5G  0 disk
    └─datavg-lv--0            253:0    0   1.8T  0 lvm  /home
    sdc                         8:32   0 931.5G  0 disk
    └─datavg-lv--0            253:0    0   1.8T  0 lvm  /home
    
    
    du -h: 
    
    /dev/mapper/datavg-lv--0           1.8T  3.4G  1.7T   1% /home
    Is there a way to get files to show back up?
    Last edited by martinjh99; July 31st, 2021 at 05:53 AM.

  2. #2
    Join Date
    Mar 2010
    Location
    Squidbilly-Land
    Beans
    Hidden!
    Distro
    Ubuntu

    Re: LVM setup - files have disappeared

    Please show the exact command AND the output for everything.

    What does more /etc/fstab show?
    What does df -Th show?

    Appears LVM was used with out any partitions on sdb and sdc. That is NOT a best practice. Always lay down partitions.

    Just to make it easier and more compact to see, please post
    Code:
    sudo pvs
    sudo vgs
    sudo lvs
    too.

    What is missing, exactly?
    One file in /home?
    One file in /usr/local/etc/xyz/abc/deep/deep/deep/.buried/deep/deep/xyz.conf?

    If I'm guessing, it appears the fstab doesn't have a line for the ubuntu--vg-ubuntu--lv mount, but that could be due to not posting complete data. There are other inconsistencies in what was posted, so I'm not really comfortable trusting the data.

  3. #3

    Re: LVM setup - files have disappeared

    Code:
    martin@sienna ~ % sudo pvs
    [sudo] password for martin:
      PV         VG        Fmt  Attr PSize    PFree
      /dev/sda3  ubuntu-vg lvm2 a--  <930.01g 8.00m
      /dev/sdb   datavg    lvm2 a--   931.51g    0
      /dev/sdc   datavg    lvm2 a--   931.51g    0
    
    martin@sienna ~ % sudo vgs
      VG        #PV #LV #SN Attr   VSize    VFree
      datavg      2   1   0 wz--n-   <1.82t    0
      ubuntu-vg   1   1   0 wz--n- <930.01g 8.00m
    
    martin@sienna ~ % sudo lvs
      LV        VG        Attr       LSize   Pool Origin Data%  Meta%  Move Log Cpy%Sync Convert
      lv-0      datavg    -wi-ao----  <1.82t
      ubuntu-lv ubuntu-vg -wi-ao---- 930.00g
    
    martin@sienna ~ % more /etc/fstab
    UUID=578d5d15-68b4-437b-be3d-4cb86f3565e1 / ext4 defaults 0 0
    UUID=e9143bef-163d-4188-90d0-f7a4d1591375 /boot ext4 defaults 0 0
    UUID=67d38d79-36cf-425d-9473-0e6d0a1464fa /home ext4 defaults 0 0
    UUID=F275-8BD9 /boot/efi vfat defaults 0 0
    /swap.img       none    swap    sw      0       0
    
    martin@sienna ~ % df -Th
    Filesystem                        Type      Size  Used Avail Use% Mounted on
    udev                              devtmpfs  7.8G     0  7.8G   0% /dev
    tmpfs                             tmpfs     1.6G  3.4M  1.6G   1% /run
    /dev/mapper/ubuntu--vg-ubuntu--lv ext4      915G   15G  854G   2% /
    tmpfs                             tmpfs     7.8G     0  7.8G   0% /dev/shm
    tmpfs                             tmpfs     5.0M  4.0K  5.0M   1% /run/lock
    tmpfs                             tmpfs     7.8G     0  7.8G   0% /sys/fs/cgroup
    /dev/sda2                         ext4      976M  204M  706M  23% /boot
    /dev/mapper/datavg-lv--0          ext4      1.8T  3.4G  1.7T   1% /home
    /dev/sda1                         vfat      511M  7.9M  504M   2% /boot/efi
    /dev/loop0                        squashfs  100M  100M     0 100% /snap/core/11316
    /dev/loop1                        squashfs  100M  100M     0 100% /snap/core/11420
    overlay                           overlay   915G   15G  854G   2% /var/lib/docker/overlay2/8f9d4c010677c8ede5ac43c3bc3904f78ca68bb2f95e8bb0c1563c9182a41ad5/merged
    overlay                           overlay   915G   15G  854G   2% /var/lib/docker/overlay2/02d1ae1377b6d97058212b6b3fad3efbb9cb08fc0f9ada46985122fe1ce5075b/merged
    overlay                           overlay   915G   15G  854G   2% /var/lib/docker/overlay2/f110e1deb6cc2468fee99e52e265d391a8c23d4d79a78935d97dfefa75a11000/merged
    overlay                           overlay   915G   15G  854G   2% /var/lib/docker/overlay2/f6eadb6e06e2bd56672a814118a6bd142d50e60de5d935fe132fec3fc57be975/merged
    overlay                           overlay   915G   15G  854G   2% /var/lib/docker/overlay2/0020bdc0e2078d4b3498665bd193c26990566731c03bc212e049bf63dc262e12/merged
    overlay                           overlay   915G   15G  854G   2% /var/lib/docker/overlay2/9b427833df960d12076ec6b6be453defdfbe389f522b19d57b29a61cc3d10e16/merged
    shm                               tmpfs      64M     0   64M   0% /var/lib/docker/containers/a748ccbc92bb5b0a5a5706695146fc9101ada4e8a7e29cc8a6f91884db4e636a/mounts/shm
    shm                               tmpfs      64M     0   64M   0% /var/lib/docker/containers/8cfdc2e5500848d635dae23b0bd939917f334d68319eb97e5285626dedc7e7f1/mounts/shm
    shm                               tmpfs      64M     0   64M   0% /var/lib/docker/containers/06571c88d4dbcbede88ef15188cf6d13d79f4ab00d492a46707d7d1e71c5893a/mounts/shm
    shm                               tmpfs      64M     0   64M   0% /var/lib/docker/containers/aa719bcc60c9bbc726e9cd05ad2959263244c5fc78ce89812e6354cf2ece7085/mounts/shm
    shm                               tmpfs      64M     0   64M   0% /var/lib/docker/containers/79b51baec9f23aa063d9e0190020fcba39d5b3fd05284b1b72e58c618113e7c4/mounts/shm
    shm                               tmpfs      64M     0   64M   0% /var/lib/docker/containers/f51006008fcb8b223322d0366294211134018cc81300e8e52928899e71ce36f0/mounts/shm
    tmpfs                             tmpfs     1.6G     0  1.6G   0% /run/user/1000
    Running Docker here hence the /var/lib/docker mounts...

    All my media ripped from CD's/movies, movies downloaded from Youtube, other data stored on the server...

    Although df seems to think that the data is still there... probably can't rebuild without losing data can I without actual partitions...?
    Last edited by martinjh99; July 31st, 2021 at 09:03 AM.

  4. #4
    Join Date
    Mar 2010
    Location
    USA
    Beans
    Hidden!
    Distro
    Ubuntu Development Release

    Re: LVM setup - files have disappeared

    What do you mean? If you use the du command in human readable format, it returns the results of estimated space of files in a filesystem... It did exactly what you asked for the "target"... You mistakenly pointed the command to the LV, instead of where is was mounted... I think what you meant was more along the lines of
    Code:
    du -h /dev/sda3/home
    ...where the filesystem within that Logical Volume actually exists... Right?

    Basically, think of it like Russian Dolls. Think of the LV as a partition within the Volume Group, which is within the Physical Volume group... But it doesn't mean anything until the LV is mounted somewhere, where you can find it and follow a path to it... It your case, the PV and root LV volume (starts at /dev/sda3)... and the LV that contains your home gets mounted as home, and mounted to the root. So the path of your home would be /dev/sda3/home.

    Your path in the command was just pointing to the wrong target where your filesystem and files "are."

    EDIT: You could have even shortened the path to /home or ~/ and it will still work... They are most likely still there (high probability)... You just need to follow the bread crumbs to them.
    Last edited by MAFoElffen; July 31st, 2021 at 09:50 AM.

    "Concurrent coexistence of Windows, Linux and UNIX..." || Ubuntu user # 33563, Linux user # 533637
    Sticky: Graphics Resolution | UbuntuForums 'system-info' Script | Posting Guidelines | Code Tags

  5. #5

    Re: LVM setup - files have disappeared

    /home is working fine and mounted fine it seems that all the data under /home/martin/data is missing.

  6. #6
    Join Date
    Mar 2010
    Location
    USA
    Beans
    Hidden!
    Distro
    Ubuntu Development Release

    Re: LVM setup - files have disappeared

    What is the results of
    Code:
    du -h /home/martin/data
    
    df --output=source,used,avail /home/martin/data

    "Concurrent coexistence of Windows, Linux and UNIX..." || Ubuntu user # 33563, Linux user # 533637
    Sticky: Graphics Resolution | UbuntuForums 'system-info' Script | Posting Guidelines | Code Tags

  7. #7

    Re: LVM setup - files have disappeared

    Code:
    du -h /home/martin/data
    4.0K    /home/martin/data/media
    8.0K    /home/martin/data
    Should be a whole load of files and folders under /home/martin/media... In fact there also should be a whole load of files and folders in /home/martin/data as well...


    Code:
    martin@sienna ~ % df --output=source,used,avail /home/martin/data
    Filesystem                Used Avail
    /dev/mapper/datavg-lv--0  3.4G  1.7T

  8. #8
    Join Date
    Mar 2010
    Location
    USA
    Beans
    Hidden!
    Distro
    Ubuntu Development Release

    Re: LVM setup - files have disappeared

    Quote Originally Posted by martinjh99 View Post
    [code]
    Code:
    martin@sienna ~ % df --output=source,used,avail /home/martin/data
    Filesystem                Used Avail
    /dev/mapper/datavg-lv--0  3.4G  1.7T
    I agree, but there is something really wrong with this... Instead of files, it's showing the LVM LV "again"(???) I do not understand that at all... Almost like there somehow is some kind of loop.

    "Concurrent coexistence of Windows, Linux and UNIX..." || Ubuntu user # 33563, Linux user # 533637
    Sticky: Graphics Resolution | UbuntuForums 'system-info' Script | Posting Guidelines | Code Tags

  9. #9
    Join Date
    Mar 2010
    Location
    USA
    Beans
    Hidden!
    Distro
    Ubuntu Development Release

    Re: LVM setup - files have disappeared

    And if you list the directories they are empty? Or do they loop back and show they LVM LV again?

    "Concurrent coexistence of Windows, Linux and UNIX..." || Ubuntu user # 33563, Linux user # 533637
    Sticky: Graphics Resolution | UbuntuForums 'system-info' Script | Posting Guidelines | Code Tags

  10. #10

    Re: LVM setup - files have disappeared

    Code:
    martin@sienna ~/data % pwd
    /home/martin/data
    martin@sienna ~/data % ls -lR
    .:
    total 4
    drwxr-xr-x 2 root root 4096 Jul 31 04:25 media
    
    ./media:
    total 0

Page 1 of 3 123 LastLast

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •