Site Tools


Hotfix release available: 2024-02-06a "Kaos". upgrade now! [55.1] (what's this?)
New release available: 2024-02-06 "Kaos". upgrade now! [55] (what's this?)
repartitioninternalstorage

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
repartitioninternalstorage [2011/07/28 01:04] – created gillesrepartitioninternalstorage [2012/10/05 16:07] (current) fly-away
Line 1: Line 1:
-Repartition Internal Storage +See [[repartition_mmc|Repartition Internal eMMC]]
- +
-In the latest kernel the tegra partition tables are supported. No need to alter the table the complicated way. +
- +
- +
-BACKUP EVERY PARTITION AND THE PARTITION TABLE +
- +
-Altering the layout of the storage is a really intrusive thing and might lead to point of no return. If you are not sure what to do or how to do it in detail go on and ask before you flash it or let it be. +
-All values from files and in commands are specific to my device and actions, which is also true for generalized values. +
- +
- +
-IF ANYTHING GOES WRONG: +
-nvflash --bct orginal.bct --setbct --configfile cfg/real.cfg --bl fastboot.bin --go +
-nvflash --resume ... +
- +
-Note that you need the orginal.bct and real.cfg therefor +
- +
-Step 1: Prepare the files +
- +
-real.cfg (attached, see links below) +
-IMPORTANT you need it for resetting partition table to factory but if you have the partition table you can create it afterwards +
- +
-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 (attached), layout recommendations +
-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 at the moment +
-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 "dual boot" with this layout +
-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../prebuilt/fastboot.stock.bin ./fastboot.bin +
-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 +
- +
-Step 2: creating the new partition +
-IMPORTANT since this alters the partition table it could really mess everything up so be warned +
-make sure you have backups of every partition AND a partition table +
- +
-double check and execute +
-./nvflash --bct orginal.bct --setbct --bl fastboot.bin --configfile altered.cfg --create --verifypart -1 --go +
- +
-OUTPUT is like that: +
- +
-Nvflash started +
-rcm version 0X20001 +
-System Information: +
-chip name: t20 +
-chip id: 0x20 major: 1 minor: 2 +
-chip sku: 0x8 +
-chip uid: 0x161c10c4432132d7 +
-macrovision: disabled +
-hdcp: enabled +
-sbk burned: false +
-dk burned: false +
-boot device: emmc +
-operating mode: 3 +
-device config strap: 1 +
-device config fuse: 0 +
-sdram config strap: 1 +
- +
-sending file: orginal.bct +
-- 4080/4080 bytes sent +
-orginal.bct sent successfully +
-downloading bootloader -- load address: 0x108000 entry point: 0x108000 +
-sending file: fastboot.bin +
-| 931920/931920 bytes sent +
-fastboot.bin sent successfully +
-waiting for bootloader to initialize +
-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/931920 bytes sent +
-fastboot.bin sent successfully +
-Verifying partition ID = 4...Please wait!! +
-Verification successful!! +
-VERIFICATION COMPLETE.... +
- +
-Step 3: I altered it and now? +
- +
-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 +
-if it doesn't something is wrong with either your layout ( BCT, PT, EBT altered?) or the rewriting of the bootloader +
-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" ) +
-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:300:a00:800,boot:d00:1000:800,mbr:1d00:200:800,system:1f00:10032964:800' +
-I altered to the following 'tegrapart=mbr:300:a00:800,boot:d00:8000,system:8d00:3b0b00' +
-scheme explained name:offset:length:blocksize +
-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 for me after EBT ( I sacrificed SOS for it ) +
-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 /dev/mmcblk0p1 and mmcblk0p2 +
-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 +
- +
repartitioninternalstorage.1311807862.txt.gz · Last modified: 2011/07/28 01:04 by gilles