Arduino Yun - storage management

I have a 16GB microSD card installed in my Yun (overkill, yes, but the 16GB one was about 40 cents more than the 2GB one, so how can you pass that up?).

I installed the microSD card a few weeks ago using the YunDiskSpaceExpander sketch, as described at ExpandingYunDiskSpace. However, it appears that either I screwed that up, or something went wrong, because my storage currently looks like this after installing a bunch of python packages:

root@Arduino:/dev# df -h / /mnt/sda1
Filesystem                Size      Used Available Use% Mounted on
rootfs                    6.9M      6.8M    192.0K  97% /
/dev/sda1                 7.8G     24.8M      7.8G   0% /mnt/sda1

I'm pretty sure that I split the 16GB card in half when I formatted it, rootfs should be 8GB and /dev/sda1 should be 8GB. However, it seems that rootfs has reverted back to being a tiny 6.9MB. I don't know where the other 8GB of the microSD card went.

I tried running the YunDiskSpaceExpander sketch again, but it hangs on "Starting Bridge...". Besides, I can see in the code that it won't run if rootfs doesn't have at least 1MB free.

What's the best way to proceed from here? I'd prefer to not have to reinstall all of those packages, but I suppose I can if I have to. I definitely don't want to brick the Yun by filling up rootfs to 100%.

Thanks!

What is your goal? FWIW: in most cases, you are better off reinstalling from scratch.

Jesse

Sorry to be unclear. My goals are:

  • To get all 16GB of the microSD card to be available.
  • To get more storage space to be available on rootfs, so that it's not so close to 100%.

Starting over from scratch would suck, but if starting over from scratch is the best path forward, is there a recommended procedure for that documented somewhere?

Just to be sure, did you have the SD card inserted the whole time when you booted the system? This listing you show could happen if you inserted the card after booting.

The documentation isn't clear on it, but once you expand the root disk space onto the SD card, you must have the card in the Yun before you start to boot, and you must keep it in the whole time you are running. Yes, the Yun can handle hot-swapping of an SD card in most situations, mounting and un mounting it automatically as needed - but my experience says that isn't true once you've expanded the root file system using an SD card.

You have two issues to deal with to rebuild the SD card: not enough space on the root partition, and an existing root overlay setting. To re-do the expansion process, you will have to free up some space, probably by uninstalling some packages. You will also have to go into the file system tables and manually edit out the existing root expansion entries. Even if you do that, the SD card will be totally reformatted as part of the expansion process, and you will lose everything on the existing expanded root partition and on the data partition..

Since any effort to preserve existing work will only end up saving a little bit of the data on the internal root file system (which is probably stuff you intended to be on the expanded partition anyway, and shouldn't be in the internal file system in the first place) the simplest and safest solution is to start from scratch.

Let the Yun boot up fully. Then press and hold the WiFi RST button for more than 30 seconds. When you release it, the Yun will return to the original factory settings, which can take a while. Give it time to reset and fully boot again. Then set up your Yun's name, password, and networking settings. Finally, put in your SD card, run the disk expander, and then never remove the SD card again while the Yun is running - only pull it out when the power is off.

@snottywong,

Shapeshifter presented some good points. Your biggest issue, which you may not be aware of, which Shapeshifter alluded to is - YOU cannot use the original storage space on the Yun. Once you use the SD storage, you lose the original storage on the Yun. I found this out the hardway. The problem is the documentation suffers by not including these details.

On your setup, you will always need a rootfs, but you can make it smaller or larger - at your choice.

The other partition does not need to be so large. It is a NTFS (windows). I don't use windows. So one day - when I need more space - I will convert that NTFS partition to something I can use.

So, you can start over and repartition to your needs or you can leave it alone.

Let us know, if this helps. Jesse

I am a VERY newbie to Arduino - just started last Saturday evening; however, I have stepper motor and brushless ESC projects working -

I am not moving to my Yun - this was helpful; however, I have to ask how/where do I enter the SSID password , etc. on my WiFi network??

I a, trying to figure out the OPKG Package Manager for OpenWRT

I see the micro SD card is on the Ethernet/WiFi Linex side of the board design -

Am I to understand that I might be able to use my Micro SD adapter and put files on the NT / FAT formatted microSD card that might be scripts or HTML code that then could be 'Served' out???

I am really trying to get comfortable with the Atmel ATmega32U4 side of the Yun board

and I am assuming that the the calls Bridge, YunServer, and YunClient libraries allow 'real-time' data to be served out and queried, etc....

Just wish there were some good examples, etc....

Thank you

Beckmann, you have several questions, all of which are not at all related to the discussion in this thread. I would suggest that you start a new thread to ask these questions, or better yet a few new threads, each of which is asking a different question or group of related questions. You will get better answers that way, and you won't be taking this discussion off track.

Your questions seem to be very basic "getting started" type of questions: have you studied these pages?

These videos may also be helpful:

Thanks much for the advice. If I don't need to install any more libraries, I might just leave it as-is. I have a feeling I'll need more libraries though, so I'll probably have to reformat the whole thing. To my knowledge, I never removed the SD card after I reformatted it.

Resetting the Yun to factory defaults isn't so bad, the worst part is that I need to remember all of the steps that I took to get to this point: enabling SSL, installing a bunch of python libraries, tweaking some file to allow for serial communication to the arduino sketch, etc. I'll just need to track down all of those instructions again and hope that I don't miss any.

Anyway, thanks again, it's a big help. I added some karma for both of you, not even sure what that is but it sounds good!

Cheers

Yes, remembering all the steps to get where you are now is always the hard part. I understand your hesitation.

Adding karma is just a lasting way of saying thanks. Thanks!