View Full Version : Editing Read Only files
ronlkh
17th September, 2008, 07:32 AM
Hi All,
I have followed the instruction of devilfish on the forum, I have got the image done but when I try this command as devilfish instruction:
Code:
cd /tmp && eraseall /dev/mtd/5 && cp mtd5.img /dev/mtd/5 && reboot
Done.
The box erase well but did not seem to flash the new image, Can anyone please let me know what have I done wrong?
Thanks
satman
17th September, 2008, 10:42 AM
Hi All,
I have followed the instruction of devilfish on the forum, I have got the image done but when I try this command as devilfish instruction:
Code:
cd /tmp && eraseall /dev/mtd/5 && cp mtd5.img /dev/mtd/5 && reboot
Done.
The box erase well but did not seem to flash the new image, Can anyone please let me know what have I done wrong?
Thanks
are you sure your mtd5.img is squashfs properlly?,
and have you tried dd command to write the .img to the /dev?
ronlkh
17th September, 2008, 11:31 AM
This is what I followed :-
Code:
mkdir /var/tmp/root
Code:
mount -t squashfs -o ro /dev/mtdblock/5 /var/tmp/root
Code:
cd /var/tmp
Code:
tar -cf root.tar root
FTP the root.tar to your linux desktop and open a terminal.
Code:
cd Desktop
Code:
tar -xf root.tar
Leave the terminal window open.
Treat the root folder on the desktop as the box itself but don't add or do anything to /var or /var_init because that's still on the box.
When you have finished go back to the terminal window and...
Code:
./mksquashfs root mtd5.img -be
Then ftp the mtd5.img back to the box. You will need a copy of mksquashfs on the Desktop to be able to perform this command.
Telnet back to the box and...
Code:
cd /tmp && eraseall /dev/mtd/5 && cp mtd5.img /dev/mtd/5 && reboot
Done.
To check what mtd# ...
Code:
more /proc/mtd
...but most squashfs are mtd5.
<--ronlkh added 24 Minutes and 42 Seconds later...-->
By the way I am using fedora 9 on VMware.Should I use debian or ubuntu?
Thanks
satman
18th September, 2008, 05:00 PM
Yes, i know, i can see the tutorial you followed.
So you managed to follow that right to the end and the mtd doesnt write?
instead of cp mtd5,img > /dev/mtd5
try a dd if=mtd5.img of=/dev/mtd5,
another way is just slightly different from the tutorial would be to mount the root onto a hard drive or mount point as a loop device, read/write, and then dd backup, and then restore it over the current one with the dd restore.
but both methods should work fine.
ronlkh
18th September, 2008, 05:24 PM
i think the image made from mksquash dont work. I am not sure if it flashes the box or not but when it reboot, it got blue screen only. I tried many ways. I copy the root to my ubuntu and mksquashfs it and straight away ftp back to dm500 and flash the image back to dm500 and it also faill even i did not do any modification.
how can I use the dd command? if the image is in the /tmp, should I just type dd if=mtd5.img of=/dev/mtd/5
??
Thanks
Thanks
<--ronlkh added 17 Minutes and 34 Seconds later...-->
Hi satman,
When I tried using your recommended dd command, it says no space left on device
Powered by vBulletin® Version 4.2.5 Copyright © 2025 vBulletin Solutions Inc. All rights reserved.