Notices


Reply
Thread Tools
Posts: 2,152 | Thanked: 1,490 times | Joined on Jan 2006 @ Czech Republic
#291
Originally Posted by Milhouse View Post
Now seems a good time to document some new options I've added to the nupgrade.sh script.
I'd vote for additional feature in nupgrade script - backing up partition table. Or people should at least backup it by hand
Code:
dd if=/dev/mmcblk0 of=MyCardMBR.bin bs=512 count=1
When one screws up something or want to go back, it may be handy for restoring (Or use panasonic SD formatter).

Point is that it looks like both partition table and FAT layout is tuned to be aligned with physical flash blocks. By creating random partition table, speed (and maybe even reliability and durability) may go down.

See this article for details
http://www.hjreggel.net/cardspeed/cs_calign.html

So maybe, if nupgrade.sh does the partition layout, it would be nice if it left at least the beginning of first FAT partition alone.

It is hard to know how important it is, maybe not much. YMMV

When I got my 8GB SDHC card I found that first 4MB of the card is 'wasted' and partition begins on block 8192. This is confirmed in the document mentioned above. There is perhaps some reason for this. I think this may be related to erase blocks and grouping of blocks for internal wear level logic. Maybe they try to prevent wearing off the beginning of the card (as it may contain some critical low level data).
Thisis a bit of black magic. If you are interested, start reading from page 66 of http://www.sdcard.org/about/memory_c...Layer_Spec.pdf
Looks like the size of Allocation Unit (AU) is 4MB for big cards. so it may make sense to aling beginning of partition at 4MB and data blocks after FAT table at 8MB.
__________________
Newbies click here before posting. Thanks.

If you really need to PM me with troubleshooting question please consider posting it to the forum instead. It is OK to PM me a link to such post then. Thank you.
 

The Following User Says Thank You to fanoush For This Useful Post:
Posts: 4,030 | Thanked: 1,633 times | Joined on Jul 2007 @ nd usa
#292
Originally Posted by Milhouse View Post
Now seems a good time to document some new options I've added to the nupgrade.sh script.

The full usage is:

Code:
nupgrade.sh 0-6|wipe|clone [internal | external] [ext2 | ext3] [sardine | herring] [yes]
where:
  • 0-6: Individual steps as described at the beginning of this thread
  • wipe: shorthand for all steps 0-4 - use only if you know you have a properly setup device. Will format the target partiion (see below)
  • clone: shorthand for all steps 1-4 - use only if you know you have a properly setup device. Will NOT format the target partiion (see below)

  • internal: Manually select the internal memory card as the target (default is to select automatically - see below)
  • external: Manually select the external memory card as the target (default is to select automatically - see below)

  • ext2: Will format the target partition using ext2 filesystem (this is the default)
  • ext3: Will format the target partition using ext3 filesystem

  • sardine: Only relevant for steps 5 and 6. Sardine is the default. Upgrade your OS to the bleeding edge development version. Rarely works.
  • herring: Only relevant for steps 5 and 6. Upgrade your OS to the most stable development version available. Rarely works.

  • yes: Surpress target partition confirmation prompt - use with caution. Default is to prompt the user

eg. to reformat and clone the OS to the automatically determined target memory card without prompting use the following command:

Code:
./nupgrade.sh wipe yes
Or to force the reformat and clone the OS to the external card using the ext3 filesystem, without prompting, use the following command:

Code:
./nupgrade.sh wipe external ext3 yes
Target Selection
The target device and partition will be automatically detected by the script based on the available memory cards and partitions present on those cards.

You will be prompted to accept the automatically determined device/partition before the script proceeds to write or modify the target in any way, unless you pass the parameter "yes" in which case there will be no prompting (so use with caution!) The default response to the prompt is "yes", and you can just press return to continue, or enter "no" or ctrl-c to abort.

The script will first check the "internal" memory card (if present) for a second partition with a filesystem type of 83 (ie. Linux). If such a partition is available it will be considered the target for the cloning process. If there is no valid partition available on the internal memory card, the external memory card will be checked for a second partition of type 83 and it will become the target if such a partition is present. If neither memory card has a valid partition, the script will abort.

The automatic internal/external device detection can be overridden by specifying the "internal" or "external" parameter - if "internal" is passed as a parameter, the script will verify the internal card is suitable before proceeding, otherwise it will abort. Likewise for "external", only the external card will be considered as the target and the internal card will be ignored.
First time tried this new receipe, worked just as advertised, totally automatic and handoff, just the way a clone script supposed to be, thank you Milhouse, again for an excellent script.

Step by step, for my own record, in case I have to do it again.

Prerequisite already satisfied, see beginning of thread, e.g., getting setup/installed becomeroot,wget,e2fsprogs,http://fanoush.wz.cz/maemo/#initfs etc done.

N810 running 2007.50-2, a 4G Adata micro/mini adapter inserted.
xterm/sudo gainroot
umount /media/mmc1
sfdisk /dev/mmcblk1 -uM
0,2100,0C
,,,
(return)
(return)
y
reboot

