repartitioninternalstorage
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
repartitioninternalstorage [2011/08/11 18:49] – ggrandou | repartitioninternalstorage [2012/10/05 16:03] – fly-away | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | DELETEME | ||
- | |||
====== Repartition Internal Storage ====== | ====== Repartition Internal Storage ====== | ||
+ | < | ||
+ | <span style=" | ||
+ | You should definitly know what are you doing <br/> | ||
+ | All data on you internal mmc will be lost if you follow this instruction! <br/> | ||
+ | Also you cannot install Android on the new layout. | ||
+ | </ | ||
+ | </ | ||
+ | ==== Backup ==== | ||
+ | [[backups|First backup everything]] if you care. | ||
- | In the latest kernel the tegra partition | + | ====Default |
- | + | ^ part # ^ name ^ size ^ description ^ remarks | | |
- | + | ^ 2 | BCT | 3 145 728 (3 MB) | boot config | |
- | BACKUP EVERY PARTITION AND THE PARTITION TABLE | + | ^ 3 | PT | 524 288 (512 kB) | partition table | | |
- | + | ^ 4 | EBT | 2 097 152 (2 MB) | bootloader | | | |
- | Altering the layout | + | ^ 5 | SOS | 5 242 880 (5 MB) | recovery partition | | |
- | All values from files and in commands are specific to my device and actions, which is also true for generalized values. | + | ^ 6 | LNX | 8 388 608 (8 MB) | linux kernel |
- | + | ^ 7 | MBR | 1 048 576 (1 MB) | master | |
- | + | ^ 8 | APP | 314 572 800 (300 MB) | applications (/system) | | | |
- | IF ANYTHING GOES WRONG: | + | ^ 9 | CAC | 419 430 400 (400 MB) | cache (/cache) | | |
- | nvflash --bct orginal.bct --setbct --configfile cfg/ | + | ^ 10 | MSC | 2 097 152 (2 MB) | misc (/misc) | | |
- | nvflash --resume ... | + | ^ 11 | EM1 | 524 288 (512 kB) | |
- | + | ^ 12 | UBA | 1 294 991 360 (1235 MB) | user data (/data) | | | |
- | Note that you need the orginal.bct and real.cfg therefor | + | ^ 13 | EM2 | 524 288 (512 kB) | |
- | + | ^ 14 | UDB | 5 950 144 512 (5674.5 MB) depends on model | user data (/storage) | | |
- | Step 1: Prepare the files | + | |
- | + | ||
- | real.cfg | + | |
- | IMPORTANT you need it for resetting partition | + | |
- | + | ||
- | retrieve the partition table with nvflash | + | |
- | you can use my real.cfg as a sample for AC100-10V | + | |
- | alter the section size ( in bytes ) according to your layout and size | + | |
- | + | ||
- | altered.cfg | + | |
- | change real.cfg according to your needs and save it under a new name | + | |
- | I would highly recommendto keep the partitions BCT, PT, EBT in size and start point since at least EBT seems to be the hardcoded bootloader section and cannot be altered | + | |
- | if you experience something different let everyone know | + | |
- | in my case I sacrificed SOS as a place for my new MBR (see my altered.cfg) be aware that you cannot " | + | |
- | another fixed point is the position of LNX although you can alter its size | + | |
- | as you can see in my altered.cfg I chose to name my big partition RT and kept it as last you can add partitions as you like here | + | |
- | be aware that the sizes are multiples of 2048 | + | |
- | + | ||
- | change type of partition 4 (EBT) in altered.cfg | + | |
- | [partition] | + | |
- | name=EBT | + | |
- | id=4 | + | |
- | type=data | + | |
- | ... | + | |
- | + | ||
- | be warnedthis part may seem strange since you expect a valid layout to contain a bootloader but with a bootloader section nvflash will fail hence you will never be able to write a layout with a type=bootloader section to the device | + | |
- | + | ||
- | copy fastboot.stock.bin from the directory prebuilt to nvflash und ther new name fastboot.bin that it can be send with the --create command wheere it is needed for the filename=fastboot.bin part of EBT | + | |
- | since in every sample file of L4T I found this part I decided to keep it in my aswell | + | |
- | TODO test if it is possible to send other backup files directly with --create to be more efficient and have a proper verification | + | |
- | + | ||
- | + | ||
- | fastboot.bin | + | |
- | nvflash will require fastboot.bin in current folder, so copy it from linux4tegra/prebuid like that: | + | |
- | [root@pc nvflash]# ln -s../ | + | |
- | orginal.bct | + | |
- | the orginal bct file is the first 4080bytes of Partition 2 | + | |
- | dd if=backup_part-2.img bs=1 count=4080 of=orginal.bct | + | |
- | I noticed that with hexdump -C original.bct everytime the second line ( offset 0x20 ) has to star like '01 00 02 00' which seems a good point of verification | + | ==== Repartitioning ==== |
+ | Download partition table [[http:// | ||
- | Step 2: creating the new partition | + | and command file in same dir |
- | IMPORTANT since this alters the partition table it could really mess everything up so be warned | + | <file bash repartition.sh> |
- | make sure you have backups of every partition AND a partition table | + | #!/bin/bash |
- | double check and execute | + | # Change this paths to you own |
- | ./ | + | nvflash=~/ |
+ | fastboot=~/ | ||
- | OUTPUT is like that: | + | $nvflash --bl $fastboot --sync || exit 1 |
- | Nvflash started | + | mkdir work |
- | rcm version 0X20001 | + | cd work |
- | System Information: | + | echo -n " |
- | chip name: t20 | + | for i in $(seq 2 6) |
- | chip id: 0x20 major: 1 minor: | + | do |
- | chip sku: 0x8 | + | |
- | chip uid: 0x161c10c4432132d7 | + | done |
- | macrovision: | + | echo " Done" |
- | hdcp: enabled | + | |
- | sbk burned: false | + | |
- | dk burned: false | + | |
- | boot device: emmc | + | |
- | operating mode: 3 | + | |
- | device config strap: | + | |
- | device config fuse: 0 | + | |
- | sdram config strap: 1 | + | |
- | sending file: orginal.bct | + | read -p "Press [Enter] key when device rebooted |
- | - 4080/4080 bytes sent | + | echo -n " |
- | orginal.bct sent successfully | + | dd if=part2.img bs=1 count=4080 of=original.bct |
- | downloading bootloader -- load address: 0x108000 entry point: 0x108000 | + | ln -s $fastboot |
- | sending file: fastboot.bin | + | $nvflash --bl $fastboot |
- | | 931920/ | + | echo " Done" |
- | fastboot.bin sent successfully | + | |
- | waiting for bootloader | + | |
- | bootloader downloaded successfully | + | |
- | setting device: 2 3 | + | |
- | creating partition: BCT | + | |
- | creating partition: PT | + | |
- | creating partition: EBT | + | |
- | creating partition: MBR | + | |
- | creating partition: LNX | + | |
- | creating partition: RT | + | |
- | Formatting partition 2 BCT please wait.. done! | + | |
- | Formatting partition 3 PT please wait.. done! | + | |
- | Formatting partition 4 EBT please wait.. done! | + | |
- | Formatting partition 7 MBR please wait.. done! | + | |
- | Formatting partition 6 LNX please wait.. done! | + | |
- | Formatting partition 8 RT please wait.. done! | + | |
- | done! | + | |
- | Enabling verification for partition ID = 4... | + | |
- | sending file: fastboot.bin | + | |
- | | 931920/ | + | |
- | fastboot.bin sent successfully | + | |
- | Verifying partition ID = 4...Please wait!! | + | |
- | Verification successful!! | + | |
- | VERIFICATION COMPLETE.... | + | |
- | Step 3: I altered it and now? | + | read -p "Press [Enter] key when device rebooted to new recovery mode ..." |
+ | echo " | ||
+ | $nvflash --bl $fastboot --sync || exit 1 | ||
+ | $nvflash -r -q --rawdevicewrite 0 1536 part2.img | ||
+ | $nvflash -r -q --rawdevicewrite 1792 1024 part4.img | ||
+ | $nvflash -r -q --download 5 part5.img | ||
+ | $nvflash -r -q --download 6 part6.img --go | ||
+ | echo " Done" | ||
+ | </ | ||
- | first I would get the new partition table with --getpartitiontable take a look at it and compare it to your original partition table | ||
- | BCT, PT, EBT must not be altered and LNX should start at the same offset | ||
- | after that back it up | ||
- | the next step was always for me to restore partition-4 ( EBT ) back to the device | ||
- | after that you can turn on your device it should show you the familiar Toshiba Logo | + | You should power on you device |
- | if it doesn' | + | Then run **repartition.sh**\\ |
- | the worst experience I had was ./nvflash --bl fastboot.bin ... being rejected after a --create because of a faulty bootloader section ( see "If anything goes wrong" ) | + | While repartion |
- | install a distro but keep in mind: | + | |
- | you have to alter the kernel image you write to LNX: | + | |
- | Alter the commandline | + | |
- | my original was '... tegrapart=recovery: | + | |
- | I altered to the following ' | + | |
- | scheme explained name: | + | |
- | IMPORTANT: in linux you will only see everything after mbr imho if you choose a wrong location here I assume linux will just write there | + | |
- | as you can see my cmd line now starts with the mbr because it is the first partition | + | |
- | the offset 0x300 is for the first partition after EBT I havn't changed that | + | |
- | I kept the size of 0xa00 for MBR that LNX can start at its good old position but as you can see I grew LNX to the size of 0x8000 | + | |
- | the last part is RT my big root partition with the calculated values ( boot offset + boot length == system offset | + | |
- | as you can see I have two devices after MBR (LNX==boot and RT==system) which will show up in linx as / | + | |
- | Alter the initrd | + | |
- | if something gets mounted e. g. in init you may have to change the device name | + | |
- | create a kernel image with those changes and hopefully | + | |
+ | ====Resulting layout==== | ||
+ | ^ part # ^ name ^ size ^ description ^ remarks | | ||
+ | ^ 2 | BCT | 3 145 728 (3 MB) | boot config table | | | ||
+ | ^ 3 | PT | 524 288 (512 kB) | partition table | | | ||
+ | ^ 4 | EBT | 2 097 152 (2 MB) | bootloader | | | ||
+ | ^ 5 | SOS | 5 242 880 (5 MB) | recovery partition | | | ||
+ | ^ 6 | LNX | 8 388 608 (8 MB) | linux kernel and initrd | kernel starts at 0x800 initrd starts at 0x20E800 | | ||
+ | ^ 7 | MBR | 1 048 576 (1 MB) | master boot record | | | ||
+ | ^ 8 | APP | ALL AVAILABLE | / | | | ||
repartitioninternalstorage.txt · Last modified: 2012/10/05 16:07 by fly-away