Bug 983929 - df does not work in chroot
df does not work in chroot
Status: CLOSED WORKSFORME
Product: Fedora
Classification: Fedora
Component: mock (Show other bugs)
20
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Miroslav Suchý
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-07-12 06:05 EDT by Viacheslav Dubrovskiy
Modified: 2014-05-16 06:36 EDT (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2014-05-16 06:36:39 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Viacheslav Dubrovskiy 2013-07-12 06:05:17 EDT
Description of problem:
In the chroot df does not work and the program can't determine free space


Version-Release number of selected component (if applicable):
mock-1.1.32-1.el6.noarch


Steps to Reproduce:
1. $ mock --init
2. $ mock --shell
3. # df

Actual results:
<mock-chroot>[root@koji /]# df
df: cannot read table of mounted file systems

Expected results:
<mock-chroot>[root@koji /]# df
Filesystem           1K-blocks      Used Available Use% Mounted on
none                 2147483648  16528952 2130954696   1% /dev
none                   1572864         0   1572864   0% /dev/shm
/dev/simfs           2147483648  16528952 2130954696   1% /
mock_chroot_shmfs      1572864         0   1572864   0% /dev/shm
/dev/simfs           2147483648  16528952 2130954696   1% /var/cache/yum


Additional info:
For fix:
<mock-chroot>[root@koji /]# rm -f /etc/mtab && ln -s /proc/mounts /etc/mtab

I propose to do ln -s /proc/mounts /etc/mtab by default instead touch /etc/mtab
Comment 1 Fedora End Of Life 2013-09-16 10:30:00 EDT
This bug appears to have been reported against 'rawhide' during the Fedora 20 development cycle.
Changing version to '20'.

More information and reason for this action is here:
https://fedoraproject.org/wiki/BugZappers/HouseKeeping/Fedora20
Comment 2 Miroslav Suchý 2014-05-16 06:36:39 EDT
Works for me:

mock --shell
INFO: mock.py version 1.1.38 starting...
Start: init plugins
INFO: selinux disabled
Finish: init plugins
Start: run
Start: lock buildroot
Start: device setup
Finish: device setup
Start: shell
<mock-chroot>[root@dri /]# df
df: ‘/dev/hugepages’: No such file or directory
df: ‘/sys/fs/cgroup/systemd’: No such file or directory
df: ‘/sys/fs/cgroup/cpuset’: No such file or directory
df: ‘/sys/fs/cgroup/cpu,cpuacct’: No such file or directory
df: ‘/sys/fs/cgroup/memory’: No such file or directory
df: ‘/sys/fs/cgroup/devices’: No such file or directory
df: ‘/sys/fs/cgroup/freezer’: No such file or directory
df: ‘/sys/fs/cgroup/net_cls’: No such file or directory
df: ‘/sys/fs/cgroup/blkio’: No such file or directory
df: ‘/sys/fs/cgroup/perf_event’: No such file or directory
df: ‘/sys/fs/cgroup/hugetlb’: No such file or directory
df: ‘/run/user/501/gvfs’: No such file or directory
df: ‘/mnt/scratch’: No such file or directory
df: ‘/mnt/globalsync’: No such file or directory
df: ‘/mnt/hostel’: No such file or directory
Filesystem                   1K-blocks     Used Available Use% Mounted on
/dev/mapper/VolGroup00-rhel6  34961088 32181680   2763024  93% /
devtmpfs                      34961088 32181680   2763024  93% /dev
tmpfs                          8208508        0   8208508   0% /dev/shm
tmpfs                         34961088 32181680   2763024  93% /run
tmpfs                         34961088 32181680   2763024  93% /tmp
/dev/mapper/VolGroup00-home   34961088 32181680   2763024  93% /home
mock_chroot_shmfs              8208508        0   8208508   0% /dev/shm

If you can provide reproducer why it does not work for you, feel free to reopen.

Note You need to log in before you can comment on or make changes to this bug.