cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Visitor
Visitor
2,252 Views
Registered: ‎10-18-2013

Persistent modifications to ramdisk

Hello,

 

is ti possible to make it so that modification done to the filesystem are persistent between reboots?

I'll be clearer: I am using Linux on the Zedboard, and I have to manually mount the SD card at each boot to access my files. I tried to modify the fstab to have it mounted automatically, but the modification is lost upon rebooting.

I am quite sure it used to work with some earlier releases, but somewhere along the way it stopped working.

 

Is it an option of the ramdisk?

 

Thanks,

 

Michele

0 Kudos
Reply
3 Replies
Xilinx Employee
Xilinx Employee
2,244 Views
Registered: ‎09-10-2008

Hi Michelle,

 

Changes to the filesystem won't ever be saved when running a ramdisk (that I know of anyway) as you are not changing the real ramdisk source.  When linux is running the ramdisk has been loaded into ram and is not ever saved back to the medium from which it was loaded.

 

You don't say much about the source of the ramdisk or the kind of ramdisk (initrd, cpio, etc...).  The principles are the same as  you could mount the ramdisk on a host machine, or probably even on a zynq platform (but a bit trickier maybe), alter the ramdisk file system (the fstab or the init scripts) to mount the sd card. The unmount it and rezip it up assuming it's zipped. These fundamentals are well covered in "Building Embedded Linux Systems" which I recommend if you have not used it.

 

Thanks,

John

0 Kudos
Reply
Newbie
Newbie
553 Views
Registered: ‎05-15-2018

Hmm this question is quite old...

 

But isn't it possible to copy back the ramdisk by using dd? Maybe when the system shuts down and all modifications to the filesystem are done, a script could execute, that saves the changes.

 

I tried do identify the ramdisk-device. findmnt tells me, that the source is rootfs, but dd with if=rootfs doesn't work. /etc/fstab tells me, that the device is /dev/root, but this doesn't even exist. Writing to the SD-Card using dd is possible.

EDIT: This was for the matlab-linux. When I use the Xilinx-image from http://www.wiki.xilinx.com/Build+and+Modify+a+Rootfs, findmnt isn't installed and /etc/fstab contains no entry for /. Strange...

 

It is verry annoing, if changes can only be stored by extracting and mounting the ramdisk on a foreign system. Isn't there a trick?

0 Kudos
Reply
543 Views
Registered: ‎04-20-2017

Alternatively you can install a startup script with petalinux, where you can do all things, like mounting, copying when system is booting.
I use it for example to load libraries from SD card to ramdisc when zed board is booting

The proper way of editing the rootfs is using petalinux-create, and place apps / files into rootfs while it's created
0 Kudos
Reply