All Forums
 Embedded Linux
 Linux FAQ
 How do I make permanent changes to the ramdisk?
 Forum Locked
 Send Topic to a Friend
 Printer Friendly
Author Topic  

jlackey

213 Posts

Posted - 08 May 2002 :  14:22:17  Show Profile  Email Poster
Q: How do I make permanent changes to a ramdisk?

If your board uses a ramdisk root file system, the ramdisk is loaded from a compressed image file (ramdisk.gz) when the board boots. Changes that you make to the root file system while the board is running will be lost the next time you boot. To make permanent changes, you need to modify the ramdisk.gz image file.

To modify a ramdisk.gz image file, issue these commands on your Linux development PC:
gunzip ramdisk.gz
mkdir /mnt/loop
mount -o loop ramdisk /mnt/loop

Now make your changes. For example, to add mynewfile to /etc on the ramdisk, copy the file to the /mnt/loop/etc/ directory:
cp mynewfile /mnt/loop/etc/

When you are done, issue these commands:
umount /mnt/loop
gzip ramdisk

To replace the ramdisk.gz image file in on-board flash with the one you just modified, follow the instructions provided in the bootloader document for your board.

30-Dec-2003: jlackey - update information related to the root file system
18-Jun-2002: Knowledgebase - clarify that the steps are performed on a development PC
  Topic  
 Forum Locked
 Send Topic to a Friend
 Printer Friendly
Jump To:
Eurotech Support Forums © Eurotech Inc. Go To Top Of Page
This page was generated in 0.02 seconds. Snitz Forums 2000