Guide[Linux][Windows]: Migrate to SSD/HDD of any size, only for SATV Pro

Search This thread

hallydamaster

Senior Member
Aug 27, 2010
515
151
Copenhagen, Denmark
Code:
[B][I][COLOR="Red"][SIZE="3"]I am not responsible for bricked devices, dead HDDs, animals 
activist campaigns, or any H/W damage caused by you following these
directions. YOU are choosing to make these modificiations, and
you, yourself take responsibility for doing these modifications
to your device.
You can do serious H/W damage to your SATV or even your computer
by doing any of this. So, you have been warned! [/SIZE][/COLOR][/I][/B]

First of all, you should pay your thanks to @Luxferro for mapping out the entire partition array, and building the chart that does all the calculations for using another disk size.
He also proved that it was indeed possible to modify your GPT header to another sized drive.
None of this would have been possible, if it was not for him.

Also thanks to @Tilator for initiating his thread, and proving it was possible to swap your HDD for something else.

1. Preparations and disassembling the SATV

Well, to begin with you should have a working linux environment set up. This can easily be a live CD/DVD/USB. Or you can do it from a virtual environment. You can use DD for Windows now, follow guide as normally.
You should have a hex editor with CRC32 calculating capabilities. I recommend HxD:
https://mh-nexus.de/en/downloads.php?product=HxD
Yes, that is for Windows, I use Linux for all the writing/dumping, but I prefer my Windows hex editor.

It's worth to know, that your device should be bootloader unlocked, and preferably newly factory reset.
Also, an autotool has been made now to do this GPT header edit. See post #3.


Then you can go open up the SATV by prying off the bottom of the casing. I managed to do this with my fingernails. A small plastic pry tool can be used as well.
088cdebe48.png

Then you remove the 2 wire sets from the plugs to give more working room. There is 2 sets of tape holding the wires and the HDD in place as well.
There is (on mine at least) just one screw with a small bracket holding the HDD in place, you will need a T6 driver to remove it.
Gently lift the black latch/lock on the connector to the secondary board, then the FCC connector will be easily out.
Then it is just a matter of gently loosening the adhesive on the FCC strip from the HDD and pull out the SATA connector.

With the HDD out, you will have to connect it to your Linux setup somehow. I used an enclosure with a USB3 connection.
With the HDD recognized in the computer, the time has now come to clone you HDD.
You could as well use the bin files Tilator has provided, but if you want your own genuine Netflix ESN, you should use your own.

If you want to use DD for Windows, please continue the guide from post #2. After finishing that part, come back to this post and skip to the hex editing part.


2. Dumping the data from the SATV SSHD

In a terminal window you start by listing the drives:

Code:
sudo -s
fdisk -l

This is to determine which drive you are working with. Remember that the DD command does't care which drive you specify, it will destroy your main drive if you ask it to.
The you continue by dumping the first 6899870 blocks of data to a bin file:

Code:
dd if=/dev/sd[B]X[/B] of=firstpart.bin count=6899870

This will give you a raw image file of all the partitions up until the /data partition which is better left out (it will come later).
Then continue by dumping the last 5120 bytes of data which contains the partition array and the GPT header:

Code:
dd if=/dev/sd[B]X[/B] bs=512 skip=976773158 of=lastpart.bin

EDIT: 26th August 2016, @anchung.chen has experimented with aligning the partitions to Advanced Format 4096 byte sectors (4K alignment). This supposedly gives better performance especially on SSD drives.
It's worth to know that this most likely breaks the OTA updates, as they might write partitions on block level rather than on a file level. OTA updates seems to be working.
Also, anchung.chen has had problems unlocking the bootloader on the 4K aligned disk.
@ahmed68
Reports that TWRP doesn't work well when trying to flash SuperSU.
Please see follow these steps to write the bin files with 4K alignment:


Start by downloading the ELF executable programmed by anchung.chen from this post:
http://xdaforums.com/showpost.php?p=68300570&postcount=44

Patch the lastpart.bin the following way (2TB disk size):
Code:
./shield_pro_new_disk_gpt_calculator-0.3 lastpart.bin [B]2000398934016[/B] lastpart4k.bin
This will recalculate the GPT header to match the 2TB disk, but also rewrite the partition array.

Then continue by writing the firstpart.bin in 2 steps instead of just one:

Code:
if=firstpart.bin of=/dev/sd[B]X[/B] bs=512 count=69888
Code:
dd if=firstpart.bin of=/dev/sd[B]X[/B] bs=512 skip=69790 seek=69888 count=6830080

These 3 steps effectively moves the partitions 16-32 to match 4K alignment structure.

And finish off by writing the lastpart4k.bin:
Code:
dd if=lastpart4k.bin of=/dev/sda[B]X[/B] bs=512 seek=[B]3907029158[/B]

This completes the guide, no more steps needed.



You can now disconnect your HDD. These 2 files also counts as a backup of your SATV (not with settings as userdata was not copied).
Now connect your new SSD in the enclosure.
You can easily start by writing the firstpart.bin:

Code:
dd if=firstpart.bin of=/dev/sd[B]X[/B]

3. Hex-editing the partition array and the GPT header

In your linux terminal load up the block count (called sectors in linux language) of the new drive:

Code:
fdisk -l

