yashsingh1/xdaforums huggingface dataset:
[Shield Android TV General] Tilator:
That's very much possible. But I got it working with one try with two different 500GB drives. Samsung SSD and an old conventional HDD from some old laptop. 302GB disk did not work even with multiple flashings.

I don't know how ahmed68 did it but what I know there was some trouble afterwords. Maybe he will tell us more what happened.

Anyways it seems like this issue is not all done yet.
[Shield Android TV General] mr.fixit1:
This is true, I am guessing that each device will have a different ESN for Netflix so just any US image may not work. I have just started messing with linux the last few days, I actually just built an Ubuntu machine just for this project, so at this time I do not have the knowledge necessary to create my own image from my Shield HD. Any suggestions would be greatly appreciated. At this point am am just looking to move to the same size drive just an SSD for stability as I know the stock drives are prone to faliure.
[Shield Android TV General] hallydamaster:
It is pretty straightforward to rip your own image.

Open up your terminal (CTRL-T) and navigate to your work folder.

Then connect your original HDD (I assume you use a HDD enclosure).

Then do:

sudo dd if=/dev/sdX of=firstpart.bin bs=1024 count=16777216

This rips the first ~17 GB to firstpart.bin

I just chose the number 17 out of the blue, this ensure that you should be well within the /DATA partition on the original drive.

Then do:

sudo dd if=/dev/sdX of=lastpart.bin bs=512 skip=976511024 count=262144

This rips the last ~134 MB along with the secondary GPT header to lastpart.bin.

Then disconnect original HDD and put in the new drive and write the firstpart.bin like in the first post.

For the lastpart.bin you take the block count from the HDD and substract 262144 from that. If it's a 500GB HDD you have 976773168-262144=976511024. Then do:

sudo dd if=lastpart.bin of=/dev/sdX seek=976511024 bs=512

This should be all the preparation needed. Now try put it in and boot it. It might need the second cold boot as well.

This might screw up the /DATA partition somehow, and maybe it will not boot because of just that.

If not, it could be an idea to try boot it into the fastboot bootloader and try to bootup the recovery and do a factory reset. Or better yet if TWRP is present, do a wipe/format of the /DATA partition.

If it still does not work, you could try to use a recovery software to rectify the GPT headers. This makes it unbootable in the shield, but recalculates the CRC and pointers in the GPT headers.

Then write the firstpart.bin over it again and try it in the Shield (maybe just the first ~100 MB).

Cheers :cowboy:
[Shield Android TV General] ahmed68:
first time I use 2tb(I format it with install usb Ubuntu 14.04 64bit) I see only NVidia I wait 30-40 min but its doesn't boot, reconnect power and connect again only NVidia wait more than 30mint without changes.

then I boot to Ubuntu and format drive after that I doesnt see NVidia log.

i try all cases , I strat the shield with org sshd then boot to fastboot reconnect sshd and connect 2tb hdd (sata have a hotplugin) then run fastboot getvar all

I see all part like 500gb I think we need staging blob for 2tb its reparting hdd

---------- Post added at 09:15 PM ---------- Previous post was at 08:41 PM ----------

I think we can use any drive if we install Ubuntu then boot to fastboot and reflash boot, recovery, system, vendor and dtb.

by yahoo2016 (Build kernel from source and boot to Ubuntu using L4T (Linux for Tegra) rootfs) we can change any part from Linux to android or from android to Linux.

http://xdaforums.com/shield-tv/general/build-kernel-source-boot-to-ubuntu-t3274632

I boot Ubuntu from sd 64gb I think we can use any hdd to boot Ubuntu then move all part by android.
[Shield Android TV General] Luxferro:
I been playing around with testdisk on a parted magic bootable iso, and when analyzing my shields stock disk as GPT type, it finds the following partitions (see attachment). The files on each partition are view-able.

The first listed is /system

2nd seems to be recovery

3rd is a vendor partition

the next 2 I'm not sure

