Off-Topic > Off-Topic - Tiny Tux's Corner
problem mounting tmpfs
tinypoodle:
--- Quote from: curaga on January 06, 2011, 09:59:25 AM ---formatting takes time
--- End quote ---
plus space (in case of ramdisk translated into RAM usage)
curaga:
--- Quote from: wysiwyg on January 06, 2011, 02:21:48 PM ---Is it possible to just patch the kernel so there's no need to do a swap? This can save some time. If the 'embed' bootcode skips it, wouldn't some binaries using that system still mess up (e.g. df)?
--- End quote ---
I think you mixed the terms there, by swap-ability I meant the ability for data not recently accessed in the tmpfs to go to swap, leaving more free ram.
Yes, with an "embed" boot the root fs will not show in df. But it's a tradeoff between that and some boot speed, so it's left to the user's discretion.
wysiwyg:
--- Quote from: curaga on January 07, 2011, 03:34:23 AM ---
--- Quote from: wysiwyg on January 06, 2011, 02:21:48 PM ---Is it possible to just patch the kernel so there's no need to do a swap? This can save some time. If the 'embed' bootcode skips it, wouldn't some binaries using that system still mess up (e.g. df)?
--- End quote ---
I think you mixed the terms there, by swap-ability I meant the ability for data not recently accessed in the tmpfs to go to swap, leaving more free ram.
Yes, with an "embed" boot the root fs will not show in df. But it's a tradeoff between that and some boot speed, so it's left to the user's discretion.
--- End quote ---
Yeah, I did misunderstand apparently. :)
I ended up adding the switch_root code to my own project (as shown below) so that binaries such as df would work properly. After looking at the output, I realized something must be wrong. This is what my information looks like:
Output from df:
FS Size Used Avail Use Mounted
tmpfs 2769380 0 2769380 0% /mnt/switch_root
mdev 1538544 0 1538544 0% /dev/shm
Output from mount
rootfs on / type rootfs (...)
tmpfs on /mnt/switch_root type tmpfs (...)
mdev on /dev type tmpfs (...)
...
Then I booted into TC to see what there's was showing and this is what the result is:
Output from df:
FS Size Used Avail Use Mounted
tmpfs 2.6G 16.9M 2.6G 1% /
tmpfs 1.5G 0 1.5G 0% /dev/shm
Output from mount
rootfs on / type rootfs (...)
tmpfs on / type tmpfs (...)
proc on /proc type proc (...)
...
Couple of questions....
1) Why does the rootfs still show in both OS's? Once you switch_root, shouldn't the initial ramdisk be destroyed?
2) Why does mine read as /mnt/switch_root (which is the directory everything should be moved into using the switch_root call as found in the TC /init script) instead of just / ?
3) Why are all of the mounts not shown in the df output?
Dave
UPDATE:
Apparently I wasn't using switch_root right and as a result the filesystem created to switch_root to wasn't being switch_root'ed to so it just showed up as an additional mounted filesystem. I've since corrected the issue and now my "output from mount" shows the same as TC. But my question still remains... shouldn't that have gone away once the switch_root took place?
tinypoodle:
You have been told many times (in other very similar threads) to read basic documentation about filesystems involved, which it appears you eiter failed to do or understand, so you go on asking questions based on imaginary scenarios without corresponding to facts.
1) if there is no ramdisk involved, there is none to be quote:"destroyed"
3) because you obviously did not mount the file systems
wysiwyg:
--- Quote from: tinypoodle on January 07, 2011, 02:40:25 PM ---You have been told many times (in other very similar threads) to read basic documentation about filesystems involved, which it appears you eiter failed to do or understand, so you go on asking questions based on imaginary scenarios without corresponding to facts.
1) if there is no ramdisk involved, there is none to be quote:"destroyed"
3) because you obviously did not mount the file systems
--- End quote ---
I actually did read the documentation you provided in the other post, thanks for that. I did, however, ask you to please specify a link to more information after my search failed, which you failed to do. Without additional insight, I kept referring to it as I understand it. Finally, there is no need for attitude. It's very obvious I'm learning here, so patience is required. ...as the old saying goes, if you don't have anything nice to say, don't say anything at all. :)
Referring to the "destroyed" part, I was curious as to why both systems would still show the rootfs. To my understanding, once switch_root is executed, the initial "filesystem" (since we don't want another bad post :) should be destroyed, freeing resources. If that is correct, why is that not happening?
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version