A 2 TB disk should have a total block count of 3907029168, but a smaller disk would have a smaller block count, so use fdisk -l to determine this.
Or if you use DD for Windows you have the output from dd --list to work with.
The lastpart.bin must be edited before we can write it on the new disk.
So use the spreadsheet provided by @Luxferro in this post:
http://xdaforums.com/showpost.php?p=67996717&postcount=189
In the column at the buttom right that says disk size, you change the value to match you new disk. In this example for the 2TB it should be 2000398934016 (bytes). This value should be taken from fdisk -l as well.
Now it gets a little hairy!

In the spreadsheet you should start with the buttom value marked out in purple under the row called "Last LBA". This should be E8E0888E:

dc65e8f1d7.png


Open up lastpart.bin in HxD and navigate to offset 00000FA8. There you should find the 4 bytes 0E 60 38 3A illustrated in this picture:
dc675ca9e9.png


This value is in a format called reverse byte ordering, so to put in your new calculated value, you will have to arrange it like this: 8E 88 E0 E8. Input that value instead of the bytes already there like this picture:

dc884ceb4c.png


While we are in this particular position in the lastpart.bin we might as well do the CRC32 of the partition array.
Now make a selection containing the 64 bytes or 4 empty lines underneath the line having UDA written in ASCII, and all the way to the top of the file, offset 00000000 to 00000FF0 like in this picture:

dcea590c79.png


In the drop-down menu, choose Analyzis->Checksums and generate a CRC-32 checksum (Not checksum-32).
It will come up in the buttom screen of HxD, and should read 6B CF E5 7D

Navigate to the buttom of the file which contains the GPT header. It should start with an ANSI text reading "EFI PART".
In offset 00001258 you should find the value of the original CRC-32 value containing the bytes 0E 02 C5 DC.
Replace this, again reversing the bytes from your newly calculated CRC-32 value like this: 7D E5 CF 6B:

067dc12477.png


Now we are actually almost finished! In the spreadsheet all the way to the right, you will find 4 hexadecimal values marked in purple.
First is the position of the GPT header, and the second is the position of the backup GPT header. Since there is only 1 on the SATV, these values are both the same.
Write them into the GPT header on offset 00001218, and 00001220, again reversing the bytes like illustrated in the picture:

067dc3304e.png


Same goes for offset 00001230, Last Usable LBA, and offset 00001248, Starting LBA of array of partition entries.

This brings us to the last thing on the table, the CRC32 of the GPT header itself.
The CRC is located on offset 00001210 and should have the bytes 46 C9 88 78 already there.
Just write 00 00 00 00 to blank them out:

06df641cfe.png


Now make a selection of the GPT header containing the beginning of the header, and to the last written byte before all the zeroes:

06df74f054.png


In the drop-down menu, choose Analyzis->Checksums and generate a CRC-32 checksum (Not checksum-32).
It will come up in the buttom screen of HxD, and should read 46 9F 24 38
Again, write it instead of the 4 bytes with zeroes reversed like this:

06df5f2486.png


This completes the matter, now just save your work in HxD and write it to the end of your drive.
To do this we need the total block count from the HDD that you fetched in the beginning of the guide from the fdisk -l output, should be 3907029168
The lastpart.bin is 5120 bytes which is the same as 10 blocks of 512 byte length.
So, 3907029168 minus 10 is 3907029158 and put into your DD-line like this:

Code:
dd if=lastpart.bin of=/dev/sda[B]X[/B] bs=512 seek=[B]3907029158[/B]

Or like this if you use DD for Windows:
Code:
dd if=lastpart.bin of=\\?\Device\Harddisk[B]X[/B]\Partition0 bs=512 seek=[B]3907029158[/B]

4. Assembling SATV and finishing up

Now at last, put in your new disk in the SATV and assemble everything back together.
If it doesn't boot in the first try, you could try another cold boot (give it 15 min.).
If that won't do it, you might have to wipe the DATA partition from the fastboot menu.
To cold boot into fastboot, follow this (taken from "http://developer.download.nvidia.com/mobile/shield/ROM/SHIELD_ATV/OTA-1.1/HowTo-Flash-Recovery-Image.txt"):

Code:
HW method:
- Disconnect power cable
- Insert USB OTG cable and make sure to connect other end to a host PC
- Connect power cable to SHIELD
- Quickly start pressing power button for ~3 seconds
- Do not hold the button and connect power supply afterwards
- HDMI TV should be always connected to SHIELD

And format the /DATA partition from fastboot like this:

Code:
fastboot format FS:EXT4 /data

Or do a fastboot oem unlock of the SATV.

Hopefully you will now have a SATV with an upgraded SSD/HDD! :D
 

Attachments

  • lastpart2TB.zip
    670 bytes · Views: 626
  • lastpart_1tb.zip
    670 bytes · Views: 545
  • lastpart1tbv2.zip
    668 bytes · Views: 397
  • lastpart_250gb.zip
    674 bytes · Views: 695
  • lastpart_160gb.zip
    665 bytes · Views: 285
Last edited:

hallydamaster

Senior Member
Aug 27, 2010
515
151
Copenhagen, Denmark
DD for Windows part

Guide for Windows, using dd for Windows by John Newbigin

Download the dd utility from: http://www.chrysocome.net//dd

Code:
[SIZE="4"]
[COLOR="Red"]
WARNING! Using DD for Windows from a command prompt with administrator privileges is DANGEROUS!
If you specify your Windows drive as output file/device, it WILL destroy the partition!
[/COLOR]
[/SIZE]