and the last is /data (which is also view-able if your disk hasn't been factory reset).

There are a bunch of sectors (452,765) which come before /system, which is about 231,815,680 in bytes, and has to include the MBR (if the shield uses the primary mbr) and possibly other device specific data.

After /data, there's about 35 sectors (17,920 bytes) that are unaccounted for. I did a DD of the drive to file to create an image, and it wrote 500,107,862,016 bytes, so this is how I figured out the total.

I've made a spreadsheet with the structure info so far: https://goo.gl/GJOJvE

edit: added for unaccounted space between the partitions that were found and made some adjustments (everything not shown by testdisk is highlighted in yellow on the spreadsheet).

edit2: here's more images from testdisk, for each partition highlighted, the following picture should show file contents for that partition: https://goo.gl/photos/xQWBhnb2XKX8kN759
[Shield Android TV General] mr.fixit1:
Hello, last night I was looking around reading about the dd commands and so just for the heck of it with my shield drive and a test 500gb drive hooked up to my Ubuntu box I did:

sudo dd if=/dev/sdX of=/dev/sdy

It took a very long time, but after if finished I put the test drive in the shield and it booted up and worked perfectly. So it looks like if you just want to clone your original drive to another of the same size it will work just fine, which this is fine for me because now I have a backup of my original drive plus a way to copy to a ssd or new drive if there is a failure I am not to worried about the drive size at this time. I did also test the Netflix app which worked fine. Also to note I did not have to reboot twice or anything it was as if it had the stock drive in the shield even all of my apps and setting were still there.
[Shield Android TV General] Luxferro:
What type of drive did you dd your shields stock drive to? Did you do it the samsung evo 500GB, or something different?
[Shield Android TV General] mr.fixit1:
Hi, I used a spare standard 500gb seagate from a hp pc for testing, and just now the clone finished for my Samsung evo, much faster I used:

sudo dd if=/dev/sdx of=/dev/sdy bs=32M

It took 14940 seconds or 249 min. or 4.15 Hrs. with the above command. Without the bs=32M it took 63698 seconds or 1061 min. or 17.69 Hrs. I hope this helps. I am going to see if I can make a compressed image of the stock drive for a back up next.
[Shield Android TV General] Luxferro:
I backed up my original shield HD w/ dd to an image file, rather than directly to another drive (it didn't take too long, maybe 2-3 hours w/o any block size setting). Currently going from the image file to my evo ssd; so far it's been going for about an hour... I assume it will be done in another hour or so (or at least hope).
[Shield Android TV General] mr.fixit1:
Cool, let me know how it works out and what dd command you used to make it if it works, I was curious if the reason why my clone worked is because I did a direct drive to drive copy. Right now I have 3 drives that work in my Shield and wow there is definitely a speed difference between them. The stock drive being a SSHD is not too bad however the standard drive I used for testing is sloooow, but the Samsung EVO blows away the stock drive just in boot time alone and menu navigation and Netflix app loading is way faster.
[Shield Android TV General] Luxferro:
i just did:

source_hd to image

dd if=/dev/sdX of=/folder_path/shield.img

image to new_hd

dd if=/folder_path/shield.img of=/dev/sdX

It took ~1.5 hours to write the image to my samsung evo 500GB from an old samsung 2TB spinright HD (HD204UI), and can confirm it works fine - booted on 1st boot, neflix also works fine now.
[Shield Android TV General] mr.fixit1:
That's awesome, thanks I will make a note of that. I wonder why this didn't seem to work for other users? It seems to be a very simple solution for backing up to another drive of the same size.
[Shield Android TV General] Luxferro:
Not sure what drives others have tried when cloning the existing HD, but the samsung evo 500GB just might be the same exact size (in sectors and bytes) as the original seagate, so it works without having to adjust the secondary mbr at the end of the disk?
[Shield Android TV General] mr.fixit1:
That could be, I know the seagate drive I used for testing must have been the same too. I am wondering if you used a larger drive if it would still work but the shield would only see it as a 500gb? kinda like how if you use two different size drives in a raid configuration it will just set the larger drive to the smallest size in the set and ignore the extra space.
[Shield Android TV General] hallydamaster:
It's so great to hear. Now we know that direct DD copy is the way to go.

I don't think that it would. In a GPT layout the primary header lies in the beginning of the drive, and the secondary header in the end. Since it doesn't appear to have the primary header, the only thing we have is the secondary header to tell where and how large the partitions are. And it has to be in the end of the drive!
[Shield Android TV General] ahmed68:
hi

this dtb from Tegra210_Linux_R24.1.0_aarch64(by yahoo2016 dtb from L4T 24.1 should work for both L4T 24.1 and SATV 3.x.)

https://mega.nz/#!B8ZxXbzS!0_ubz7FYOfLTkqQNqH7vyb-AE1CUIFPdBwLkO7Oeo80

its work better than stok and faster I test it in sshd and ssd (dtb its gev cpu and ram frequency cpu core maping).

if you like to use goto fastboot

1.fastboot flash staging blob

2.fastboot flash dtb tegra210-foster-e-hdd-p2530-0932-e02-00.dtb

3.fastboot reboot

I test it 100% work better than stok.
[Shield Android TV General] polve72:
It works! I just created an image from original disk and copied on Samsung EVO 850 500GB drive (type MZ-75E500B/EU) and It works flawlessly.

Before I tried successfully Tilator process but I prefer a clone of my original disk.

Thx to everyone
[Shield Android TV General] visitor29:
Can you please confirm - after successful clone when doing cold restart (re plug power cord on back of the shield) shield boot properly up with the first boot? thanks.
[Shield Android TV General] polve72:
Yes, I do. shield boot properly.
[Shield Android TV General] visitor29:
Another one question, doing clone (dd if=/dev/sdX of=/folder_path/shield.img) of "shield.img" it will creates OS and whatever what is on drive gb size only or it will creates +/- 500gb shield.img?
[Shield Android TV General] Tilator:
Did you manage to get it booted up with 2TB drive too? If so, did it take all space in use or only 500GB of it?
[Shield Android TV General] polve72:
500GB image. It's a raw Uncompressed image.
[Shield Android TV General] visitor29:
Yep I see now....just started process now couple hours ago and img file slowly growing up.
[Shield Android TV General] Luxferro:
The 2TB drive was where I wrote the dd dump file to (as a file, not written over the disk).

---------- Post added at 09:10 AM ---------- Previous post was at 09:09 AM ----------

It will compress down to ~3GB (if you don't have much stored on it, or if the disk was factory reset), so you can keep it around easier just in case.
[Shield Android TV General] polve72:
How?
[Shield Android TV General] Tilator:
One of the best ways to compress it is using gzip. Some zip files can be written directly on disk by zcat. It decompresses zip and writes it right away on disk. Then you do not need 500GB free space on some other disk for first unzipping.
[Shield Android TV General] Luxferro:
zip it
[Shield Android TV General] polve72:
Ok thx, I hope I could create a compressed image directly with DD command.
[Shield Android TV General] hallydamaster:
I actually think you can do something like:

dd if=/dev/sdX | gzip -c > /path/to/backup.img.gz
[Shield Android TV General] mr.fixit1:
That should work, I copied mine to two different hard drives, I figured I would just hold onto the stock drive and my second cloned drive as my backups. I have to say there is a huge difference in the speed using the Samsung ssd, the shield boots so much faster and responds much quicker doing everything.
[Shield Android TV General] Luxferro:
Has any tried if fastboot works properly on any drive besides the stock seagate hybrid? Flashing factory images, ect.

I recall somewhere that the contents of a particular function were looking specifically for the hybrid drives model number... I think it may have been fastboot, but forget.
[Shield Android TV General] polve72:
Just tried, it works.
[Shield Android TV General] visitor29:
yep, works too
[Shield Android TV General] visitor29:
Found this one useful....

open new terminal when running process of dd if=/dev/sdX of=/folder_path/shield.img of "shield.img

Type: in new terminal

watch -n5 sudo kill -USR1 $(pgrep ^dd)

P.s -n5 = second interval, you can put any number there...

And now you can see progress of transfer speed, second
[Shield Android TV General] Trigger911:
Man thank you ..... seen tons of dead 500 gig shields .... I got the 500 before reviews .... I hope people find this post ...
[Shield Android TV General] perrin21:
Will this work with smaller SSD drives?
[Shield Android TV General] hallydamaster:
It does not.

But if you are up for it, I would like to help you try a few other steps to see if it works?
[Shield Android TV General] perrin21:
Thats a shame, i have a spare 256gb SSD already. Is this a technical limitation? Why 500GB only?

---------- Post added at 10:43 AM ---------- Previous post was at 10:38 AM ----------

Yes i will give it a try if you can suggest anything. My drive is a THNSFJ256GCSU SSD What do you suggest?
[Shield Android TV General] Luxferro:
Actually it won't work for any other drives but those with the exact number of sectors and bytes of space, unless you are good with a hex editor to edit the GPT header at the last sector of the hard drive, as well as the partition end point for /data partition in the partition entries (to reflect new size).

You also have the edit the 2 entries for the primary and secondary GPT Header locations (which are the same) for the new location where it will be on the hard drive (last sector,512 bytes, on the new sized disk) . And then have to calculate the new CRC32B entries for both the GPT Header and partition entry array within the GPT Header, but before calculating the CRC32B for the GTP Header, you have to zero out the 4 bytes where the CRC32B will be stored, calculate it (with it zeroed out), then write it back to that spot.

I pretty much reverse engineered the whole partition layout yesterday, using a hex editor (on my complete dd dump of my HD), and fstab tables from unpacked boot.img for the shield 500GB (helped with names of partitions in notes column). There's 32 partition entries, some of those partitions aren't used (zeroed out).

I plan to give it a try with a smaller drive at some point - just don't like to keep opening up my shield, since it works well with the new SSD.

edit: forgot to mention that the location point for the start of the partition entries would also need to be edited in the header to reflect where it is located on a different size hard drive.
[Shield Android TV General] hallydamaster:
My suggestion is:

DD the first part bin file as described in the first post. Then you have to calculate the block number from the total block count of your SSD.

In terminal do:

sudo -s

fdisk -l

This will give you a total block count of the SSD, by my calculations it should be 498528248, but better check for yourself.

Then substract 198538 which gives 498329710.

Then DD the end_976574630.bin:

dd if=end_976574630.bin of=/dev/sdX seek=498528248

Now the SSD has been written, but the secondary GPT header in the end of the drive will have incorrect values, so possibly it cannot boot, but it is worth a try.

If it doesn't, you can load the SSD up in testdisk (apt-get install testdisk) and make it analyze the disk. This gives you the option to write new GPT headers on the disk.

This will correct the GPT headers, but the disk now certainly will not boot in the Shield because Nvidia has done some screwing up of the beginning of the disk.

But you can try DD'ing the first 100 MB of start.bin (or just the entire first.bin) and possibly this will make it bootable in the Shield.

If it still does not work, you can try to boot it into fastboot and flash the recovery image from there. This might just work!? :)
[Shield Android TV General] Luxferro:
Won't work, see my post before yours :P

You can't use any GTP Headers that are recreated by the usual tools, since they will have pointers to a primary GPT header that won't exist. The GTP header location entries (both primary entry and secondary entry) both point to the location of the secondary GTP header (on nvidia's drive). If you use any tools that try to recreate the primary GTP header, they will mess up the /BCT partition, and then also the secondardy GTP Header will point to a primary GTP header that doesn't exist.
[Shield Android TV General] hallydamaster:
That's some great work you put into that.

I am not at all saying it should work out of the box, but we could be hopeful that it will be possible with the correct steps.

Let's just say that there is no primary GPT header in the SATV HDD, then testdisk can do all the calculations of the GPT header in the end of the disk.

Then just write over the first partition in the beginning of the disk with DD and hoping that will be enough!?

EDIT: Just read your last answer. I can see now why that wont work...
[Shield Android TV General] Luxferro:
You ignoring a key point I tried to make. Check out the format of a GPT header here: https://en.wikipedia.org/wiki/GUID_Partition_Table

within the header (in our case, there's only a secondary header), there are 2 entries for the primary and secondary GPT Headers. On nvidia's hard drive both those entries point to the location of the secondary header.

24 (0x18)	8 bytes	Current LBA (location of this header copy)
32 (0x20)	8 bytes	Backup LBA (location of the other header copy)

On nvidia's HD, they both point to sector 976,773,167. If you use tools to create headers, then the secondary header will be changed to point to sector 1 for the primary GTP header, within the secondary GTP header, when it should point to itself (since there is no primary GTP on nvidia's HD).

Kinda confusing to explain, but I hope that helped some :confused:

edit: woops, I see you edited your post while I was writing this one :)

But I think different size hard drives can be done, but it takes a decent amount of work with a hex editor, and it will be unique for every hard drive that is a different size.
[Shield Android TV General] hallydamaster:
Yes, I absolutely see what you mean now! ;)

So, let's say we DD over the first part of the HDD to a smaller SSD. Then forget all about the last part of the drive... Is it then possible to boot it into fastboot and from there into TWRP.

Then use resize2fs from TWRP to rewrite the /DATA partition? Just a thought?
[Shield Android TV General] Luxferro:
I'm not sure how the boot process works. Does it need the info in the GTP Header and partition entries to start the boot process? If it doesn't, then I don't see why there's a point to having them, or using GTP formatting (even if it is a bit different w/ no protective MBR, primary header, and primary partition entries).

My guess is it wouldn't work. I learned a lot of new stuff in the past day. But I'm no expert. :)
[Shield Android TV General] hallydamaster:
Me too, indeed. I am not sure if it needs it or not. I was just hopeful it might be able to boot into TWRP somehow. From there you would have some options to go from.

