Discussion:
df does not report my root file system
Ming-Ching Tiew
2006-07-10 05:38:14 UTC
Permalink
This is the output of these commands :-

# ls -al /dev/ram0 /dev/root
brw-rw---- 1 root root 1, 0 July 10 15:30 /dev/ram0
lrwxrwxrwx 1 root root 9 July 10 15:30 /dev/root -> /dev/ram0
# cat /proc/mounts
rootfs / rootfs rw 0 0
/proc /proc proc rw 0 0
# df
Filesystem 1k-blocks Used Available
(blank output except for the header )

This is executed in initramfs.

Now my problem is that 'df' does not report the root filesystem.
What do I have to do to make it report the root files system ?

Regards.
walter harms
2006-07-10 14:37:14 UTC
Permalink
please,
what version fo bb you are using ?
what processor ?
my bb works fine:
$ busybox
BusyBox v1.1.0 (2006.06.26-17:06+0000) multi-call binary


$df
Filesystem 1k-blocks Used Available Use% Mounted on
/dev/flash3 9032 9032 0 100% /
/dev/flash2 4736 1064 3672 22% /mnt/flash
tmpfs 10240 400 9840 4% /var

i will be away the next few days. please provide the needed information
on the list.

re,
walter
Post by Ming-Ching Tiew
This is the output of these commands :-
# ls -al /dev/ram0 /dev/root
brw-rw---- 1 root root 1, 0 July 10 15:30 /dev/ram0
lrwxrwxrwx 1 root root 9 July 10 15:30 /dev/root -> /dev/ram0
# cat /proc/mounts
rootfs / rootfs rw 0 0
/proc /proc proc rw 0 0
# df
Filesystem 1k-blocks Used Available
(blank output except for the header )
This is executed in initramfs.
Now my problem is that 'df' does not report the root filesystem.
What do I have to do to make it report the root files system ?
Regards.
_______________________________________________
busybox mailing list
http://busybox.net/cgi-bin/mailman/listinfo/busybox
Ming-Ching Tiew
2006-07-10 21:46:44 UTC
Permalink
I have tried with bb 1.0 and bb 1.2.0.

And I think it is almost independent of bb version.

Please note that your case is different from what I
am reporting. I have no doubt that df will work under
your scenario. But I issued the command 'df' inside
the initramfs, I have no other block devices mounted
under the root, ie initramfs is my root file system.

Regards.

----- Original Message -----
From: "walter harms" <***@bfs.de>
To: "Ming-Ching Tiew" <***@redtone.com>
Cc: <***@busybox.net>
Sent: Tuesday, July 11, 2006 12:36 AM
Subject: Re: df does not report my root file system
Post by walter harms
please,
what version fo bb you are using ?
what processor ?
$ busybox
BusyBox v1.1.0 (2006.06.26-17:06+0000) multi-call binary
$df
Filesystem 1k-blocks Used Available Use% Mounted on
/dev/flash3 9032 9032 0 100% /
/dev/flash2 4736 1064 3672 22% /mnt/flash
tmpfs 10240 400 9840 4% /var
i will be away the next few days. please provide the needed information
on the list.
re,
walter
Post by Ming-Ching Tiew
This is the output of these commands :-
# ls -al /dev/ram0 /dev/root
brw-rw---- 1 root root 1, 0 July 10 15:30 /dev/ram0
lrwxrwxrwx 1 root root 9 July 10 15:30 /dev/root -> /dev/ram0
# cat /proc/mounts
rootfs / rootfs rw 0 0
/proc /proc proc rw 0 0
# df
Filesystem 1k-blocks Used Available
(blank output except for the header )
This is executed in initramfs.
Now my problem is that 'df' does not report the root filesystem.
What do I have to do to make it report the root files system ?
Regards.
_______________________________________________
busybox mailing list
http://busybox.net/cgi-bin/mailman/listinfo/busybox
Ming-Ching Tiew
2006-07-10 23:18:52 UTC
Permalink
I have tried with bb 1.0 and bb 1.2.0.

