Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 462628 - =sys-fs/e2fsprogs-1.42.7: e4defrag relies on /dev/root
Summary: =sys-fs/e2fsprogs-1.42.7: e4defrag relies on /dev/root
Status: CONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 438380
  Show dependency tree
 
Reported: 2013-03-21 21:50 UTC by Sven
Modified: 2013-03-31 10:32 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sven 2013-03-21 21:50:14 UTC
# e4defrag -v /root
Can't get super block info: No such file or directory
 "/root"


Reproducible: Always
Comment 1 Samuli Suominen (RETIRED) gentoo-dev 2013-03-21 22:02:06 UTC
(In reply to comment #0)
> # e4defrag -v /root
> Can't get super block info: No such file or directory
>  "/root"
> 
> 
> Reproducible: Always

you typed that /root there yourself on command line? why don't you use your device directly?

e4defrag is part of e2fsprogs and grepped through the source tree, only reference of /dev/root is inside comment at lib/ext2fs/ismounted.c, as in, is not used even there and the comment mentions it unreliable

like explained in eg. first hit from google:

http://www.hecticgeek.com/2012/10/defragment-ext4-file-systems-using-e4defrag-ubuntu/

# e4defrag -v /dev/sda

what am I missing here?
Comment 2 Sven 2013-03-21 23:18:57 UTC
Running e4defrag on a device is one thing. it defrags the whole filesystem, doesn't it?

But sometimes, you want to defrag a folder or a single file only (e.g. the folder /root). Then, e4defrags looks for the device in /proc/mounts, and finds /dev/root. But /dev/root is not created by recent udev versions.
Comment 3 Samuli Suominen (RETIRED) gentoo-dev 2013-03-21 23:37:50 UTC
(In reply to comment #2)
> Running e4defrag on a device is one thing. it defrags the whole filesystem,
> doesn't it?
> 
> But sometimes, you want to defrag a folder or a single file only (e.g. the
> folder /root). Then, e4defrags looks for the device in /proc/mounts, and
> finds /dev/root. But /dev/root is not created by recent udev versions.

I see:

# e4defrag /root
ext4 defragmentation for directory(/root)
[ .. snip .. ]
[ OK ]
Success:			[ 13/33 ]
Failure:			[ 20/33 ]
# echo $?
0
# rm /dev/root
# e4defrag /root
# echo $?
1

While sys-fs/udev-init-scripts-25 puts /dev/root symlink back, e4defrag shouldn't fail like this. You are right, reopening.
Comment 4 Nikoli 2013-03-31 10:32:13 UTC
I think the bug is not in sys-fs/e2fsprogs, but in something else, possibly in genkernel. Now when booting with sys-kernel/dracut-024-r4 generated initramfs there is no /dev/root in /proc/mounts:
# cat /proc/mounts |grep -e ' / ' -e root
rootfs / rootfs rw 0 0
/dev/sda3 / ext4 rw,relatime,data=ordered 0 0
cgroup_root /sys/fs/cgroup tmpfs rw,nosuid,nodev,noexec,relatime,size=10240k,mode=755 0 0


Sven, how you boot your system, are you using initramfs, dracut, genkernel?