---------- Post added at 04:47 PM ---------- Previous post was at 04:02 PM ----------

@perrin21

So, new objective! Try to do:

Then put it in the SATV and try to boot into fastboot. Flash TWRP from here:

https://www.androidfilehost.com/?fid=24421527759885891

And boot into TWRP, then go to Wipe->Advanced Wipe

Choose /DATA

and press Repair File System.

From there try to resize the partition.
[Shield Android TV General] Luxferro:
according to this link http://http.download.nvidia.com/tegra-public-appnotes/flashing-tools.html tegra devices also have a proprietary /PT partition, which contains an nvida partition table that is neither MBR or GPT. I'm not sure if this applies to the shield or not. If it does have it, that also may need to be edited.
[Shield Android TV General] hallydamaster:
Probably, probably not... Who knows.

Another idea if TWRP doesn't work, but it can boot to fastboot!

Fastboot has a format option, so it would maybe be possible to format it using:

fastboot format FS:EXT4 /data

Just a thought!
[Shield Android TV General] ahmed68:
fastboot -w

fastboot erase system -w

fastboot erase boot

fastboot erase cache

fastboot erase recovery

fastboot erase system

fastboot erase vendor

fastboot erase userdata

fastboot erase dtb

---------- Post added at 06:05 PM ---------- Previous post was at 05:55 PM ----------