Code:
[B][I][COLOR="Red"][SIZE="3"]I am not responsible for bricked devices, dead HDDs, animals 
activist campaigns, or any H/W damage caused by you following these
directions. YOU are choosing to make these modificiations, and
you, yourself take responsibility for doing these modifications
to your device.
You can do serious H/W damage to your SATV or even your computer
by doing any of this. So, you have been warned! [/SIZE][/COLOR][/I][/B]

So, I used a Windows 10 Pro environment to test this. I think any Windows version based on the NT architecture will be working.
Extract the dd.exe and as the path you want to extract to, use this: "%USERPROFILE%\AppData\Local\Microsoft\WindowsApps"

This gives you the ability to use DD system wide.

Plug in the HDD from your SATV. The disk will be unreadable to Windows as it has no known filesystem. Windows might pop up asking you to format the drive. You MUST ignore that, and press cancel!

Open up a command prompt with administrator privileges. You can do this with Windows key+X to bring up a menu, then choose Command Prompt (administrator).

Navigate to a folder where you want to work from. It doesn't matter where, as you just have to have space enough to store the bin files.
If you need a refreshment in navigating the commnd prompt, you can read up on it here:
http://www.pcstats.com/articleview.cfm?articleid=1723&page=3

Now, run the command
Code:
dd --list

This gives you a lot of information. It even gives you the total byte count of your harddisk drives.
Navigate a little up to locate the right disk:
ef7625c822.png

In this example I didn't use my SATV HDD, but another 750GB HDD I had lying around. The SATV SSHD will have a size of 500107862016 bytes.
Be careful that you choose the right drive to work on, and you also have to find the one that has the device string "\\?\Device\HarddiskX\Partition0".
And X will have to be equivalent to the harddisk number that Windows has assigned to your device.
The you continue by dumping the first 6899870 blocks of data to a bin file:
Code:
dd if=\\?\Device\Harddisk[B]X[/B]\Partition0 of=firstpart.bin count=6899870

This will give you a raw image file of all the partitions up until the /data partition which is better left out (it will come later).
Then continue by dumping the last 5120 bytes of data which contains the partition array and the GPT header:
Code:
dd if=\\?\Device\Harddisk[B]X[/B]\Partition0 of=lastpart.bin skip=976773158 bs=512

You can now disconnect your HDD. These 2 files also counts as a backup of your SATV (not with user settings, data partition was not copied).
Now connect your new SSD in the enclosure. Use dd --list again to determine the right disk to use, and please be careful not to mix up your Windows drive or another drive which contains important data.
You can easily start by writing the firstpart.bin:
Code:
dd if=firstpart.bin of=\\?\Device\Harddisk[B]X[/B]\Partition0

Please continue the rest of the guide in first post.
 
Last edited:

anchung.chen

Member
Feb 3, 2016
46
24
Hi All:

Thank Luxferro, Tilator and hallydamaster for your hard works, so we could replace the SSHD on shield-pro-tv with any SSD or HHD.

I wrote a small program to do all calculations and generate the new lastpart.bin directly.

usage : ./shield_pro_new_disk_gpt_calculator Input_bin_file New_disk_size_in_byte Output_bin_file

It is for 64-bit Linux PC. Any comments are welcome. And if you like, the source code will be opened.

Well, I think it is quite straightforward to use it. This program just generates the modified lastpart.bin from your original lastpart.bin and disk size (byte) of new SSD/HHD which you will migrate to.

For example of hallydamaster guide, the new 2TB disk has 2000398934016 bytes and 3907029168 sectors. Then
Using following command to generate the correct lastpart.bin for the new 2TB disk.
Code:
./shield_pro_new_disk_gpt_calculator lastpart.bin 2000398934016 new_lastpart.bin

Using following command to write the correct lastpart.bin to the new 2TB disk.
Code:
sudo dd if=new_lastpart.bin of=/dev/sdX bs=512 seek=3907029158
 

Attachments

  • shield_pro_new_disk_gpt_calculator.zip
    3.9 KB · Views: 2,120
Last edited:

tech3475

Senior Member
Nov 4, 2013
93
10
Thanks for the guide.

Does anyone know the performance penalty for using a regular 2TB HDD?
 

hallydamaster

Senior Member
Aug 27, 2010
515
151
Copenhagen, Denmark
Hi All:

Thank to Luxferro, Tilator and hallydamaster hard works, so we could replace the SSHD on shield-pro-tv with any SSD or HHD.

I wrote a small program to do all calculations and generate the new lastpart.bin directly.

usage : ./shield_pro_new_disk_gpt_calculator input_bin_file disk_size_in_byte output_bin_file

It is for 64-bit Linux PC. Any comments are welcome. And if you like, the source code will be opened.

Well, I suppose we have the guide for educational purposes then! ;)

Please, tell something about how to use it.
 

anchung.chen

Member
Feb 3, 2016
46
24
Well, I suppose we have the guide for educational purposes then! ;)

Please, tell something about how to use it.

Well, I think it is quite straightforward to use it. This program just generates the modified lastpart.bin from your original lastpart.bin and disk size (byte) of new SSD/HHD which you will migrate to.

For example of your guide, the new 2TB disk has 2000398934016 bytes and 3907029168 sectors. Then
Using following command to generate the correct lastpart.bin for the new 2TB disk.
Code:
./shield_pro_new_disk_gpt_calculator lastpart.bin 2000398934016 new_lastpart.bin

Using following command to write the correct lastpart.bin to the new 2TB disk.
Code:
sudo dd if=new_lastpart.bin of=/dev/sdX bs=512 seek=3907029158
 