And I think it is almost independent of bb version.

Please note that your case is different from what I
am reporting. I have no doubt that df will work under
your scenario. But I issued the command 'df' inside
the initramfs, I have no other block devices mounted
under the root, ie initramfs is my root file system.

Regards.

----- Original Message -----
From: "walter harms" <***@bfs.de>
To: "Ming-Ching Tiew" <***@redtone.com>
Cc: <***@busybox.net>
Sent: Tuesday, July 11, 2006 12:36 AM
Subject: Re: df does not report my root file system
Post by walter harms
please,
what version fo bb you are using ?
what processor ?
$ busybox
BusyBox v1.1.0 (2006.06.26-17:06+0000) multi-call binary
$df
Filesystem 1k-blocks Used Available Use% Mounted on
/dev/flash3 9032 9032 0 100% /
/dev/flash2 4736 1064 3672 22% /mnt/flash
tmpfs 10240 400 9840 4% /var
i will be away the next few days. please provide the needed information
on the list.
re,
walter
Post by Ming-Ching Tiew
This is the output of these commands :-
# ls -al /dev/ram0 /dev/root
brw-rw---- 1 root root 1, 0 July 10 15:30 /dev/ram0
lrwxrwxrwx 1 root root 9 July 10 15:30 /dev/root -> /dev/ram0
# cat /proc/mounts
rootfs / rootfs rw 0 0
/proc /proc proc rw 0 0
# df
Filesystem 1k-blocks Used Available
(blank output except for the header )
This is executed in initramfs.
Now my problem is that 'df' does not report the root filesystem.
What do I have to do to make it report the root files system ?
Regards.
Bernhard Fischer
2006-07-11 05:24:18 UTC
Permalink
Post by Ming-Ching Tiew
I have tried with bb 1.0 and bb 1.2.0.
And I think it is almost independent of bb version.
This is correct.
See
http://bugs.uclibc.org/view.php?id=145
http://bugs.uclibc.org/view.php?id=894
Post by Ming-Ching Tiew
Please note that your case is different from what I
am reporting. I have no doubt that df will work under
your scenario. But I issued the command 'df' inside
the initramfs, I have no other block devices mounted
under the root, ie initramfs is my root file system.
Regards.
----- Original Message -----
Sent: Tuesday, July 11, 2006 12:36 AM
Subject: Re: df does not report my root file system
Post by walter harms
please,
what version fo bb you are using ?
what processor ?
$ busybox
BusyBox v1.1.0 (2006.06.26-17:06+0000) multi-call binary
$df
Filesystem 1k-blocks Used Available Use% Mounted on
/dev/flash3 9032 9032 0 100% /
/dev/flash2 4736 1064 3672 22% /mnt/flash
tmpfs 10240 400 9840 4% /var
i will be away the next few days. please provide the needed information
on the list.
re,
walter
Post by Ming-Ching Tiew
This is the output of these commands :-
# ls -al /dev/ram0 /dev/root
brw-rw---- 1 root root 1, 0 July 10 15:30 /dev/ram0
lrwxrwxrwx 1 root root 9 July 10 15:30 /dev/root -> /dev/ram0
# cat /proc/mounts
rootfs / rootfs rw 0 0
/proc /proc proc rw 0 0
# df
Filesystem 1k-blocks Used Available
(blank output except for the header )
This is executed in initramfs.
Now my problem is that 'df' does not report the root filesystem.
What do I have to do to make it report the root files system ?
Regards.
_______________________________________________
busybox mailing list
http://busybox.net/cgi-bin/mailman/listinfo/busybox
Ming-Ching Tiew
2006-07-11 06:03:31 UTC
Permalink
Post by Bernhard Fischer
Post by Ming-Ching Tiew
I have tried with bb 1.0 and bb 1.2.0.
And I think it is almost independent of bb version.
This is correct.
See
http://bugs.uclibc.org/view.php?id=145
http://bugs.uclibc.org/view.php?id=894
Not sure what do you mean by "This is correct". Did you mean my observation is
correct or you mean bb is correct ? :-)

