silverbulletmd / silverbullet

The hackable notebook
https://silverbullet.md
MIT License
2.04k stars 141 forks source link

created time is always the same as lastModified #787

Open daydaya opened 4 months ago

daydaya commented 4 months ago
4b78264a47e1465325dfdfed752d2a9

created should be the file creation time and will not be changed, right? But I found that it is always consistent with lastModified

My silverbullet runs in Docker on Synology NAS

I don't know if I'm the only one having this problem.

zefhemel commented 4 months ago

What filesystem are you using? If the FS somehow doesn't report file created time, SilverBullet will fall back to last modified if I remember correctly.

daydaya commented 4 months ago

I saw this information in the Docker terminal. The file system should be btrfs. The birth time does not seem to be provided. Is there any way I can enable my Docker to provide the birth time?

image
zefhemel commented 4 months ago

I have no idea, all I could do is the same as you, which is google.

daydaya commented 4 months ago

Ok, I did some testing and Google searches, it seems that the Synology NAS just can't provide the Birth attribute, 🤣 I will add the creation time frontmatter to the new file

terr-steak commented 3 months ago

Having the same issue running on docker in Unraid, will investigate as well.

UPDATE: I found that when I set up the docker image in unraid the data directory was set to be /mnt/user/appdata/silverbullet/data (unraid) --> /space (docker) and for whatever reason this caused the filesystem to get set in docker as shfs/fuse.shfs. Apparently this filesystem does not support creation time, so the birth time was showing up as - similar to @daydaya. I noticed that containers that used /mnt/cache/... instead of mnt/user/... were displaying a birth time when stat'ing a file. So I updated the unraid docker config to use `/mnt/cache' and now the created times in silverbullet are working as expected. Sorry, probably not much help to you @daydaya this is what my configs look like though in case it helps:

silverbullet@6f66139b215a:/space$ apt policy coreutils
coreutils:
  Installed: 9.1-1
  Candidate: 9.1-1
  Version table:
 *** 9.1-1 100
        100 /var/lib/dpkg/status

silverbullet@6f66139b215a: /space$ cat /etc/mtab | grep cache
/dev/sdc1 /mnt/cache btrfs rw,noatime,ssd,discard=async,space_cache=v2,subvolid=5,subvol=/ 0 0

silverbullet@6f66139b215a: /space$ df -Th
Filesystem     Type       Size  Used Avail Use% Mounted on
rootfs         rootfs      32G  532M   31G   2% /
tmpfs          tmpfs       32M  6.5M   26M  21% /run
/dev/sda1      vfat       7.5G  953M  6.5G  13% /boot
overlay        overlay     32G  532M   31G   2% /lib
overlay        overlay     32G  532M   31G   2% /usr
devtmpfs       devtmpfs   8.0M     0  8.0M   0% /dev
tmpfs          tmpfs       32G     0   32G   0% /dev/shm
tmpfs          tmpfs      128M   24M  105M  19% /var/log
tmpfs          tmpfs      1.0M     0  1.0M   0% /mnt/disks
tmpfs          tmpfs      1.0M     0  1.0M   0% /mnt/remotes
tmpfs          tmpfs      1.0M     0  1.0M   0% /mnt/addons
tmpfs          tmpfs      1.0M     0  1.0M   0% /mnt/rootshare
/dev/md1p1     xfs        932G  6.6G  925G   1% /mnt/disk1
/dev/md2p1     xfs        932G  6.6G  925G   1% /mnt/disk2
/dev/md3p1     xfs        932G  6.6G  925G   1% /mnt/disk3
/dev/md4p1     xfs        466G  3.3G  463G   1% /mnt/disk4
/dev/sdc1      btrfs      2.3T  217G  2.1T  10% /mnt/cache
shfs           fuse.shfs  3.2T   23G  3.2T   1% /mnt/user0
shfs           fuse.shfs  3.2T   23G  3.2T   1% /mnt/user
/dev/loop2     btrfs      500G   22G  476G   5% /var/lib/docker
/dev/loop3     btrfs      1.0G  4.9M  904M   1% /etc/libvirt

maybe check /etc/mke2fs.conf, it seems that sets some mount defaults for me...

silverbullet@6f66139b215a:/space$ cat /etc/mke2fs.conf  
[defaults]
        base_features = sparse_super,large_file,filetype,resize_inode,dir_index,ext_attr
        default_mntopts = acl,user_xattr
        enable_periodic_fsck = 0
        blocksize = 4096
        inode_size = 256
        inode_ratio = 16384
...
daydaya commented 2 months ago

Oh thank you very much, I will try again @terr-steak