Last edited:
  • Like
Reactions: hallydamaster

ahmed68

Senior Member
Hi All:

Thank Luxferro, Tilator and hallydamaster for your hard works, so we could replace the SSHD on shield-pro-tv with any SSD or HHD.

I wrote a small program to do all calculations and generate the new lastpart.bin directly.

usage : ./shield_pro_new_disk_gpt_calculator input_bin_file disk_size_in_byte output_bin_file

It is for 64-bit Linux PC. Any comments are welcome. And if you like, the source code will be opened.
have any example how to use it or only run in term ./shield_pro_new_disk_gpt_calculator input_bin_file disk_size_in_byte output_bin_file
plz help I wont to gen gpt for 64gb sd card. I have boot.img for sd card and usb only for l4t Ubuntu thanks.
 

hallydamaster

Senior Member
Aug 27, 2010
515
151
Copenhagen, Denmark
have any example how to use it or only run in term ./shield_pro_new_disk_gpt_calculator input_bin_file disk_size_in_byte output_bin_file
plz help I wont to gen gpt for 64gb sd card. I have boot.img for sd card and usb only for l4t Ubuntu thanks.

You are supposed to do:

Code:
 ./shield_pro_new_disk_gpt_calculator lastpart.bin 68719476736 lastpart64gb.bin

But take the byte value you get from your own fdisk -l output.

Also, if you are going to use this for Linux and not android, I don't think it will work. The GPT layout that the SATV Pro uses is not standard.
 

ahmed68

Senior Member
You are supposed to do:

Code:
 ./shield_pro_new_disk_gpt_calculator lastpart.bin 68719476736 lastpart64gb.bin

But take the byte value you get from your own fdisk -l output.

Also, if you are going to use this for Linux and not android, I don't think it will work. The GPT layout that the SATV Pro uses is not standard.
hallydamaster thank you for help
now i use the orig. sshd under ubuntu 14.04 L4T 24.1 i wont to make sdcard for linux and sshd for android to use shield in 4k tv android the best .
 

yahoo2016

Senior Member
Nov 24, 2015
392
88
I think Nvidia should put boot loader and kernel on internal emmc's for both 16GB and 500GB SATVs rather than keeping significantly different ROM versions for 16GB and 500GB SATVs.
It'd save Nvidia and users time by doing so.

It seems much simpler to add HDDs of any size to 16 GB SATV if the HDD cable is available.
 
Last edited:

hallydamaster

Senior Member
Aug 27, 2010
515
151
Copenhagen, Denmark
I think Nvidia should put boot loader and kernel on internal emmc's for both 16GB and 500GB SATVs rather than keeping significantly different ROM versions for 16GB and 500GB SATVs.
It'd save Nvidia and users time by doing so.

It seems much simpler to add HDDs of any size to 16 GB SATV if the HDD cable is available.

I certainly agree with that, seems they had a brain fart when deciding how to build the pro. Could be great if we could somehow convert the pro version to boot from internal EMMC.
 

yahoo2016

Senior Member
Nov 24, 2015
392
88
I certainly agree with that, seems they had a brain fart when deciding how to build the pro. Could be great if we could somehow convert the pro version to boot from internal EMMC.
I have serial console print out from 16GB SATV:
http://xdaforums.com/showpost.php?p=67973969&postcount=303

I'm wondering what the output would be for SATV Pro when the HDD is disconnected.
If the first stage boot loader (TegraBoot?) is smart enough, it could check emmc for boot loader.
 

hallydamaster

Senior Member
Aug 27, 2010
515
151
Copenhagen, Denmark
I have serial console print out from 16GB SATV:
http://xdaforums.com/showpost.php?p=67973969&postcount=303

I'm wondering what the output would be for SATV Pro when the HDD is disconnected.
If the first stage boot loader (TegraBoot?) is smart enough, it could check emmc for boot loader.

That's indeed interesting, lot of info in that output!

I'm pretty sure that @Tilator had someone send him a copy of a complete rip of the EMMC from a 16GB SATV.
He then wrote it to the EMMC on the Pro, which is just empty. It didn't boot with it, but I'm not sure if he tried booting it without the HDD in it.
Cloud be interesting to try though.
Unfortunately I don't really have the time to read up on UART and solder wires on my board to try this. :-/
Not for the time being at least.
 

ahmed68

Senior Member
i will try to flash satv pro from satv and see it must save in emmc , I wont to make sd card like recovery for satv and satv pro I try repack the partition but bot work I need to edit boot.img #include <sys/mount.h>
#include <unistd.h>
#include <linux/reboot.h>
#include <fcntl.h>

extern char **environ;

int main(int argc, char **unused) {
mount("/dev", "/dev", "devtmpfs", 0, NULL);
mount("/dev/mmcblk0", "/dest", "ext4", 0, NULL);
// mount Android system
// mount("/dev/mmcblk0p1", "/mnt", "ext4", 0, NULL);
mount("/dev", "/dest/dev", NULL, MS_BIND, NULL);
chroot("/dest");
chdir("/");

char * const argv[] = { "/sbin/init", NULL };

execve(argv[0], argv, environ);
}
must change mmcblk0 to mmcblk0p1 ,mmcblk1p1 or sda21/32

---------- Post added at 08:40 PM ---------- Previous post was at 08:20 PM ----------