______(start from here, step 7 of thread #1)_________
xterm/sudo gainroot
cd ~/bin
./nupgrade.sh wipe
"Using...ext2fs
Continue? (YES/no) : " YES
it runs for 5+ minutes and ends up with
...
Committing updates and Unmounting filesystems
Done
/home/user/bin #

No error messages.

reboot, boot up from mmc2 i.e., ext SD, partition 2.

bun

Last edited by bunanson; 2008-02-15 at 23:09.
 
Posts: 19 | Thanked: 2 times | Joined on Jan 2008
#293
ok...guys
I have a problem (N800 OS2008)
after bricking the thing a few times
I have finally got the cloned OS working from the internal card
It's a 2Gb t-flash

when trying un-tar the KDE358v2 it ran out of space* and I checked details for the nokiaN800 (top of the file browser) and
it tells me I only have 680Mb , so I guess I did something wrong with size
I used this setting

Code:
2GB Card (~1.8GB real size - partition 1: 1.3GB, partition 2: ~0.5GB):
Code:

#sfdisk /dev/mmcblk0 -uM

/dev/mmcblk0p1: 0,1300,06
/dev/mmcblk0p2: ,,,
/dev/mmcblk0p3:
/dev/mmcblk0p4:
did I get something back the front ?
(wouldn't be the first time)

I had previously tried this setting:
Code:
# sfdisk /dev/mmcblk0
/dev/mmcblk0p1:1,15000,6 (this is a ~480 MB FAT32 partition)
/dev/mmcblk0p2:15001,, (this is a ~1.5MB Linux_83 partition)
/dev/mmcblk0p3: <return>    
/dev/mmcblk0p4: <return>
^
this setting worked on another SD card

http://www.thisweekinnuclear.com/KDEonN800.html
found at this site^

sorry for posting in the wrong section

Last edited by multi; 2008-02-11 at 03:55.
 
Posts: 4,030 | Thanked: 1,633 times | Joined on Jul 2007 @ nd usa
#294
I dont like the previous partition. I followed my OWN instructions (see thread above), took about 30s to type in the commands, and left the tablet alone to get a cup of coffee.... BAM! Its done. Handsoff, totally automated. I am 100% sure I would NOT have attempt another clone just for the purpose of minor adjusting the disk space. I would NOT. I still remember the dark age of 770, dls were not there, typos on step 108c, this TAR, not that TAR, cloned but wont boot, error exits, you named it. Only people that were there would understand what I am saying...... a clone process took at least a half day for me, the Linux no clue. Now, with this fabulous nupgrade.........do I have to say more? Thank you Milhouse.


bun
 
Posts: 18 | Thanked: 2 times | Joined on Jan 2008
#295
@multi

/dev/mmcblk0p1: 0,1300,06
/dev/mmcblk0p2: ,,,
/dev/mmcblk0p3:
/dev/mmcblk0p4:

With this you spare 1300 MB to fat partition and rest of it, 680 MB in your case, is left for ext2 which is not enough to install KDE
so try;
/dev/mmcblk0p1: 0,480,06
/dev/mmcblk0p2: ,,,
/dev/mmcblk0p3:
/dev/mmcblk0p4:

this should work for 2gb sd
 

The Following User Says Thank You to sahinem For This Useful Post:
Posts: 19 | Thanked: 2 times | Joined on Jan 2008
#296
Thanks sahinem!

that helped sort out my space problem nicely

Big Thanks also to Milhouse for this wonderful script.

Last edited by multi; 2008-02-15 at 04:20.
 
iliaden's Avatar
Posts: 267 | Thanked: 50 times | Joined on Feb 2008 @ Montreal, Canada
#297
Hi,

Thanks for the script which simplified by much the job of installing a dual-boot.

I want to add a quick note that the first part of the instructions were REALLY UNCLEAR, so I want to warn that if anyone with little experience reads it (me, for example) they will not understand much. http://thisweekinnuclear.com/KDEonN800.html was the instructions I used (along with your script) to install a dual-boot.

next, before I destroy everything already accomplished by a bad move, is placing a swap file on partition 1 (the FAT - 16 in my case) and booting from flash at the same time OK or is it worse than drinking and deriving?

thanks.

Ilia

Last edited by iliaden; 2008-02-19 at 03:25. Reason: forgot to subscribe
 

The Following User Says Thank You to iliaden For This Useful Post:
cashless's Avatar
Posts: 159 | Thanked: 21 times | Joined on Jan 2008 @ Houston, texas
#298
I'm a Linux newbie, so very detailed instructions would be helpful.

I have downloaded the initfs_flasher utility, but I having the hardest time unzipping it with tar. I download it to my MMC card, but I DO NOT extract it there. I move it to /home/user and then attempt to extract it with (tar zxvf initfs_flasher.tgz) but it tells me:

"tar: invalid gzip magic" - I have looked up the meaning, but I know that the message is incorrect. I have previously been able to unzip with the same command on my external card, but I read the README which instructed not to do so.

I've deleted and re-downloaded several times..

help!

Last edited by cashless; 2008-02-19 at 22:16.
 
Posts: 678 | Thanked: 197 times | Joined on Jul 2007 @ San Jose CA
#299
tar comes with may versions. sorry about that! make sure you have the one supporting long file names.

Also maybe your downloaded file was not completed/corrupted. Try to download it again.
 
cashless's Avatar
Posts: 159 | Thanked: 21 times | Joined on Jan 2008 @ Houston, texas
#300
Originally Posted by nhanquy View Post
tar comes with may versions. sorry about that! make sure you have the one supporting long file names.

Also maybe your downloaded file was not completed/corrupted. Try to download it again.
Yeah, I've dl'ed and deleted, dl'ed and deleted about 10 times now. Could moving it from MMC1 to /home/user corrupt it?

And what version of tar should I be looking for?

I'm on S2008.
 
Reply

Thread Tools

 
Forum Jump


All times are GMT. The time now is 04:12.