Go Down

Topic: How to expand the storage memory on the Yún (Read 36337 times) previous topic - next topic

raylaw

Actually , I bought 2 same SD cards , both of them can not pass the step too.

They run perfectly fine on mac and window, showing that it has around 8 GB free space.

However , when I test it on Arduino UNO with Ethernet shield, running the CardInfo example, I got strange  result :

Volume type is FAT32

Volume size (bytes): 3654471680
Volume size (Kbytes): 3568820
Volume size (Mbytes): 3485

Files found on the card (name, date and size in bytes):

It shows only around 4GB space.

Does it mean Arduino has some max limitation on the SD volume ?
or Class 10 card , or Kingston brand card does not work on Arduino ?


raylaw

Is it the matter of using a Micro SDHC card rather than Micro SD card ?
Have anyone use the Mirco SDHC card can pass the step ?

federicofissore

AFAIK, SDHC are supported http://forum.arduino.cc/index.php?topic=214467.0

NewLine

When the file-system is moved to the SD card (pivot root using:

Code: [Select]
config mount
        option target        /
        option device        /dev/sda1
        option fstype        ext4
        option options       rw,sync
        option enabled       1
        option enabled_fsck  0


is there a way to access the filesystem that is still on the flash, without removal of the SD card?
E.g. how can I access the /etc/config/fstab file on the Yun flash?

infotorpk

hi ,
          when the running the script , i got the following error.

"err formatting fat32"

Please  help me to resolve this issue.Size of the micro sd card is 8GB



sonnyyu


...
is there a way to access the filesystem that is still on the flash, without removal of the SD card?
E.g. how can I access the /etc/config/fstab file on the Yun flash?


Power off Yun , take out SD card. power on Yun again to access flash.

sonnyyu


hi ,
          when the running the script , i got the following error.
"err formatting fat32"
Please  help me to resolve this issue.Size of the micro sd card is 8GB


take out SD card, put it into Windows machine to test format.

or

at Yun

Code: [Select]
fdisk /dev/sda
mkdosfs -F 32 /dev/sda1



partition and format SD card.

Alomamabobo


ShapeShifter

#38
Oct 31, 2014, 04:49 pm Last Edit: Oct 31, 2014, 05:10 pm by ShapeShifter
Is there a way to access the filesystem that is still on the flash, without removal of the SD card?
E.g. how can I access the /etc/config/fstab file on the Yun flash?
I found this tip on accessing the original flash drive while booted up on the external root: http://wiki.openwrt.org/doc/howto/extroot#accessing.original.root

Basically, you boot up under the expanded drive, and add this to the end of /etc/config/fstab:
Code: [Select]
config mount
option target /overlay-boot
option device /dev/mtdblock3
option fstype jffs2
option options rw,sync
option enabled 1
option enabled_fsck 0


Next time you boot up under the expanded drive, the original file system on internal flash will be available under /overlay-boot. So to get to the original file system's fstab, use /overlay-boot/etc/config/fstab

ShapeShifter

I just tried this last night. First, I downloaded the 1.5.2 firmware image, and reflashed the Yun using the web interface.

Then I loaded the sketch and ran it, and it seemed to be successful. I used an 8GB card, and allocated 6GB (6144MB) to the data partition. This is what I get when I run df:

Code: [Select]

root@Yun:/# df
Filesystem           1K-blocks      Used Available Use% Mounted on
rootfs                24806184    500740  23061720   2% /
/dev/root                 7680      7680         0 100% /rom
tmpfs                    30560       100     30460   0% /tmp
tmpfs                      512         0       512   0% /dev
/dev/sda2             24806184    500740  23061720   2% /overlay
overlayfs:/overlay    24806184    50074  236172   2%/
/dev/sda1              6279168        12   6279156   0% /mnt/sda1
root@Yun:/#


sda1 is 6GB, as expected, but the rootfs is 24 GB? On an 8GB card? It should be 2 GB with about 25% used.

If I plug the SD card into my Windows laptop, it says that it is not formatted. If I look at it using a partition manager, it shows the first partition is a 6GB FAT32 partition (as expected) and the second is a 23.7 GB Linux Ext4 partition.

Why is the first partition not accessible on my laptop?

Why is the second partition so huge?

This is the sketch output when I run it with "DEBUG 1" defined:
Code: [Select]

This sketch will format your micro SD card and use it as additional disk space for your Arduino Yun.
Please ensure you have ONLY your micro SD card plugged in: no pen drives, hard drives or whatever.
Do you wish to proceed (yes/no)? yes

Starting Bridge...

Ready to install utility software. Please ensure your Arduino Yun is connected to internet.
Ready to proceed (yes/no)? yes
Updating software list...
Software list updated. Installing software (this will take a while)...
e2fsprogs mkdosfs fdisk rsync installed

Proceed with partitioning micro SD card (yes/no)? yes
Enter the size of the data partition in MB: 6144
Partitioning (this will take a while)...

Command (m for help): Partition type:
   p   primary (0 primary, 0 extended, 4 free)
   e   extended
Select (default p): Partition number (1-4, default 1): First sector (2048-62333951, default 2048): Using default value 2048
Last sector, +sectors or +size{K,M,G} (2048-62333951, default 62333951): Partition 1 of type Linux and of size 6 GiB is set

Command (m for help): The partition table has been altered!

Calling ioctl() to re-read partition table.
Syncing disks.

Command (m for help): Partition type:
   p   primary (1 primary, 0 extended, 3 free)
   e   extended
Select (default p): Partition number (1-4, default 2): First sector (12584960-62333951, default 12584960): Using default value 12584960
Last sector, +sectors or +size{K,M,G} (12584960-62333951, default 62333951): Using default value 62333951
Partition 2 of type Linux and of size 23.7 GiB is set

Command (m for help): The partition table has been altered!

Calling ioctl() to re-read partition table.
Syncing disks.
mkfs.vfat 3.0.12 (29 Oct 2011)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
Stride=0 blocks, Stripe width=0 blocks
1556480 inodes, 6218624 blocks
310931 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=0
190 block groups
32768 blocks per group, 32768 fragments per group
8192 inodes per group
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
4096000

Allocating group tables:   0/190  <lengthy-count-sequence-snipped>  189/190       done                           
Writing inode tables:   0/190  <lengthy-count-sequence-snipped>  189/190       done                           
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information:   0/190  <lengthy-count-sequence-snipped>  189/190       done

Micro SD card correctly partitioned

Creating 'arduino' folder structure...
Copying files from Arduino Yun flash to micro SD card...
Enabling micro SD as additional disk space... enabled

We are done! Yeah! Now press the YUN RST button to apply the changes.


I snipped out a long string of counter updates that included lots of backspaces between each update. I also didn't include the messages from the subsequent boot (but I saved them if needed.)

federicofissore

The only reason I get for having such a huge second partition is a tricky sd card. AFAIK, size of the sd card is written onto the sd card itself by the manufacturer. So you can make a 8G sd card and set its size to 24G

As for not being able to see the first one on windows, I don't know. Can you try with another sd card? An older one is better. A super new sd card may be unsupported by linux

ShapeShifter

#41
Oct 31, 2014, 06:08 pm Last Edit: Oct 31, 2014, 06:09 pm by ShapeShifter
Oh my... well you can ignore the disk space part of the post. I got my cards confused, and it's actually a 32 GB card. And they play the marketing game where they say GB = 1,000,000 bytes instead of 1,048,576 bytes, so it's really about 30.5 GB. Take away 6GB for the data partition, and give up some overhead for formatting, and the reported size of the second partition sounds right.

So sorry for the confusion, it sure helps to actually look at the writing on the card! (I had it confused with some 8GB USB sticks I bought at the same time...) How embarrassing, I feel like such an idiot...  :-[

That still leaves the issue of not being accessible to Windows. The only other card I have at the moment is a 4GB card with some system critical data on it, and I'm hesitant to re-format it at the moment. But I will keep playing with it and see if I can figure anything out.

Thanks for the help, and sorry for the misleading information!

heggood

As for the C compiler, it is now available via opkg.

opkg update
opkg install binutils
opkg install make
opkg install tar
opkg install yun-gcc

I installed it on my yun expanded on an SD.

I was very impressed by it's performance.

while I was at it, I installed make, gvim-full, and bash.

I was a little disappointed not to find flex and bison (gnu versions of lex and yacc) as I use the frequently
in my development environments.

I added a user other than root as I learned the danger of working as root long ago.  If you unwittingly do
something like rm * in a directory that you don't think you're in it can be catastrophic!
 
Since I found no admin tool such as user add, I did it the old way:

   edit /etc/group and add      slh:x:200:

   edit /etc/passwd and add    slh:x:200:200:slh:/home/slh:/bin/bash   

   edit /etc/passwd and add    slh:x:200:200:slh:/home/slh:/bin/bash

   mkdir /home/slh

   chown slh:slh /home/slh

   passwd slh

I installed and configured sudo since there is no su command.  This enables me to do sudo bash to temporarly become root.

I hope I didn't overlook anything in my instructions.  Enjoy!
It's much easier to make working code elegant than make elegant code work!

noblepepper

Quote
As for the C compiler, it is now available via opkg.

opkg update
opkg install binutils
opkg install make
opkg install tar
opkg install yun-gcc

I installed it on my yun expanded on an SD.

I was very impressed by it's performance.
:-) I had to learn much more than expected about *@#$%! openwrt package/makefiles than I expected to get that put together and still can't put one together easily.

I am very pleased with the functionality of yun-gcc at this point. It seems to be able to compile anything the hardware supports if you are willing to find and fill all the dependencies.

rwaldron

Is there a limit to the sd-card's capacity? I can't get my Yun to recognize any sd-card that I have (they are all 32gb).


Go Up