I take this flash.sh from tegra jetson-tx1
flash.sh: Flash the target board.
# flash.sh performs the best in LDK release environment.
#
# Usage: Place the board in recovery mode and run:
#
# flash.sh [options] <target_board> <root_device>
#
# for more detail enter 'flash.sh -h'
#
# Examples:
# ./flash.sh <target_board> mmcblk0p1 - boot <target_board> from eMMC
# ./flash.sh <target_board> mmcblk1p1 - boot <target_board> from SDCARD
# ./flash.sh <target_board> sda1 - boot <target_board> from USB device
# ./flash.sh -N <IPaddr>:/nfsroot <target_board> eth0 - boot <target_board> from NFS
# ./flash.sh -k LNX <target_board> mmcblk1p1 - update <target_board> kernel
# ./flash.sh -k EBT <target_board> mmcblk1p1 - update <target_board> bootloader
can anybody edit the boot.img to
1. mmcblk0p1 for emmc
2. mmcblk1p1 for sdcard
I think its most work
 
Last edited:

ahmed68

Senior Member
i flash satv pro from satv i now it come not bootable then i will remove hdd and boot to linux when run sudo fdisk -l i see 2 part of hdd first mmcblk0 (emmc) and sdx its sda in android by dd if=/dev/sdx of=firstpart.bin count=6899870
then dd if=firstpart.bin of=/dev/mmcblk0 and dd if=lastpart.bin of=/dev/mmcblk0 bs=512 seek=xxxxx (xxxxx i will take it from fdisk -l -10) then i most to delete boot patition from sda by sudo fdisk /dev/sda21 # input d , w .
now we have a work satv non pro , i need to use ubuntu in emmc and android in sda for that we must make the first boot img for dualOS like (Geekbox Lollipop Lubuntu dualOS)
http://forum.geekbox.tv/viewtopic.php?f=12&t=3198
anybody have any edia plz help.
 
Last edited:

revoman

Member
Oct 3, 2014
18
5
Is this fix working with the 3.2 update from a few weeks ago? I'd like to duplicate more of my movies onto my SATV Pro now that the Plex Server is installed.
 

hallydamaster

Senior Member
Aug 27, 2010
515
151
Copenhagen, Denmark
i flash satv pro from satv i now it come not bootable then i will remove hdd and boot to linux when run sudo fdisk -l i see 2 part of hdd first mmcblk0 (emmc) and sdx its sda in android by dd if=/dev/sdx of=firstpart.bin count=6899870
then dd if=firstpart.bin of=/dev/mmcblk0 and dd if=lastpart.bin of=/dev/mmcblk0 bs=512 seek=xxxxx (xxxxx i will take it from fdisk -l -10) then i most to delete boot patition from sda by sudo fdisk /dev/sda21 # input d , w .
now we have a work satv non pro , i need to use ubuntu in emmc and android in sda for that we must make the first boot img for dualOS like (Geekbox Lollipop Lubuntu dualOS)
http://forum.geekbox.tv/viewtopic.php?f=12&t=3198
anybody have any edia plz help.

Hi ahmed, can you please clarify if you had it boot without the HDD?

You cloned the HDD partitions onto the EMMC? And then removed the boot partition from the HDD, and then it booted anyway?

Is this fix working with the 3.2 update from a few weeks ago? I'd like to duplicate more of my movies onto my SATV Pro now that the Plex Server is installed.

This procedure will just clone your HDD to another disk, this should be totally independant from Android, unless ofcourse Nvidia would do something to break this.
 

polve72

Member
Jan 11, 2015
14
3
Maybe I'm the only one who would like to put a smaller HD on my shield TV. Can someone tell me if a 128GB SSD is larger enough or the smaller disk is 256GB?

TIA Polve
 

