Question about mount

Alexander Griesser alexander.griesser at lkh-vil.or.at
Tue Mar 28 23:36:54 PST 2006


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Rob Landley wrote:
>>>> [lxtc3861 - ~ #] mount /
>>>> mount: Mounting /dev/hda1 on /system failed: No such device
>>>> [lxtc3861 - ~ #]
>>> Out of morbid curiosity, how did you get here without / already mounted?
>> / is mounted, but it is mounted readonly.
>> In my init-scripts I then try to mount it readwrite.
> 
> Ok.  In theory, that should work.  Do you have /proc mounted yet when you try 
> to do this?  (That's how I tested.  If it doesn't work when /proc isn't 
> mounted, that's a bug I need to fix.)

It it doesn't work when /proc is _NOT_ mounted, you need to fix it?
I thought, /proc needs to be mounted to work with /proc/mounts?

The order of my bootscripts looks like this:

[lxtc3861 - /etc/rcS.d #] ls -1 | head -3
S00mountsysdrive
S01mountvirtfs
S02mountfs
[lxtc3861 - /etc/rcS.d #]

Where S00 does `mount /system`, S01 mounts /proc, /sys, /proc/bus/usb,
/dev/pts and /var/tmp and S02 does `mount -o remount,rw /dev/root /`.

So, /proc is definetly mounted before I try to mount /.

>> [lxtc3861 - ~ #] cat /proc/mounts
>> rootfs / rootfs rw 0 0
>> [...]
>> The line containing rootfs looks strange, but I'll have to investigate
>> this further to see, where it comes from.
> 
> All 2.6 kernels have that.  In the 2.6.16 kernel source, read 
> "Documentation/filesystems/ramfs-rootfs-initramfs.txt".

Thanks, I'll read this in my coffee break.

>> Remount to readonly:
>> ---------------------
>>
>> [lxtc3861 - ~ #] mount -n -o remount,ro /system
>> [lxtc3861 - ~ #] echo $?
>> 0
>> [lxtc3861 - ~ #] cat /proc/mounts
>> rootfs / rootfs rw 0 0
>> /dev/root / ext3 rw,data=ordered 0 0
>> /dev/hda1 /system ext3 rw,data=ordered 0 0
>> proc /proc proc rw 0 0
>> sysfs /sys sysfs rw 0 0
>> none /proc/bus/usb usbfs rw 0 0
>> devpts /dev/pts devpts rw 0 0
>> tmpfs /var/tmp tmpfs ro 0 0
>> [lxtc3861 - ~ #] touch /system/x
>> [lxtc3861 - ~ #] rm /system/x
> 
> Huh.  That should have worked.

Hmm... In previous busybox releases it worked :)

> Passing -n to mount should be a NOP when we're not maintaining an mtab.

I know, but I got used to write it this way.

> Does it work if you point it at /dev/hda1 instead of /system?  (Need to go 
> stare at the code...)

No.

[lxtc3861 - /etc/rcS.d #] mount
/dev/root on / type ext3 (rw,data=ordered)
/dev/hda1 on /system type ext3 (rw,data=ordered)
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
none on /proc/bus/usb type usbfs (rw)
devpts on /dev/pts type devpts (rw)
tmpfs on /var/tmp type tmpfs (rw)
[lxtc3861 - /etc/rcS.d #] mount -o remount,ro /dev/hda1
[lxtc3861 - /etc/rcS.d #] mount
/dev/root on / type ext3 (rw,data=ordered)
/dev/hda1 on /system type ext3 (rw,data=ordered)
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
none on /proc/bus/usb type usbfs (rw)
devpts on /dev/pts type devpts (rw)
tmpfs on /var/tmp type tmpfs (ro)
[lxtc3861 - /etc/rcS.d #]

It only works, if I give both parameters, device and mountpoint.

>> When only using `mount /system` or `umount /system` it works, but
>> in combination with "-o remount" the problems arise.
> 
> This is the 1.1.1 release?

It's the daily snapshot from monday, to get rid of my procps issue I
also posted here.
But I'll try immediately with the 1.1.1 release from here:
http://busybox.net/downloads/busybox-1.1.1.tar.bz2

So, BTDT. The result is the same as above with the latest daily
snapshot. It only works when it gets both parameters.

> For remount, it's using that as an arbitry identifier name.  Notice that you 
> can "remount -o remount,rw harvey-the-wonder-hamster /", and that you can do 
> that with the current mount command, not just mine. :)

Ah, cool, I didn't know that -> quite funny.

Sorry again for bringing in some trouble with this thread, as I forgot
to CC some items immediately to the list :-/

ciao,
- --
Alexander Griesser (Netzwerkadministration)
E-Mail: alexander.griesser at lkh-vil.or.at | Web: http://www.lkh-vil.or.at
KABEG LKH Villach | Nikolaigasse 43 | 9500 Villach
Tel.:   +43 4242 208 3061 | Fax.:   +43 4242 971 3061
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.2 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFEKjkV66HVD6KUm1oRAosDAJ9zKVn0TT/XlY2H/bmBOKCXCn6k2ACdHfci
QSb0LhZ6geK5V3Lrh/IBTWI=
=flHp
-----END PGP SIGNATURE-----


More information about the busybox mailing list