Usando unshare -Umr
eu criei um novo usuário, mount namespaces onde o processo de chamada é movido. Então via mount -t tmpfs tmpfs /
eu montei uma nova instância tmpfs na raiz /
da árvore de diretórios dentro do novo mount namespace.
Como o tmpfs
está vazio, eu esperaria ver uma lista vazia do comando ls -la /
, no entanto, aqui está a saída:
ubuntu@ubuntu:~$ unshare -Umr /bin/bash
root@ubuntu:~# mount -t tmpfs tmpfs /
root@ubuntu:~# ls -la /
total 5309704
drwxr-xr-x 24 nobody nogroup 4096 Nov 22 2023 .
drwxrwxrwt 2 root root 40 Nov 11 15:47 ..
drwxr-xr-x 2 nobody nogroup 4096 Jan 25 2023 bin
drwxr-xr-x 3 nobody nogroup 4096 Jan 25 2023 boot
drwxr-xr-x 2 nobody nogroup 4096 Nov 11 2019 cdrom
drwxr-xr-x 17 nobody nogroup 3820 Aug 22 14:22 dev
drwxr-xr-x 105 nobody nogroup 4096 Mar 14 2024 etc
-rw-r--r-- 1 root root 1688371200 Jan 19 2021 GISO
drwxr-xr-x 3 nobody nogroup 4096 Nov 11 2019 home
lrwxrwxrwx 1 nobody nogroup 34 Jan 25 2023 initrd.img -> boot/initrd.img-4.15.0-202-generic
lrwxrwxrwx 1 nobody nogroup 34 Jan 25 2023 initrd.img.old -> boot/initrd.img-4.15.0-132-generic
drwxr-xr-x 21 nobody nogroup 4096 Jan 25 2023 lib
drwxr-xr-x 2 nobody nogroup 4096 Jan 25 2023 lib64
drwx------ 2 nobody nogroup 16384 Nov 11 2019 lost+found
drwxr-xr-x 2 nobody nogroup 4096 Feb 10 2021 media
drwxr-xr-x 2 nobody nogroup 4096 Aug 5 2019 mnt
drwxr-xr-x 3 nobody nogroup 4096 Nov 26 2020 opt
dr-xr-xr-x 123 nobody nogroup 0 Aug 22 12:22 proc
drwx------ 4 nobody nogroup 4096 Dec 6 2023 root
drwxr-xr-x 24 nobody nogroup 820 Nov 11 15:20 run
drwxr-xr-x 2 nobody nogroup 12288 Jan 25 2023 sbin
drwxr-xr-x 4 nobody nogroup 4096 Nov 11 2019 snap
drwxr-xr-x 3 nobody nogroup 4096 Jan 24 2020 srv
-rw------- 1 nobody nogroup 3748659200 Nov 11 2019 swap.img
dr-xr-xr-x 13 nobody nogroup 0 Nov 11 15:40 sys
drwxrwxrwt 10 nobody nogroup 4096 Nov 11 15:42 tmp
drwxr-xr-x 10 nobody nogroup 4096 Aug 5 2019 usr
drwxr-xr-x 13 nobody nogroup 4096 Aug 5 2019 var
lrwxrwxrwx 1 nobody nogroup 31 Jan 25 2023 vmlinuz -> boot/vmlinuz-4.15.0-202-generic
lrwxrwxrwx 1 nobody nogroup 31 Jan 25 2023 vmlinuz.old -> boot/vmlinuz-4.15.0-132-generic
root@ubuntu:~#
como no sistema de arquivos montado como /
antes do tmpfs ser montado. Por que estou obtendo esse resultado?