View Single Post
Posts: 842 | Thanked: 1,197 times | Joined on May 2010
#77
Ok, great.
Now, just so you know, how my script finds image files to list at that menu is it literally runs(for mydocs):
Code:
find /home/user/MyDocs -name "*.img"
Then formats the resulting list. This means it *should* find -any- .img files on the whole partition.

Edit:
As I promised I was going to do:
A user sent me a copy of his RootFS and OptFS backups so that I could test them on my N900, see if the whole system works.
I have named them "other20100729-backup-rootfs.img" and "other20100729-backup-optfs.img".
I have backed up my own OS and files, and will (attempt to) restore them later.

1. I copied both of these files to my N900's MyDocs partition.
2. I rebooted into BackupMenu, version 0.33(0.32 + a minor bugfix I added today).
3. I pressed R for restore, T for both RootFS and OptFS, P for the eMMC.
4. I was asked to select the RootFS image, and I pressed F for the "other....rootfs.img", Same for the OptFS, and I pressed E for the "other....optfs.img".
5. I was asked "are you sure?", with the full location/path to each file shown. The files selected were correct, so I pressed P to proceed.
6. The process started, restoring RootFS first. I'm getting 3-4MB/sec usually.
7.Process finished, attempted to checksum - but no output. Bug in the checksum code I guess. I'll have to figure it out later.
8. I pressed a key to continue, and it started restoring OptFS.
9. Process continued with around 4mb/sec overall, occasionally dropping down to 2 and 1.
10. Um... Some time during this whole process, it started saying "0mb copied, 0% complete" and hanging there. I had to reboot it by removing the battery.
11. With the screen closed, I rebooted it. I got the nokia logo, it hung there for a minute or two, then shut off. Same with the keyboard open.
12. I opened my flasher directory and ran "sudo ./flasher-3.5 -r ../Backups/other20100729-backup-rootfs.img -f" from the console.
It started to flash, then I got "usb_bulk_write: resource temporarily unavailable. - Looks like I'm gonna need to flash PR1.2 first.
13. I flashed PR1.2, then with the USB still plugged in, ran the above command. This time, it flashed entirely. I did get:
Code:
Finishing flashing... Sending request 0x52 failed!

Bootloader error log follows:
  ERROR: Error reading spare of block 1847, page 0
  ERROR: Error reading block 51, page 0
  ERROR: Error reading block 52, page 0
  ERROR: Error reading block 53, page 0
  ERROR: Error reading block 54, page 0
  ERROR: Error reading block 55, page 0
  ERROR: Error reading block 56, page 0
  ERROR: Error reading block 57, page 0
  ERROR: Error reading block 58, page 0
  ERROR: Error reading block 59, page 0
  ERROR: Error reading block 60, page 0
  ERROR: Error reading block 61, page 0
  ERROR: Error reading block 62, page 0
  ERROR: Error reading block 63, page 0
  ERROR: Error reading block 64, page 0
  ERROR: Error reading block 65, page 0
  ERROR: Error reading block 66, page 0
  ERROR: Error reading block 68, page 0
  ERROR: Error reading block 69, page 0
  ERROR: Error reading block 70, page 0
  ERROR: Error reading block 71, page 0
  ERROR: Error reading block 72, page 0
  ERROR: Error reading block 73, page 0
  ERROR: Error reading block 74, page 0
  ERROR: Error reading block 75, page 0
  ERROR: Error reading block 76, page 0
  ERROR: Error reading block 77, page 0
  ERROR: Error reading block 78, page 0
  ERROR: Error reading block 79, page 0
  ERROR: Error reading block 80, page 0
  ERROR: Error reading block 81, page 0
  ERROR: Error reading block 82, page 0
  ERROR: Error reading block 85, page 0
  ERROR: Error reading block 86, page 0
  ERROR: Error reading block 87, page 0
  ERROR: Error reading block 91, page 0
  ERROR: Error reading block 92, page 0
  ERROR: Error reading block 93, page 0
  ERROR: Error reading block 94, page 0
  ERROR: Error reading block 95, page 0
  ERROR: Error reading block 96, page 0
  ERROR: Error reading block 97, page 0
  ERROR: Error reading block 98, page 0
  ERROR: Error reading block 99, page 0
  ERROR: Error reading block 100, page 0
  ERROR: Error reading block 101, page 0
  ERROR: Error reading block 102, page 0
  ERROR: Error reading block 103, page 0
  ERROR: Error reading block 104, page 0
  ERROR: Error reading block 105, page 0
  ERROR: Error reading block 106, page 0
  ERROR: Error reading block 107, page 0
  ERROR: Error reading block 108, page 0
