Bug 983929 - df does not work in chroot
Summary: df does not work in chroot
Keywords:
Status: CLOSED WORKSFORME
Alias: None
Product: Fedora
Classification: Fedora
Component: mock
Version: 20
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Miroslav Suchý
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-07-12 10:05 UTC by Viacheslav Dubrovskiy
Modified: 2014-05-16 10:36 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-05-16 10:36:39 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Viacheslav Dubrovskiy 2013-07-12 10:05:17 UTC
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 14:30:00 UTC
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 10:36:39 UTC
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.