Using setup_sdcard.sh script from prebuilt images resulting in readonly fs

Hello all.
I have been searching this for a while and could not find any hints.
I am trying to use the image provided here: https://rcn-ee.net/deb/rootfs/wheezy/debian-7.7-console-armhf-2014-10-29.tar.xz to create a sdcard for beaglebone black. I do not want to transfer the sdcard’s content to the embedded memory, i want to use the image from the sdcard it self. I can boot to it, but i keep getting read only fs, so i cannot mount or change at all the fs.
I managed RW to boot it from u-boot by interrupting the countdown and issuing the boot command. This way, I can boot to the sdcard while getting a read-write FS.
I don’t understand how the two differs nor how interrupting the countdown changes anything from booting directly.

Any help is appreciated.
Thanks!
Paulo Sherring.

What parameters are you passing to 'setup_sdcard.sh' ?

Regards,

Hello there!

I am issuing sudo ./setup_sdcard.sh --mmc /dev/mmcblk0 --uboot bone --dtb beaglebone

Did i get it wrong?
Thanks!

Oh "--dtb xyz" replaced "--boot xyz"... No idea what would happen if
you add them both together..

Regards,

So, what arguments should I issue to achieve a fully functional rw file system? Should I go only with – boot?
Thanks again!

It should work out of the box with:

sudo ./setup_sdcard.sh --mmc /dev/mmcblk0 --dtb beaglebone

Regards,

I just tried this, no luck. I am on Debian, should it be a problem?

Curiously, I am able to copy and paste to the mounted FS on my develpment machine, live on beaglebone, but cant change anything neither over SSH nor over serial terminal.

Any thoughts?

Thanks again!

BTW, which version of Debian... There is issues with Jessie/Sid where
i had to do a few work-a-rounds in the script to make it reliable.

If it is Jessie/Sid, the quick fix, is just meld against this dir:
https://github.com/RobertCNelson/omap-image-builder/tree/master/tools

The setup_sdcard.sh script and hwpack's is pretty forward compatible.

Can you please pastebin.com the terminal log output from
"setup_sdcard.sh" and your serial bootlog from power on.

Regards,

I am on wheezy 7.7, so I suppose no workaround is needed.

Follows pastebin
setup_sdcard.sh output
serial console output
dmesg output

I noticed on dmesg that the kernel boot args includes a ro
" Kernel command line: console=ttyO0,115200n8 root=UUID=497d0971-9902-43ef-ae44-bdc274b6c40c ro rootfstype=ext4 rootwait fixrtc quiet"

I don’t know if this is the reason for this unwanted behavior.

Thanks again!
Paulo Sherring.

I am on wheezy 7.7, so I suppose no workaround is needed.
Follows pastebin
setup_sdcard.sh output
serial console output
dmesg output

Thanks reviewing right now..

I noticed on dmesg that the kernel boot args includes a ro
" Kernel command line: console=ttyO0,115200n8
root=UUID=497d0971-9902-43ef-ae44-bdc274b6c40c ro rootfstype=ext4 rootwait
fixrtc quiet"
I don't know if this is the reason for this unwanted behavior.

'ro' is needed for fsck to run on bootup (when needed), the system
will switch to "rw" when it's happy with the rootfs.

Regards,

Well:

[ 107.406982] JBD2: Spotted dirty metadata buffer (dev = mmcblk0p1,
blocknr = 747). There's a risk of filesystem corruption in case of
system crash.
[ 107.935165] JBD2: Spotted dirty metadata buffer (dev = mmcblk0p1,
blocknr = 495). There's a risk of filesystem corruption in case of
system crash.
[ 107.935212] JBD2: Spotted dirty metadata buffer (dev = mmcblk0p1,
blocknr = 1). There's a risk of filesystem corruption in case of
system crash.
[ 107.935271] EXT4-fs error (device mmcblk0p1): __ext4_new_inode:983:
comm sed: failed to insert inode 1613: doubly allocated?
[ 107.971541] Aborting journal on device mmcblk0p1-8.
[ 107.990492] EXT4-fs (mmcblk0p1): Remounting filesystem read-only
[ 108.001162] EXT4-fs error (device mmcblk0p1): ext4_journal_check_start:56:
[ 108.016033] EXT4-fs error (device mmcblk0p1) in ext4_create:2259: IO failure
[ 108.029254] Detected aborted journal
[ 439.446492] SysRq : Emergency Remount R/O
[ 439.454698] Emergency Remount complete

It looks like your microSD card is toast...

Regards,

^^ this is where the system gave up and just mounted your drive as
'ro' to atleast give you access..

Regards,

Well, that is another sdcard, again and again (and again). That is just sad. Is there a tool for me to test an sdcard integrity, since i don’t have yet skills to parse linux output?

Thanks!

Paulo Sherring.

Humm.. If it's happening with multiple sdcard's, i'd also double check
with a spare usb-microSD adapter..

Or try the dd method:

Grab the *.img from here:

http://elinux.org/BeagleBoardDebian#BeagleBone.2FBeagleBone_Black

and:

unxz bone-debian-7.7-console-armhf-2014-10-29-2gb.img.xz
sudo dd if=./bone-debian-7.7-console-armhf-2014-10-29-2gb.img of=/dev/sdX

where /dev/sdX is your device your flashing...

Regards,

I just tested with two micro sdcards, that are not very used, i bought them a few months ago, and three micro sd readers ( one builtin, 2 usb). All three of them resulted in the same error. Depending on the device used, i was /dev/sdb or /dev/mmcblk0.

dd’ing the image to the card worked just fine but it has the anoying issue that it takes too long to burn the card (about 5 times longer, maybe?).

Thanks!

What brand.
What class.
Have you tried to format and test them on another system ?

One is from adata, another from Kingston and other from multilaser, a Brazilian brand, likely a generic one rebranded. All class 4.
Just tried on an Ubuntu 14.04 machine, same results: dd’ing did fine, setup_sdcard.sh.
Thanks!
Paulo Sherri

I don't remember all the changes i've made to setup_sdcard.sh.. but
here's a very fresh image:

https://rcn-ee.net/rootfs/2015-01-06/debian-7.7-console-armhf-2015-01-06.tar.xz

Wondering if it will randomly fix it..

Regards,

The new image worked! Thank you both for the great help!
Paulo Sherring.