this Remix OS 2.0 can use it with org sshd or other i think can use in 2tb hdd

http://www.jide.com/remixos/devices/shieldtv
[Shield Android TV General] perrin21:
its good to see that people are back on it for 256gb SSD's. Im surprised its evaded the community for this long tbh. Great work with the 500GB SSD
[Shield Android TV General] ahmed68:
this packup ver 3.2 for 500gb work very well antutu 139500 in org sshd.

https://mega.nz/#!cshkTToa!llfeAfwT7UOx88-NcTVQkukRChw7Xv4RZCJty90-aeI

https://yadi.sk/d/M_LLC3lztjq5p
[Shield Android TV General] Sub-Negro:
Would this SSD work?

http://nashville.craigslist.org/sys/5707173197.html

It does seem to be a bit overkill if I did I might be better off getting that and putting my CRUCIAL MX100 in there It's 512GB I think
[Shield Android TV General] hallydamaster:
Well, we have yet to figure how to make it work with anything other than 500 GB disks.

So for the time being, no.
[Shield Android TV General] visitor29:
done several times cloning over and over, but one issue still exist ---- when running shield unplug and plug power cord (cold restart) shield not boot with first , it boot in apx mode then after have to turn off on on with touch power button and then only nvida logo apperas ... .

1: lsblk