Top Liked Posts

  • There are no posts matching your filters.
  • 21
    Code:
    [B][I][COLOR="Red"][SIZE="3"]I am not responsible for bricked devices, dead HDDs, animals 
    activist campaigns, or any H/W damage caused by you following these
    directions. YOU are choosing to make these modificiations, and
    you, yourself take responsibility for doing these modifications
    to your device.
    You can do serious H/W damage to your SATV or even your computer
    by doing any of this. So, you have been warned! [/SIZE][/COLOR][/I][/B]

    First of all, you should pay your thanks to @Luxferro for mapping out the entire partition array, and building the chart that does all the calculations for using another disk size.
    He also proved that it was indeed possible to modify your GPT header to another sized drive.
    None of this would have been possible, if it was not for him.

    Also thanks to @Tilator for initiating his thread, and proving it was possible to swap your HDD for something else.

    1. Preparations and disassembling the SATV

    Well, to begin with you should have a working linux environment set up. This can easily be a live CD/DVD/USB. Or you can do it from a virtual environment. You can use DD for Windows now, follow guide as normally.
    You should have a hex editor with CRC32 calculating capabilities. I recommend HxD:
    https://mh-nexus.de/en/downloads.php?product=HxD
    Yes, that is for Windows, I use Linux for all the writing/dumping, but I prefer my Windows hex editor.

    It's worth to know, that your device should be bootloader unlocked, and preferably newly factory reset.
    Also, an autotool has been made now to do this GPT header edit. See post #3.


    Then you can go open up the SATV by prying off the bottom of the casing. I managed to do this with my fingernails. A small plastic pry tool can be used as well.
    088cdebe48.png

    Then you remove the 2 wire sets from the plugs to give more working room. There is 2 sets of tape holding the wires and the HDD in place as well.
    There is (on mine at least) just one screw with a small bracket holding the HDD in place, you will need a T6 driver to remove it.
    Gently lift the black latch/lock on the connector to the secondary board, then the FCC connector will be easily out.
    Then it is just a matter of gently loosening the adhesive on the FCC strip from the HDD and pull out the SATA connector.

    With the HDD out, you will have to connect it to your Linux setup somehow. I used an enclosure with a USB3 connection.
    With the HDD recognized in the computer, the time has now come to clone you HDD.
    You could as well use the bin files Tilator has provided, but if you want your own genuine Netflix ESN, you should use your own.

    If you want to use DD for Windows, please continue the guide from post #2. After finishing that part, come back to this post and skip to the hex editing part.


    2. Dumping the data from the SATV SSHD

    In a terminal window you start by listing the drives:

    Code:
    sudo -s
    fdisk -l

    This is to determine which drive you are working with. Remember that the DD command does't care which drive you specify, it will destroy your main drive if you ask it to.
    The you continue by dumping the first 6899870 blocks of data to a bin file:

    Code:
    dd if=/dev/sd[B]X[/B] of=firstpart.bin count=6899870

    This will give you a raw image file of all the partitions up until the /data partition which is better left out (it will come later).
    Then continue by dumping the last 5120 bytes of data which contains the partition array and the GPT header:

    Code:
    dd if=/dev/sd[B]X[/B] bs=512 skip=976773158 of=lastpart.bin

    EDIT: 26th August 2016, @anchung.chen has experimented with aligning the partitions to Advanced Format 4096 byte sectors (4K alignment). This supposedly gives better performance especially on SSD drives.
    It's worth to know that this most likely breaks the OTA updates, as they might write partitions on block level rather than on a file level. OTA updates seems to be working.
    Also, anchung.chen has had problems unlocking the bootloader on the 4K aligned disk.
    @ahmed68
    Reports that TWRP doesn't work well when trying to flash SuperSU.
    Please see follow these steps to write the bin files with 4K alignment:


    Start by downloading the ELF executable programmed by anchung.chen from this post:
    http://xdaforums.com/showpost.php?p=68300570&postcount=44

    Patch the lastpart.bin the following way (2TB disk size):
    Code:
    ./shield_pro_new_disk_gpt_calculator-0.3 lastpart.bin [B]2000398934016[/B] lastpart4k.bin
    This will recalculate the GPT header to match the 2TB disk, but also rewrite the partition array.

    Then continue by writing the firstpart.bin in 2 steps instead of just one:

    Code:
    if=firstpart.bin of=/dev/sd[B]X[/B] bs=512 count=69888
    Code:
    dd if=firstpart.bin of=/dev/sd[B]X[/B] bs=512 skip=69790 seek=69888 count=6830080

    These 3 steps effectively moves the partitions 16-32 to match 4K alignment structure.

    And finish off by writing the lastpart4k.bin:
    Code:
    dd if=lastpart4k.bin of=/dev/sda[B]X[/B] bs=512 seek=[B]3907029158[/B]

    This completes the guide, no more steps needed.



    You can now disconnect your HDD. These 2 files also counts as a backup of your SATV (not with settings as userdata was not copied).
    Now connect your new SSD in the enclosure.
    You can easily start by writing the firstpart.bin:

    Code:
    dd if=firstpart.bin of=/dev/sd[B]X[/B]

    3. Hex-editing the partition array and the GPT header

    In your linux terminal load up the block count (called sectors in linux language) of the new drive:

    Code:
    fdisk -l

    A 2 TB disk should have a total block count of 3907029168, but a smaller disk would have a smaller block count, so use fdisk -l to determine this.
    Or if you use DD for Windows you have the output from dd --list to work with.
    The lastpart.bin must be edited before we can write it on the new disk.
    So use the spreadsheet provided by @Luxferro in this post:
    http://xdaforums.com/showpost.php?p=67996717&postcount=189
    In the column at the buttom right that says disk size, you change the value to match you new disk. In this example for the 2TB it should be 2000398934016 (bytes). This value should be taken from fdisk -l as well.
    Now it gets a little hairy!

    In the spreadsheet you should start with the buttom value marked out in purple under the row called "Last LBA". This should be E8E0888E:

    dc65e8f1d7.png


    Open up lastpart.bin in HxD and navigate to offset 00000FA8. There you should find the 4 bytes 0E 60 38 3A illustrated in this picture:
    dc675ca9e9.png


    This value is in a format called reverse byte ordering, so to put in your new calculated value, you will have to arrange it like this: 8E 88 E0 E8. Input that value instead of the bytes already there like this picture:

    dc884ceb4c.png


    While we are in this particular position in the lastpart.bin we might as well do the CRC32 of the partition array.
    Now make a selection containing the 64 bytes or 4 empty lines underneath the line having UDA written in ASCII, and all the way to the top of the file, offset 00000000 to 00000FF0 like in this picture:

    dcea590c79.png


    In the drop-down menu, choose Analyzis->Checksums and generate a CRC-32 checksum (Not checksum-32).
    It will come up in the buttom screen of HxD, and should read 6B CF E5 7D

    Navigate to the buttom of the file which contains the GPT header. It should start with an ANSI text reading "EFI PART".
    In offset 00001258 you should find the value of the original CRC-32 value containing the bytes 0E 02 C5 DC.
    Replace this, again reversing the bytes from your newly calculated CRC-32 value like this: 7D E5 CF 6B:

    067dc12477.png


    Now we are actually almost finished! In the spreadsheet all the way to the right, you will find 4 hexadecimal values marked in purple.
    First is the position of the GPT header, and the second is the position of the backup GPT header. Since there is only 1 on the SATV, these values are both the same.
    Write them into the GPT header on offset 00001218, and 00001220, again reversing the bytes like illustrated in the picture:

    067dc3304e.png


    Same goes for offset 00001230, Last Usable LBA, and offset 00001248, Starting LBA of array of partition entries.

    This brings us to the last thing on the table, the CRC32 of the GPT header itself.
    The CRC is located on offset 00001210 and should have the bytes 46 C9 88 78 already there.
    Just write 00 00 00 00 to blank them out:

    06df641cfe.png


    Now make a selection of the GPT header containing the beginning of the header, and to the last written byte before all the zeroes:

    06df74f054.png


    In the drop-down menu, choose Analyzis->Checksums and generate a CRC-32 checksum (Not checksum-32).
    It will come up in the buttom screen of HxD, and should read 46 9F 24 38
    Again, write it instead of the 4 bytes with zeroes reversed like this:

    06df5f2486.png


    This completes the matter, now just save your work in HxD and write it to the end of your drive.
    To do this we need the total block count from the HDD that you fetched in the beginning of the guide from the fdisk -l output, should be 3907029168
    The lastpart.bin is 5120 bytes which is the same as 10 blocks of 512 byte length.
    So, 3907029168 minus 10 is 3907029158 and put into your DD-line like this:

    Code:
    dd if=lastpart.bin of=/dev/sda[B]X[/B] bs=512 seek=[B]3907029158[/B]

    Or like this if you use DD for Windows:
    Code:
    dd if=lastpart.bin of=\\?\Device\Harddisk[B]X[/B]\Partition0 bs=512 seek=[B]3907029158[/B]

    4. Assembling SATV and finishing up

    Now at last, put in your new disk in the SATV and assemble everything back together.
    If it doesn't boot in the first try, you could try another cold boot (give it 15 min.).
    If that won't do it, you might have to wipe the DATA partition from the fastboot menu.
    To cold boot into fastboot, follow this (taken from "http://developer.download.nvidia.com/mobile/shield/ROM/SHIELD_ATV/OTA-1.1/HowTo-Flash-Recovery-Image.txt"):

    Code:
    HW method:
    - Disconnect power cable
    - Insert USB OTG cable and make sure to connect other end to a host PC
    - Connect power cable to SHIELD
    - Quickly start pressing power button for ~3 seconds
    - Do not hold the button and connect power supply afterwards
    - HDMI TV should be always connected to SHIELD

    And format the /DATA partition from fastboot like this:

    Code:
    fastboot format FS:EXT4 /data

    Or do a fastboot oem unlock of the SATV.

    Hopefully you will now have a SATV with an upgraded SSD/HDD! :D
    14
    Hi All:

    Thank Luxferro, Tilator and hallydamaster for your hard works, so we could replace the SSHD on shield-pro-tv with any SSD or HHD.

    I wrote a small program to do all calculations and generate the new lastpart.bin directly.

    usage : ./shield_pro_new_disk_gpt_calculator Input_bin_file New_disk_size_in_byte Output_bin_file

    It is for 64-bit Linux PC. Any comments are welcome. And if you like, the source code will be opened.

    Well, I think it is quite straightforward to use it. This program just generates the modified lastpart.bin from your original lastpart.bin and disk size (byte) of new SSD/HHD which you will migrate to.

    For example of hallydamaster guide, the new 2TB disk has 2000398934016 bytes and 3907029168 sectors. Then
    Using following command to generate the correct lastpart.bin for the new 2TB disk.
    Code:
    ./shield_pro_new_disk_gpt_calculator lastpart.bin 2000398934016 new_lastpart.bin

    Using following command to write the correct lastpart.bin to the new 2TB disk.
    Code:
    sudo dd if=new_lastpart.bin of=/dev/sdX bs=512 seek=3907029158
    6
    DD for Windows part

    Guide for Windows, using dd for Windows by John Newbigin

    Download the dd utility from: http://www.chrysocome.net//dd

    Code:
    [SIZE="4"]
    [COLOR="Red"]
    WARNING! Using DD for Windows from a command prompt with administrator privileges is DANGEROUS!
    If you specify your Windows drive as output file/device, it WILL destroy the partition!
    [/COLOR]
    [/SIZE]

    Code:
    [B][I][COLOR="Red"][SIZE="3"]I am not responsible for bricked devices, dead HDDs, animals 
    activist campaigns, or any H/W damage caused by you following these
    directions. YOU are choosing to make these modificiations, and
    you, yourself take responsibility for doing these modifications
    to your device.
    You can do serious H/W damage to your SATV or even your computer
    by doing any of this. So, you have been warned! [/SIZE][/COLOR][/I][/B]

    So, I used a Windows 10 Pro environment to test this. I think any Windows version based on the NT architecture will be working.
    Extract the dd.exe and as the path you want to extract to, use this: "%USERPROFILE%\AppData\Local\Microsoft\WindowsApps"

    This gives you the ability to use DD system wide.

    Plug in the HDD from your SATV. The disk will be unreadable to Windows as it has no known filesystem. Windows might pop up asking you to format the drive. You MUST ignore that, and press cancel!

    Open up a command prompt with administrator privileges. You can do this with Windows key+X to bring up a menu, then choose Command Prompt (administrator).

    Navigate to a folder where you want to work from. It doesn't matter where, as you just have to have space enough to store the bin files.
    If you need a refreshment in navigating the commnd prompt, you can read up on it here:
    http://www.pcstats.com/articleview.cfm?articleid=1723&page=3

    Now, run the command
    Code:
    dd --list

    This gives you a lot of information. It even gives you the total byte count of your harddisk drives.
    Navigate a little up to locate the right disk:
    ef7625c822.png

    In this example I didn't use my SATV HDD, but another 750GB HDD I had lying around. The SATV SSHD will have a size of 500107862016 bytes.
    Be careful that you choose the right drive to work on, and you also have to find the one that has the device string "\\?\Device\HarddiskX\Partition0".
    And X will have to be equivalent to the harddisk number that Windows has assigned to your device.
    The you continue by dumping the first 6899870 blocks of data to a bin file:
    Code:
    dd if=\\?\Device\Harddisk[B]X[/B]\Partition0 of=firstpart.bin count=6899870

    This will give you a raw image file of all the partitions up until the /data partition which is better left out (it will come later).
    Then continue by dumping the last 5120 bytes of data which contains the partition array and the GPT header:
    Code:
    dd if=\\?\Device\Harddisk[B]X[/B]\Partition0 of=lastpart.bin skip=976773158 bs=512

    You can now disconnect your HDD. These 2 files also counts as a backup of your SATV (not with user settings, data partition was not copied).
    Now connect your new SSD in the enclosure. Use dd --list again to determine the right disk to use, and please be careful not to mix up your Windows drive or another drive which contains important data.
    You can easily start by writing the firstpart.bin:
    Code:
    dd if=firstpart.bin of=\\?\Device\Harddisk[B]X[/B]\Partition0

    Please continue the rest of the guide in first post.
    4
    Hi all, I too have successfully upgraded my SATV 2017 Pro with a Crucial BX200 480GB Solid State Drive in my case, using Windows only.

    Thanks a lot to everyone in the forum, specially @Tilator, @Luxferro, @hallydamaster and @anchung.chen

    Specifications:


    Steps:
    - Before doing this please read original post on this thread for windows which explains how to use dd to get your SSD size in bytes and pick the right HDD.
    - To make everything easier just create a folder e.g. c:\shield and copy both dd.exe executable and shield_pro_new_disk_gpt_calculator-0.3 to this folder.
    - Remember the numbers below are for this specific SSD if you use a different one please read the posts carefully to get your number

    1. Factory reset
    2. fastboot oem unlock
    3. replace HarddiskX with your corresponding for SATV HDD, open your standard cmd as an Administrator and run
      Code:
      dd if=\\?\Device\HarddiskX\Partition0 of=firstpart.bin count=6899870
      dd if=\\?\Device\HarddiskX\Partition0 of=lastpart.bin skip=976773158 bs=512
    4. Open bash on ubuntu for windows
    5. Assuming you have everything in c:\shield then do
      Code:
       cd /mnt/c/shield
      ./shield_pro_new_disk_gpt_calculator-0.3 lastpart.bin 480103981056 lastpart4k.bin
    6. This tool gives you the commands you need to run afterwards so make sure you take note
    7. Now you should have everything to start copying into your SSD
    8. for SSD run using your standard cmd as an Administrator
      Code:
      dd if=firstpart.bin of=\\?\Device\HarddiskX\Partition0 bs=512 count=69888
      dd if=firstpart.bin of=\\?\Device\HarddiskX\Partition0 bs=512 skip=69790 seek=69888 count=6830080
      dd if=lastpart4k.bin of=\\?\Device\HarddiskX\Partition0 bs=512 seek=937703078

    That's all I did. I didn't have to do reboot in fastboot to do any factory reset or unlock or format.

    Two things worth mentioning, though:

    - When raw reading and dumping the lastpart of the ordiginal Shield SSHD I too got the reading file 27 error as has been reported by multiple users:

    skip to 500107856896
    Error reading file: 27 The drive cannot find the sector requested
    10+0 records in
    10+0 records out

    It did write the the 10 blocks of 512 bytes, though. With hex editor I couldn't find anything wrong either so, as I'm lazy by nature, I just tried using this generated lastpart.bin and ignored the error and it seemed to work.

    - Secondly I've chosen to use the 4k alignment method, as this supposedly gives better performance especially on SSD drives. Although @ahmed68 has reported that TWRP doesn't work well when trying to flash SuperSU, I've had no problem with TWRP, rooting and flashing SuperSU afterwards.

    Thanks again all! I hope my experience will help others as all your work and posts have helped me!
    3
    i bought a 2017 pro edition (used) and the HDD is sort of DOA (it sits at the logo screen for forever) i have tried going into the recovery kernel and it comes up to the no command screen, but then just goes back to the nvidia logo. is there anyway that i can build my own bin files on a SSD ? or image someones copy or is the bin file unique to each machine and locked tot hat machine as well?

    If the logo comes up, the HDD is probably fine. You could try to take the drive out and migrate to an SSD
    The bin files are dumps of the machines HDD, and are therefore unique to each machine.

    If you rather want to try revive the Shield as it is, you should try to boot into fastboot and do:
    fastboot oem unlock

    This will effectively wipe the drive. If that doesn't work you can flash the factory images from Nvidia or TWRP recovery to do a factory reset.