De acordo com isto:
Determine em qual dispositivo um diretório está localizado
Posso encontrar em qual dispositivo o arquivo está em df
comando em um ambiente normal:
fpemud-workstation / # df /bin
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/dm-0 476458008 48307576 403924640 11% /
Mas não posso usar esse método em chroot
:
fpemud-workstation / # mount -t proc n /test/proc
fpemud-workstation / # mount --rbind /sys /test/sys
fpemud-workstation / # mount --make-rslave /test/sys
fpemud-workstation / # mount --rbind /dev /test/dev
fpemud-workstation / # mount --make-rslave /test/dev
fpemud-workstation / # chroot /test df /bin
Filesystem 1K-blocks Used Available Use% Mounted on
- 476458008 48307604 403924612 11% /
EDITAR:
Sim, eu tenho /etc/mtab
no meu chroot, este é um resultado detalhado:
fpemud-workstation / # mount -t proc n /test/proc
fpemud-workstation / # mount --rbind /sys /test/sys
fpemud-workstation / # mount --make-rslave /test/sys
fpemud-workstation / # mount --rbind /dev /test/dev
fpemud-workstation / # mount --make-rslave /test/dev
fpemud-workstation / # chroot /test ls /etc/mtab -l
lrwxrwxrwx 1 root root 19 May 26 22:37 /etc/mtab -> ../proc/self/mounts
fpemud-workstation / # chroot /test df /bin
Filesystem 1K-blocks Used Available Use% Mounted on
- 476458008 51387464 400844752 12% /
fpemud-workstation / # chroot /test cat /proc/mounts
n /proc proc rw,relatime 0 0
sysfs /sys sysfs rw,nosuid,nodev,noexec,relatime 0 0
tmpfs /sys/fs/cgroup tmpfs ro,nosuid,nodev,noexec,mode=755 0 0
cgroup /sys/fs/cgroup/systemd cgroup rw,nosuid,nodev,noexec,relatime,xattr,release_agent=/usr/lib/systemd/systemd-cgroups-agent,name=systemd 0 0
cgroup /sys/fs/cgroup/cpu,cpuacct cgroup rw,nosuid,nodev,noexec,relatime,cpu,cpuacct 0 0
cgroup /sys/fs/cgroup/freezer cgroup rw,nosuid,nodev,noexec,relatime,freezer 0 0
cgroup /sys/fs/cgroup/pids cgroup rw,nosuid,nodev,noexec,relatime,pids 0 0
cgroup /sys/fs/cgroup/devices cgroup rw,nosuid,nodev,noexec,relatime,devices 0 0
cgroup /sys/fs/cgroup/cpuset cgroup rw,nosuid,nodev,noexec,relatime,cpuset 0 0
cgroup /sys/fs/cgroup/net_cls,net_prio cgroup rw,nosuid,nodev,noexec,relatime,net_cls,net_prio 0 0
cgroup /sys/fs/cgroup/perf_event cgroup rw,nosuid,nodev,noexec,relatime,perf_event 0 0
cgroup /sys/fs/cgroup/blkio cgroup rw,nosuid,nodev,noexec,relatime,blkio 0 0
cgroup /sys/fs/cgroup/memory cgroup rw,nosuid,nodev,noexec,relatime,memory 0 0
pstore /sys/fs/pstore pstore rw,nosuid,nodev,noexec,relatime 0 0
configfs /sys/kernel/config configfs rw,relatime 0 0
debugfs /sys/kernel/debug debugfs rw,relatime 0 0
fusectl /sys/fs/fuse/connections fusectl rw,relatime 0 0
devtmpfs /dev devtmpfs rw,nosuid,size=1997472k,nr_inodes=499368,mode=755 0 0
tmpfs /dev/shm tmpfs rw,nosuid,nodev 0 0
devpts /dev/pts devpts rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000 0 0
hugetlbfs /dev/hugepages hugetlbfs rw,relatime 0 0
mqueue /dev/mqueue mqueue rw,relatime 0 0