2: dd if=/dev/sdX of=/dev/sdY bs=64K conv=noerror,sync

new terminal: to see process of

1: watch -n5 'sudo kill -USR1 $(pgrep ^dd)'

this command found useful ---- from original sshd to strait ssd, without creating img file, strait clone.
[Shield Android TV General] Luxferro:
I hacked up a version for my 256GB msata drive with a hex editor (have a nice mstata to 2.5" SSD PCB/enclosure for it). edited the Partition Entry end point location for new size of /data, as well as the new values in the GPT Header, along with the new CRC32's. Haven't gotten around to swapping it in to try yet... will likely try at some point today.
[Shield Android TV General] ahmed68:
https://mega.nz/#!45Y20KSa!nBcl9Txe-LVF2M75DGIVHtJM_UuntqPkrJKD-Gwmadk

ok today I but in mega drive the img saw its only boot to fastboot by dd flash it for any drive then

1.fastboot erase boot

fastboot erase cache

fastboot erase recovery

fastboot erase system

fastboot erase vendor

fastboot erase userdata

fastboot erase dtb

2.fastboot flash staging blob

fastboot flash boot boot.img

fastboot flash dtb tegra210-foster-e-hdd-p2530-0932-e02-00.dtb

power off the shield

3. boot to fastboot

fastboot -w

fastboot flash recovery recovery.img

fastboot flash system system.img

fastboot flash vendor vendor.img

use the dtb with dm5sum:

02fa295091e044d276bb998c2b5c9c04 tegra210-foster-e-hdd-p2530-0932-e02-00.dtb

you can find it here https://mega.nz/#!d0YBBIgb!0_ubz7FYOfLTkqQNqH7vyb-AE1CUIFPdBwLkO7Oeo80

the original dtb not correct I test it by WinMD5

about dtb you can go to yahoo2016 (Build kernel from source and boot to Ubuntu using L4T (Linux for Tegra) rootfs)

if I wont to make img for 2tb hdd I must have other hdd more than 2tb but I haven't.

that's all