2

I have created a file with some data:

root$ echo thisismydata > /etc/myfile

I can grep that file:

root$ grep -a "thisismydata" /etc/myfile 

thisismydata

I want to verify that I can grep the data on disk:

root$ grep -a "thisismydata" /dev/mapper/vg-root

Nothing is found. But that command is working fine, with other data:

root$ grep -a 'MIICNTCCA' /dev/mapper/vg-root
MIICNTCCAbygAwIBAgIJAMhaW/dIVfGbMAoGCCqGSM49BAMDMGAxCzAJBgNVBAYT
MIICNTCCAbygAwIBAgIJAMhaW/dIVfGbMAoGCCqGSM49BAMDMGAxCzAJBgNVBAYT
...

(that particular data appears in several places in my disk)

What is going on here? I was suspecting that maybe the file was not yet synced to disk, so I have done:

root$ sync
root$ grep -a "thisismydata" /dev/mapper/vg-root

But still, nothing.

Why can the newly created data not be found on the device?

Note: these are the mount flags:

root$ mount | grep root
/dev/mapper/vg-root on / type ext4 (rw,relatime,seclabel,data=ordered)

EDIT

The full mount, as requested:

root$ mount
sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,relatime,seclabel)
proc on /proc type proc (rw,nosuid,nodev,noexec,relatime)
devtmpfs on /dev type devtmpfs (rw,nosuid,seclabel,size=8101844k,nr_inodes=2025461,mode=755)
securityfs on /sys/kernel/security type securityfs (rw,nosuid,nodev,noexec,relatime)
tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev,seclabel)
devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,seclabel,gid=5,mode=620,ptmxmode=000)
tmpfs on /run type tmpfs (rw,nosuid,nodev,seclabel,mode=755)
tmpfs on /sys/fs/cgroup type tmpfs (ro,nosuid,nodev,noexec,seclabel,mode=755)
cgroup on /sys/fs/cgroup/systemd type cgroup (rw,nosuid,nodev,noexec,relatime,seclabel,xattr,release_agent=/usr/lib/systemd/systemd-cgroups-agent,name=systemd)
pstore on /sys/fs/pstore type pstore (rw,nosuid,nodev,noexec,relatime)
cgroup on /sys/fs/cgroup/cpu,cpuacct type cgroup (rw,nosuid,nodev,noexec,relatime,seclabel,cpuacct,cpu)
cgroup on /sys/fs/cgroup/net_cls,net_prio type cgroup (rw,nosuid,nodev,noexec,relatime,seclabel,net_prio,net_cls)
cgroup on /sys/fs/cgroup/hugetlb type cgroup (rw,nosuid,nodev,noexec,relatime,seclabel,hugetlb)
cgroup on /sys/fs/cgroup/blkio type cgroup (rw,nosuid,nodev,noexec,relatime,seclabel,blkio)
cgroup on /sys/fs/cgroup/pids type cgroup (rw,nosuid,nodev,noexec,relatime,seclabel,pids)
cgroup on /sys/fs/cgroup/devices type cgroup (rw,nosuid,nodev,noexec,relatime,seclabel,devices)
cgroup on /sys/fs/cgroup/freezer type cgroup (rw,nosuid,nodev,noexec,relatime,seclabel,freezer)
cgroup on /sys/fs/cgroup/cpuset type cgroup (rw,nosuid,nodev,noexec,relatime,seclabel,cpuset)
cgroup on /sys/fs/cgroup/memory type cgroup (rw,nosuid,nodev,noexec,relatime,seclabel,memory)
cgroup on /sys/fs/cgroup/perf_event type cgroup (rw,nosuid,nodev,noexec,relatime,seclabel,perf_event)
configfs on /sys/kernel/config type configfs (rw,relatime)
/dev/mapper/vg-root on / type ext4 (rw,relatime,seclabel,data=ordered)
/dev/mapper/vg-usr on /usr type ext4 (rw,relatime,seclabel,data=ordered)
selinuxfs on /sys/fs/selinux type selinuxfs (rw,relatime)
systemd-1 on /proc/sys/fs/binfmt_misc type autofs (rw,relatime,fd=32,pgrp=1,timeout=0,minproto=5,maxproto=5,direct,pipe_ino=13034)
debugfs on /sys/kernel/debug type debugfs (rw,relatime)
hugetlbfs on /dev/hugepages type hugetlbfs (rw,relatime,seclabel)
mqueue on /dev/mqueue type mqueue (rw,relatime,seclabel)
tmpfs on /tmp type tmpfs (rw,nosuid,noexec,relatime,seclabel,size=2097152k)
/dev/sda1 on /boot type ext4 (rw,relatime,seclabel,data=ordered)
/dev/mapper/vg-repo on /repo type ext4 (rw,relatime,seclabel,data=ordered)
/dev/mapper/vg-var on /var type ext4 (rw,relatime,seclabel,data=ordered)
/dev/mapper/vg-home on /home type ext4 (rw,relatime,seclabel,data=ordered)
/dev/mapper/vg-mysql on /var/lib/mysql type ext4 (rw,relatime,seclabel,data=ordered)
tmpfs on /var/www/html/app/cache type tmpfs (rw,nosuid,noexec,relatime,seclabel,size=262144k)
/dev/mapper/vg-backup on /var/backup type ext4 (rw,relatime,seclabel,data=ordered)
/dev/mapper/vg-log on /var/log type ext4 (rw,relatime,seclabel,data=ordered)
/dev/mapper/vg-audit on /var/log/audit type ext4 (rw,relatime,seclabel,data=ordered)
binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc (rw,relatime)
tmpfs on /run/user/0 type tmpfs (rw,nosuid,nodev,relatime,seclabel,size=1626632k,mode=700)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.