Before I made the first post, I have already tried bug id 894 patch. It did not make
any difference. Also bug id 145 patch could not be applied on bb 1.2.0.

Now I am not sure why id 894 patch did not fix my problem. Maybe there is
something I did not do correct on my side.

Regard.
Bernhard Fischer
2006-07-11 06:50:51 UTC
Permalink
Post by Ming-Ching Tiew
Not sure what do you mean by "This is correct". Did you mean my observation is
correct or you mean bb is correct ? :-)
Your observation that it's broken since a long time is correct.
Post by Ming-Ching Tiew
Before I made the first post, I have already tried bug id 894 patch. It did not make
any difference. Also bug id 145 patch could not be applied on bb 1.2.0.
Please try the attached updated patch from #145 and let me know if this
fixes the problem you are seeing
-------------- next part --------------
Index: libbb/find_mount_point.c
===================================================================
--- libbb/find_mount_point.c (revision 15683)
+++ libbb/find_mount_point.c (working copy)
@@ -27,7 +27,7 @@ struct mntent *find_mount_point(const ch
FILE *mountTable;
struct mntent *mountEntry;

- if (stat(name, &s) != 0)
+ if (stat(name, &s) != 0 && strcmp(name,"/dev/root"))
return 0;

if ((s.st_mode & S_IFMT) == S_IFBLK)
@@ -40,14 +40,15 @@ struct mntent *find_mount_point(const ch
return 0;

while ((mountEntry = getmntent(mountTable)) != 0) {
-
- if(strcmp(name, mountEntry->mnt_dir) == 0
- || strcmp(name, mountEntry->mnt_fsname) == 0) /* String match. */
- break;
- if (stat(mountEntry->mnt_fsname, &s) == 0 && s.st_rdev == mountDevice) /* Match the device. */
- break;
- if (stat(mountEntry->mnt_dir, &s) == 0 && s.st_dev == mountDevice) /* Match the directory's mount point. */
- break;
+ if (!strcmp(mountEntry->mnt_fsname, "rootfs"))
+ continue;
+ if (strcmp(name, mountEntry->mnt_dir) == 0
+ || strcmp(name, mountEntry->mnt_fsname) == 0)
+ break; /* String match. */
+ if (stat(mountEntry->mnt_fsname, &s) == 0 && s.st_rdev == mountDevice)
+ break; /* Match the device. */
+ if (stat(mountEntry->mnt_dir, &s) == 0 && s.st_dev == mountDevice)
+ break; /* Match the directory's mount point. */
}
endmntent(mountTable);
return mountEntry;
Ming-Ching Tiew
2006-07-11 08:19:18 UTC
Permalink
Post by Bernhard Fischer
Please try the attached updated patch from #145 and let me know if this
fixes the problem you are seeing
It did not look good either. Basically I did some debug prints, I found that
rootfs ( initramfs, device=rootfs, mount_point=/ ) reports s.f_blocks = 0
( see df.c source ), so whatever logic inside the block has been skipped.

Basically I think initramfs does not have the block file system
behaviour, so statfs() is hopeless on it.

Regards.
Ming-Ching Tiew
2006-07-11 10:17:58 UTC
Permalink
From: "Bernhard Fischer" <rep.nop at aon.at>
Post by Bernhard Fischer
Please try the attached updated patch from #145 and let me know if this
fixes the problem you are seeing
It did not look good either. Basically I did some debug prints, I found that
rootfs ( initramfs, device=rootfs, mount_point=/ ) reports s.f_blocks = 0
( see df.c source ), so whatever logic inside the block has been skipped.

Basically I think initramfs does not have the block file system
behaviour, so statfs() is hopeless on it.

Regards.
Bernhard Fischer
2006-07-11 08:50:39 UTC
Permalink
Post by Ming-Ching Tiew
Not sure what do you mean by "This is correct". Did you mean my observation is
correct or you mean bb is correct ? :-)
Your observation that it's broken since a long time is correct.
Post by Ming-Ching Tiew
Before I made the first post, I have already tried bug id 894 patch. It did not make
any difference. Also bug id 145 patch could not be applied on bb 1.2.0.
Please try the attached updated patch from #145 and let me know if this
fixes the problem you are seeing
-------------- next part --------------
Index: libbb/find_mount_point.c
===================================================================
--- libbb/find_mount_point.c (revision 15683)
+++ libbb/find_mount_point.c (working copy)
@@ -27,7 +27,7 @@ struct mntent *find_mount_point(const ch
FILE *mountTable;
struct mntent *mountEntry;

- if (stat(name, &s) != 0)
+ if (stat(name, &s) != 0 && strcmp(name,"/dev/root"))
return 0;

if ((s.st_mode & S_IFMT) == S_IFBLK)
@@ -40,14 +40,15 @@ struct mntent *find_mount_point(const ch
return 0;

while ((mountEntry = getmntent(mountTable)) != 0) {
-
- if(strcmp(name, mountEntry->mnt_dir) == 0
- || strcmp(name, mountEntry->mnt_fsname) == 0) /* String match. */
- break;
- if (stat(mountEntry->mnt_fsname, &s) == 0 && s.st_rdev == mountDevice) /* Match the device. */
- break;
- if (stat(mountEntry->mnt_dir, &s) == 0 && s.st_dev == mountDevice) /* Match the directory's mount point. */
- break;
+ if (!strcmp(mountEntry->mnt_fsname, "rootfs"))
+ continue;
+ if (strcmp(name, mountEntry->mnt_dir) == 0
+ || strcmp(name, mountEntry->mnt_fsname) == 0)
+ break; /* String match. */
+ if (stat(mountEntry->mnt_fsname, &s) == 0 && s.st_rdev == mountDevice)
+ break; /* Match the device. */
+ if (stat(mountEntry->mnt_dir, &s) == 0 && s.st_dev == mountDevice)
+ break; /* Match the directory's mount point. */
}
endmntent(mountTable);
return mountEntry;
Ming-Ching Tiew
2006-07-11 08:00:54 UTC
Permalink
From: "Bernhard Fischer" <rep.nop at aon.at>
Post by Bernhard Fischer
Post by Ming-Ching Tiew
I have tried with bb 1.0 and bb 1.2.0.
And I think it is almost independent of bb version.
This is correct.
See
http://bugs.uclibc.org/view.php?id=145
http://bugs.uclibc.org/view.php?id=894
Not sure what do you mean by "This is correct". Did you mean my observation is
correct or you mean bb is correct ? :-)

Before I made the first post, I have already tried bug id 894 patch. It did not make
any difference. Also bug id 145 patch could not be applied on bb 1.2.0.

Now I am not sure why id 894 patch did not fix my problem. Maybe there is
something I did not do correct on my side.

Regard.
Bernhard Fischer
2006-07-11 07:24:03 UTC
Permalink
Post by Ming-Ching Tiew
I have tried with bb 1.0 and bb 1.2.0.
And I think it is almost independent of bb version.
This is correct.
See
http://bugs.uclibc.org/view.php?id=145
http://bugs.uclibc.org/view.php?id=894
Post by Ming-Ching Tiew
Please note that your case is different from what I
am reporting. I have no doubt that df will work under
your scenario. But I issued the command 'df' inside
the initramfs, I have no other block devices mounted
under the root, ie initramfs is my root file system.
Regards.
----- Original Message -----
From: "walter harms" <wharms at bfs.de>
To: "Ming-Ching Tiew" <mingching.tiew at redtone.com>
Cc: <busybox at busybox.net>
Sent: Tuesday, July 11, 2006 12:36 AM
Subject: Re: df does not report my root file system
Post by walter harms
please,
what version fo bb you are using ?
what processor ?
$ busybox
BusyBox v1.1.0 (2006.06.26-17:06+0000) multi-call binary
$df
Filesystem 1k-blocks Used Available Use% Mounted on
/dev/flash3 9032 9032 0 100% /
/dev/flash2 4736 1064 3672 22% /mnt/flash
tmpfs 10240 400 9840 4% /var
i will be away the next few days. please provide the needed information
on the list.
re,
walter
Post by Ming-Ching Tiew
This is the output of these commands :-
# ls -al /dev/ram0 /dev/root
brw-rw---- 1 root root 1, 0 July 10 15:30 /dev/ram0
lrwxrwxrwx 1 root root 9 July 10 15:30 /dev/root -> /dev/ram0
# cat /proc/mounts
rootfs / rootfs rw 0 0
/proc /proc proc rw 0 0
# df
Filesystem 1k-blocks Used Available
(blank output except for the header )
This is executed in initramfs.
Now my problem is that 'df' does not report the root filesystem.
What do I have to do to make it report the root files system ?
Regards.
_______________________________________________
busybox mailing list
busybox at busybox.net
http://busybox.net/cgi-bin/mailman/listinfo/busybox
Ming-Ching Tiew
2006-07-10 23:46:27 UTC
Permalink
I have tried with bb 1.0 and bb 1.2.0.

And I think it is almost independent of bb version.

Please note that your case is different from what I
am reporting. I have no doubt that df will work under
your scenario. But I issued the command 'df' inside
the initramfs, I have no other block devices mounted
under the root, ie initramfs is my root file system.

Regards.

----- Original Message -----
From: "walter harms" <wharms at bfs.de>
To: "Ming-Ching Tiew" <mingching.tiew at redtone.com>
Cc: <busybox at busybox.net>
Sent: Tuesday, July 11, 2006 12:36 AM
Subject: Re: df does not report my root file system
Post by walter harms
please,
what version fo bb you are using ?
what processor ?
$ busybox
BusyBox v1.1.0 (2006.06.26-17:06+0000) multi-call binary
$df
Filesystem 1k-blocks Used Available Use% Mounted on
/dev/flash3 9032 9032 0 100% /
/dev/flash2 4736 1064 3672 22% /mnt/flash
tmpfs 10240 400 9840 4% /var
i will be away the next few days. please provide the needed information
on the list.
re,
walter
Post by Ming-Ching Tiew
This is the output of these commands :-
# ls -al /dev/ram0 /dev/root
brw-rw---- 1 root root 1, 0 July 10 15:30 /dev/ram0
lrwxrwxrwx 1 root root 9 July 10 15:30 /dev/root -> /dev/ram0
# cat /proc/mounts
rootfs / rootfs rw 0 0
/proc /proc proc rw 0 0
# df
Filesystem 1k-blocks Used Available
(blank output except for the header )
This is executed in initramfs.
Now my problem is that 'df' does not report the root filesystem.
What do I have to do to make it report the root files system ?
Regards.
_______________________________________________
busybox mailing list
busybox at busybox.net
http://busybox.net/cgi-bin/mailman/listinfo/busybox
Ming-Ching Tiew
2006-07-11 01:18:16 UTC
Permalink
I have tried with bb 1.0 and bb 1.2.0.

And I think it is almost independent of bb version.

Please note that your case is different from what I
am reporting. I have no doubt that df will work under
your scenario. But I issued the command 'df' inside
the initramfs, I have no other block devices mounted
under the root, ie initramfs is my root file system.

Regards.

----- Original Message -----
From: "walter harms" <wharms at bfs.de>
To: "Ming-Ching Tiew" <mingching.tiew at redtone.com>
Cc: <busybox at busybox.net>
Sent: Tuesday, July 11, 2006 12:36 AM
Subject: Re: df does not report my root file system
Post by walter harms
please,
what version fo bb you are using ?
what processor ?
$ busybox
BusyBox v1.1.0 (2006.06.26-17:06+0000) multi-call binary
$df
Filesystem 1k-blocks Used Available Use% Mounted on
/dev/flash3 9032 9032 0 100% /
/dev/flash2 4736 1064 3672 22% /mnt/flash
tmpfs 10240 400 9840 4% /var
i will be away the next few days. please provide the needed information
on the list.
re,
walter
Post by Ming-Ching Tiew
This is the output of these commands :-
# ls -al /dev/ram0 /dev/root
brw-rw---- 1 root root 1, 0 July 10 15:30 /dev/ram0
lrwxrwxrwx 1 root root 9 July 10 15:30 /dev/root -> /dev/ram0
# cat /proc/mounts
rootfs / rootfs rw 0 0
/proc /proc proc rw 0 0
# df
Filesystem 1k-blocks Used Available
(blank output except for the header )
This is executed in initramfs.
Now my problem is that 'df' does not report the root filesystem.
What do I have to do to make it report the root files system ?
Regards.
Rob Landley
2006-07-11 13:03:05 UTC
Permalink
Post by Ming-Ching Tiew
This is the output of these commands :-
# ls -al /dev/ram0 /dev/root
brw-rw---- 1 root root 1, 0 July 10 15:30 /dev/ram0
lrwxrwxrwx 1 root root 9 July 10 15:30 /dev/root -> /dev/ram0
# cat /proc/mounts
rootfs / rootfs rw 0 0
/proc /proc proc rw 0 0
# df
Filesystem 1k-blocks Used Available
(blank output except for the header )
This is executed in initramfs.
Now my problem is that 'df' does not report the root filesystem.
What do I have to do to make it report the root files system ?
Regards.
Yeah, df is broken. I need to upgrade it.

I have a todo item to make df sort the mount points and show the most recent
of each. The problem is that rootfs is always mounted even when you're not
using initramfs (or after you've pivoted off of it). In most systems another
partition gets mounted over it during normal use, and so we needed to add
extra logic to avoid df showing a partition you can't access.

The _correct_ fix would have been to accumulate a list of mount points and
kill duplicates, showing only the latest of each. What we did is special
case the root mount so we never show rootfs, which is wrong and broken and
doesn't give the right result if something _else_ is overmounted. (Which
isn't a common case, but is easily possible with bind mounts or ubuntu 6.06's
broken init scripts that mount /var/run and /var/lock _twice_ (it's tmpfs,
they stack)...)

I'll fix it.

Rob
--
Never bet against the cheap plastic solution.
Ming-Ching Tiew
2006-07-11 20:58:07 UTC
Permalink
Post by Rob Landley
Yeah, df is broken. I need to upgrade it.
Instead of adding so much code logic and complexity
( sort, kill duplicates and so on ), perhaps may I
suggest we treat the current behaviour has the normal,
and just add one commandline switch to display
the mounted rootfs ( df -r or something ) as special case ?

Should probably easier and few lines.

My two cents.
Rich Felker
2006-07-11 22:04:57 UTC
Permalink
Post by Ming-Ching Tiew
Post by Rob Landley
Yeah, df is broken. I need to upgrade it.
Instead of adding so much code logic and complexity
( sort, kill duplicates and so on ), perhaps may I
suggest we treat the current behaviour has the normal,
and just add one commandline switch to display
the mounted rootfs ( df -r or something ) as special case ?
Should probably easier and few lines.
My two cents.
But as Rob said there are other realworld cases where the output is
incorrect too.

Rich
Rich Felker
2006-07-12 00:03:56 UTC
Permalink
Post by Ming-Ching Tiew
From: "Rob Landley" <rob at landley.net>
Post by Rob Landley
Yeah, df is broken. I need to upgrade it.
Instead of adding so much code logic and complexity
( sort, kill duplicates and so on ), perhaps may I
suggest we treat the current behaviour has the normal,
and just add one commandline switch to display
the mounted rootfs ( df -r or something ) as special case ?
Should probably easier and few lines.
My two cents.
But as Rob said there are other realworld cases where the output is
incorrect too.

Rich

Ming-Ching Tiew
2006-07-11 23:00:16 UTC
Permalink
From: "Rob Landley" <rob at landley.net>
Post by Rob Landley
Yeah, df is broken. I need to upgrade it.
Instead of adding so much code logic and complexity
( sort, kill duplicates and so on ), perhaps may I
suggest we treat the current behaviour has the normal,
and just add one commandline switch to display
the mounted rootfs ( df -r or something ) as special case ?

Should probably easier and few lines.

My two cents.
Ming-Ching Tiew
2006-07-10 07:37:17 UTC
Permalink
This is the output of these commands :-

# ls -al /dev/ram0 /dev/root
brw-rw---- 1 root root 1, 0 July 10 15:30 /dev/ram0
lrwxrwxrwx 1 root root 9 July 10 15:30 /dev/root -> /dev/ram0
# cat /proc/mounts
rootfs / rootfs rw 0 0
/proc /proc proc rw 0 0
# df
Filesystem 1k-blocks Used Available
(blank output except for the header )

This is executed in initramfs.

Now my problem is that 'df' does not report the root filesystem.
What do I have to do to make it report the root files system ?

Regards.
walter harms
2006-07-10 16:36:57 UTC
Permalink
please,
what version fo bb you are using ?
what processor ?
my bb works fine:
$ busybox
BusyBox v1.1.0 (2006.06.26-17:06+0000) multi-call binary


$df
Filesystem 1k-blocks Used Available Use% Mounted on
/dev/flash3 9032 9032 0 100% /
/dev/flash2 4736 1064 3672 22% /mnt/flash
tmpfs 10240 400 9840 4% /var

i will be away the next few days. please provide the needed information
on the list.

re,
walter
Post by Ming-Ching Tiew
This is the output of these commands :-
# ls -al /dev/ram0 /dev/root
brw-rw---- 1 root root 1, 0 July 10 15:30 /dev/ram0
lrwxrwxrwx 1 root root 9 July 10 15:30 /dev/root -> /dev/ram0
# cat /proc/mounts
rootfs / rootfs rw 0 0
/proc /proc proc rw 0 0
# df
Filesystem 1k-blocks Used Available
(blank output except for the header )
This is executed in initramfs.
Now my problem is that 'df' does not report the root filesystem.
What do I have to do to make it report the root files system ?
Regards.
_______________________________________________
busybox mailing list
busybox at busybox.net
http://busybox.net/cgi-bin/mailman/listinfo/busybox
Rob Landley
2006-07-11 14:56:25 UTC
Permalink
Post by Ming-Ching Tiew
This is the output of these commands :-
# ls -al /dev/ram0 /dev/root
brw-rw---- 1 root root 1, 0 July 10 15:30 /dev/ram0
lrwxrwxrwx 1 root root 9 July 10 15:30 /dev/root -> /dev/ram0
# cat /proc/mounts
rootfs / rootfs rw 0 0
/proc /proc proc rw 0 0
# df
Filesystem 1k-blocks Used Available
(blank output except for the header )
This is executed in initramfs.
Now my problem is that 'df' does not report the root filesystem.
What do I have to do to make it report the root files system ?
Regards.
Yeah, df is broken. I need to upgrade it.

I have a todo item to make df sort the mount points and show the most recent
of each. The problem is that rootfs is always mounted even when you're not
using initramfs (or after you've pivoted off of it). In most systems another
partition gets mounted over it during normal use, and so we needed to add
extra logic to avoid df showing a partition you can't access.

The _correct_ fix would have been to accumulate a list of mount points and
kill duplicates, showing only the latest of each. What we did is special
case the root mount so we never show rootfs, which is wrong and broken and
doesn't give the right result if something _else_ is overmounted. (Which
isn't a common case, but is easily possible with bind mounts or ubuntu 6.06's
broken init scripts that mount /var/run and /var/lock _twice_ (it's tmpfs,
they stack)...)

I'll fix it.

Rob
--
Never bet against the cheap plastic solution.
Loading...