Invalid error string data!
But this may still be OK - I'm pretty sure I have at least one bad block on my RootFS.
14. I opened my keyboard, unplugged the USB cable
15. The device rebooted into BackupMenu 0.31!
16. I restored optFS -only- this time, and it finished restoring - It didn't take long enough though, I don't think.
17. I got a checksum of the Backup file, but not of the OptFS itself, so I can't see if they really match or not.
18. Rebooted with the keyboard closed, got nokia screen > blank > reboot loop.
19 Trying to flash the OptFS again. Again, it only got to like 500mb before saying done. why? Only thing I can think of are bad blocks in the OptFS, and DD erroring out.
20. Connected to N900 vis the "read-only usb mass storage device" mode of BackupMenu. All partitions on the eMMC showed up to fdisk -l, and I ran cksum on both my backup file and the optFS partition:
612834623 2147483648 other20100729-backup-optfs.img
2389094843 2147483648 /dev/sdd2
On the one hand, this shows that the checksums are different. On the other, it shows that the -sizes- are the same, so it should have worked.

21. Now I'm going to try the previous steps with my own backup, see if its the method, or if it was a damaged file I got.
22. Flashing PR1.2, then my own rootfs.img. Both completed, and I got:
Code:
Bootloader error log follows:
  ERROR: Invalid argument for 'cmt'
  ERROR: Error processing request, stalling
  ERROR: EP0 STALL sent
  ERROR: Error reading spare of block 1847, page 0
  ERROR: Out of space: image size 263454720, partition blocks 2010, bad blocks 1
  ERROR: Error processing request, stalling
  ERROR: EP0 STALL sent
  ERROR: Premature end of control transfer
when flashing my own image(this is what makes me think I have a bad block).
23. Opened keyboard, loaded BackupMenu(ver 0.33 this time).
24. restoring Optfs. I am getting 4mb/sec average. It went over 2024mb, and I think it finished successfully. Cksum of OptFS... blank. I think there's a glitch.
25. Checksum of Backup... Nothing. Yup, some sort of glitch.
26. Rebooted. I got the 5 loading dots, then it shut off. Rebooted, got the 5 loading dots... then it booted fully! I'm guessing it shut off before after FSCKing the optfs, but I dunno.
27. Everything seems to be back where it was before - even the book position in FBreader. This is good.

This means that:
1. Potentially, current backups may be more or less tied to the N900 they were made on - due to bad block locations and such.
2. The foolproof method I talked about in the first post -seems- to work.
3. I have bugs in the checksum code, and I think that I'm gonna change the method of backup/restoring the OptFS to solve this problem.
I think instead of unmounting the OptFS and copying it byte-for-byte, I think I'll mount it and copy all the files instead using tar.
For restoring it, then, I will format the partition(it is EXT3 after all, no big deal), then restore the files.
Unless you have every byte filled in your 2GB partition, this should mean that badblocks will be rerouted by the eMMC and or the EXT3 FS.
This will mean however that backups made in the next version won't be compatible with older versions(Edit: without mounting the image, copying the files out, adding them to a .tar file, and importing them. It would work, but would require a Linux, and or possibly an OSX box. I doubt you could do it on Windows, at least without Cygwin).

Last edited by RobbieThe1st; 2010-08-07 at 11:22.
 

The Following User Says Thank You to RobbieThe1st For This Useful Post: