Hi! I'm facing a weird issue with data keep disappearing on xfs on logical volum . . .

Nhan Le Thanh:
Hi! I’m facing a weird issue with data keep disappearing on xfs on logical volume.

Nhan Le Thanh:
I have 3 vmware vm with ubuntu 20.04.5lts and 3 disks. I add each of them in a volume group and create a logical volume from that vg. Then, on that lv, I create a xfs which is recommended for mongo and kafka, mounting it, and adding to fstab. I create some folder in the mount point. After rebooting the servers, all folders in that mount point disappear. I remake a folder in that mount point and reboot. After remaking and rebooting serveral times, the folders do disappear one more time, and now they are persisted.

I do install a mongo cluster and the data path uses that lv. All initial setup data disappears. At first, I think that there is a problem with mounting because xfs does not have the lost+found like ext4; but after rechecking, I can confirm that the lv is mounted and the data is lost. I normaly create ext4 fs. Is there anything I need to know about xfs? I cannot google any similar issue.

All hardwares are brand new

vgs
  VG     #PV #LV #SN Attr   VSize  VFree
  data   1   1   0 wz--n- <2.00t    0

lvs
  LV        VG     Attr       LSize  Pool Origin Data%  Meta%  Move Log Cpy%Sync Convert
  lv_data data -wi-ao---- <2.00t

lvdisplay
  --- Logical volume ---
  LV Path                /dev/data/lv_data
  LV Name                lv_data
  VG Name                data

sdb                LVM2_member                                 4...e877
└─data-lv_data xfs                                         1...d322        2T     1% /data

cat /etc/fstab
/dev/data/lv_data /data xfs defaults 0 1

Aaron Lockhart:
That’s odd. It seems like the journal metadata might not be getting committed when you reboot. That’s usually only a problem with XFS when there’s a sudden power loss though. If that’s the case, you can end up with missing data, but no filesystem inconsistencies for xfs_repair to find.

Harshit Shrivastava:
@Nhan Le Thanh so after every reboot data is getting disappeared/deleted? It happens only with xfs or ext too?

Nhan Le Thanh:
I find the problem. I miss mounting the lv in the first place, so the data is written to /data on the / mount point. I just check the mounting status after rebooting, but not at the first time of mounting it. And that happens after rebooting with a right fstab, the data disappears :smile: . I discover this after unmounting the lv to try to recreate ext4 fs, and the data is still there, just not on the lv.
Thank you!

Aaron Lockhart:
That’ll do it!