[ATV1] HOW-TO install Sam's image to internal Apple TV harddrive

  Thread Rating:
  • 2 Votes - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
Romey-Rome Offline
Junior Member
Posts: 38
Joined: May 2009
Reputation: 0
Post: #61
Here's what I get now on first boot after doing the internal install. (when it runs initialize.sh)

http://i56.tinypic.com/wu5dg3.jpg
find quote
fahadmp Offline
Junior Member
Posts: 10
Joined: Feb 2011
Reputation: 0
Post: #62
i ran the script on my usb drive (dev/sdc1) and i get this at the end of it:

Code:
Extracting image and imaging device
7550976+0 records in
7550976+0 records out
3866099712 bytes (3.9 GB) copied, 2966.27 s, 1.3 MB/s
Resync
Error: The backup GPT table is not at the end of the disk, as it should be.  This might mean that another operating system believes the disk is smaller.  Fix, by moving the backup to the end (and removing the old backup)?
Warning: Not all of the space available to /dev/sdc1 appears to be used, you can fix the GPT to use all of the space (an extra 8099870 blocks) or continue with the current setting?
Error: Error informing the kernel about modifications to partition /dev/sdc1p1 -- Invalid argument.  This means Linux won't know about any changes you made to /dev/sdc1p1 until you reboot -- so you shouldn't mount it or use it in any way before rebooting.
Error: Failed to add partition 1 (Invalid argument)
Mounting device
mount: special device /dev/sdc13 does not exist
Injecting OS distro choice
chmod: cannot access `mnt/.distro': No such file or directory
Unmounting, clean up
umount: /dev/sdc13: not found

also how do i go about editing the appletv com.apple.Boot.plist if i am stuck at the "waiting for root file system" screen?
(This post was last modified: 2011-03-16 06:11 by fahadmp.)
find quote
Romey-Rome Offline
Junior Member
Posts: 38
Joined: May 2009
Reputation: 0
Post: #63
jumpcuts Wrote:You lost me on the tty via usb part...

He means plug in a USB keyboard to the aTV, then either exit XBMC, or hit ctrl+alt+F2.

And yes, SSH is broken on the USB install. Access denied.
find quote
pmcd Offline
Fan
Posts: 330
Joined: May 2008
Reputation: 1
Post: #64
Romey-Rome Wrote:He means plug in a USB keyboard to the aTV, then either exit XBMC, or hit ctrl+alt+F2.

And yes, SSH is broken on the USB install. Access denied.

Hmm ... I seem to be able to ssh into mine. I used a USB install to both a hard drive and a flash drive. user=atv, passwd=atv

philip
find quote
chris_b Offline
Junior Member
Posts: 13
Joined: Feb 2011
Reputation: 0
Post: #65
Sam.Nazarko Wrote:That is strange. It would appear the DNS resolution was successful: "svn.stmlabs.com:87.106.100.246:80", yet you still get a 404 return code. Try wget to obtain the file manually.
The username and password are atv-atv. You can login with a tty session using the USB port for verification. Your SSH is not working for some other reason - which is likely linked to your network problem. Does the initialisation script work on a PC, i.e. can you fetch the files aTV is trying to fetch from your machine? This will indicate where the fault lies

I have the same problem. apt-get update works, so I am able to fetch files from the hardy repositories. I can ssh into the machine from another machine on the local network.

Edit: got wget to work by omitting the "http://" Now the crystalhd script won't run because "zenity" isn't recognized. I think I will just read the contents of the script and enter them manually.

Edit2: just for giggles I tried to install zenity--it took about 30 minutes, pages of errors along the way. When it finally finished installing it still wouldn't run. Now downloading the installer .gz file as per script contents. Have to omit http:// or I get the 404 error as before when fetching the original script.
(This post was last modified: 2011-03-16 17:51 by chris_b.)
find quote
bigjuggler Offline
Junior Member
Posts: 34
Joined: Aug 2004
Reputation: 0
Post: #66
[quote=Sam.Nazarko]The script is supposed to resize even if using a USB install only. I checked the script and I noticed an abstractionism mistake: I used an absolute reference to /dev/sdb after calling partprobe which means if your USB HDD was not at /dev/sdb then the partitions would not have synchronised, thus the resize commands would have failed.


Hi Sam,

Just to offer some feedback, I saw the change you noted above. I reran the terminal commands:

wget http://svn.stmlabs.com/svn/crystalhd-for...ystalhd.sh
chmod +x crystalhd.sh
sudo ./crystalhd.sh

on a 40GB hard drive last night with the same results: entire drive is formatted as 4GB in size with a large unallocated block at the end.

Is there something else I need to do on my end to change the install script? Would the output of the terminal be useful to you? (I did not save it, but could reformat the drive again and copy it for you).

The drive boots ATV fine, installs 10.1 Dharma and all is lovely and I can ssh in with atv/atv.

Thanks again.

Craig
find quote
bigjuggler Offline
Junior Member
Posts: 34
Joined: Aug 2004
Reputation: 0
Post: #67
pmcd Wrote:Have a look at my reply to Sam. You don't need the patched parted for what you are trying to do ( which is also what I am trying to do). I ran parted from a shell on a Ubuntu 10 box. I assume Live would work. I outlined exactly what I had to do to fill up the space, and it works. Mind you, the swap size remains at 512megs. I don't know if that is sufficient.

philip

Hi Philip,

Thanks for the advice. Just a bit of clarification, since I am a real Linux noob, so if anyone wants to hold my hand:

I ran gparted and found that the third partition on my drive starts at sector 1118248. So, if I launch the terminal, is this what I should type:

parted
unit s
rm 3
mkpart primary 1118247
q

sudo e2fsck -f /dev/sdb3
sudo resize2fs /dev/sdb3

Can I do all this to the drive, even after I have booted the ATV with it and it installs Dharma 10.1. With the download, it takes about 3 hours to format the drive, so I want to make sure this is right before I mess with it.

Thanks so much.

Craig
find quote
Roders Offline
Member
Posts: 71
Joined: Oct 2009
Reputation: 0
Location: Northern Ireland
Post: #68
How does sam's image handle an external usb hard drive? I use an unraid server myself, but a friend would like me to install this on his atv and his media is stored on an external drive. Does it just plug in and work?
find quote
Sam.Nazarko Offline
Posting Freak
Posts: 851
Joined: Dec 2009
Reputation: 15
Location: London
Post: #69
fahadmp Wrote:i ran the script on my usb drive (dev/sdc1) and i get this at the end of it:

Code:
Extracting image and imaging device
7550976+0 records in
7550976+0 records out
3866099712 bytes (3.9 GB) copied, 2966.27 s, 1.3 MB/s
Resync
Error: The backup GPT table is not at the end of the disk, as it should be.  This might mean that another operating system believes the disk is smaller.  Fix, by moving the backup to the end (and removing the old backup)?
Warning: Not all of the space available to /dev/sdc1 appears to be used, you can fix the GPT to use all of the space (an extra 8099870 blocks) or continue with the current setting?
Error: Error informing the kernel about modifications to partition /dev/sdc1p1 -- Invalid argument.  This means Linux won't know about any changes you made to /dev/sdc1p1 until you reboot -- so you shouldn't mount it or use it in any way before rebooting.
Error: Failed to add partition 1 (Invalid argument)
Mounting device
mount: special device /dev/sdc13 does not exist
Injecting OS distro choice
chmod: cannot access `mnt/.distro': No such file or directory
Unmounting, clean up
umount: /dev/sdc13: not found

also how do i go about editing the appletv com.apple.Boot.plist if i am stuck at the "waiting for root file system" screen?

This failed because you referenced a drive number! The default is /dev/sdb, and your device is /dev/sdc, what made you think you needed to add a 1 at the end. The script needs to reference the whole drive not one partition, and will append drive numbers automatically. Just use /dev/sdc

Romey-Rome Wrote:He means plug in a USB keyboard to the aTV, then either exit XBMC, or hit ctrl+alt+F2.

And yes, SSH is broken on the USB install. Access denied.

SSH is not broken.

bigjuggler Wrote:Hi Philip,

Thanks for the advice. Just a bit of clarification, since I am a real Linux noob, so if anyone wants to hold my hand:

I ran gparted and found that the third partition on my drive starts at sector 1118248. So, if I launch the terminal, is this what I should type:

parted
unit s
rm 3
mkpart primary 1118247
q

sudo e2fsck -f /dev/sdb3
sudo resize2fs /dev/sdb3

Can I do all this to the drive, even after I have booted the ATV with it and it installs Dharma 10.1. With the download, it takes about 3 hours to format the drive, so I want to make sure this is right before I mess with it.

Thanks so much.

Craig

Resizing works by default.

Roders Wrote:How does sam's image handle an external usb hard drive? I use an unraid server myself, but a friend would like me to install this on his atv and his media is stored on an external drive. Does it just plug in and work?

Perhaps. Remember if you have two drives connected you will have to ensure the internal one is still /dev/sda
find quote
pmcd Offline
Fan
Posts: 330
Joined: May 2008
Reputation: 1
Post: #70
bigjuggler Wrote:Hi Philip,

Thanks for the advice. Just a bit of clarification, since I am a real Linux noob, so if anyone wants to hold my hand:

I ran gparted and found that the third partition on my drive starts at sector 1118248. So, if I launch the terminal, is this what I should type:

parted
unit s
rm 3
mkpart primary 1118247
q

sudo e2fsck -f /dev/sdb3
sudo resize2fs /dev/sdb3

Can I do all this to the drive, even after I have booted the ATV with it and it installs Dharma 10.1. With the download, it takes about 3 hours to format the drive, so I want to make sure this is right before I mess with it.

Thanks so much.

Craig

As Sam mentioned the script works automatically now so there is no need to do it manually. Just in case though, when you run parted from the cli you will first type

parted
unit s
print ( so you can see where the partitions are in sector notation)
rm 3
mkpart primary (number you see as start for 3 in print) -1
etc...

The -1 just fills the whole thing up and avoids having to put the end number in.

philip
find quote
pmcd Offline
Fan
Posts: 330
Joined: May 2008
Reputation: 1
Post: #71
Ok, everything works great from a flash drive booting the USB. Unfortunately when booting from an external USB drive XBMC cannot recover if the drive goes to sleep ( as a notebook drive would). Is this supposed to happen? I guess there is no way for xbmc to wake up the usb drive.

philip
find quote
pmcd Offline
Fan
Posts: 330
Joined: May 2008
Reputation: 1
Post: #72
Sam.Nazarko Wrote:Resizing works by default.

It still seems to not work in the USB case if you just let it do its thing. I just ran everything again ( used wget, etc...). It gets to a point and says

Code:
Resync
Error: The backup GPT table is not at the end of the disk, as it should be.  This might mean that another operating system believes the disk is smaller.  Fix, by moving the backup to the end (and removing the old backup)?
Warning: Not all of the space available to /dev/sdb appears to be used, you can fix the GPT to use all of the space (an extra 148750512 blocks) or continue with the current setting?


I assume had I been there I could have answered appropriately, but in the end it produced a 4 gig space on an 80 gig drive. It left 70 gigs or so unallocated.

Code:
Resizing file system
e2fsck 1.41.11 (14-Mar-2010)
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
Linux: 37065/204800 files (1.0% non-contiguous), 179559/803822 blocks
resize2fs 1.41.11 (14-Mar-2010)
The filesystem is already 803822 blocks long.  Nothing to do!


philip
find quote
bigjuggler Offline
Junior Member
Posts: 34
Joined: Aug 2004
Reputation: 0
Post: #73
[quote=pmcd]It still seems to not work in the USB case if you just let it do its thing.

Seconded. This is the same thing I have been seeing. I have run the script 4 times on 3 different devices (2 usb hard drives, 1 flash drive) and every time it has resulted in a drive formated to 4GB in size with a large unallocated space at the end of the drive.

I get the same error messages you are seeing Philip.

Cheers,

Craig
find quote
fahadmp Offline
Junior Member
Posts: 10
Joined: Feb 2011
Reputation: 0
Post: #74
Sam.Nazarko Wrote:This failed because you referenced a drive number! The default is /dev/sdb, and your device is /dev/sdc, what made you think you needed to add a 1 at the end. The script needs to reference the whole drive not one partition, and will append drive numbers automatically. Just use /dev/sdc

Code:
Error: The backup GPT table is not at the end of the disk, as it should be.  This might mean that another operating system believes the disk is smaller.  Fix, by moving the backup to the end (and removing the old backup)?
Warning: Not all of the space available to /dev/sdc appears to be used, you can fix the GPT to use all of the space (an extra 8112128 blocks) or continue with the current setting?
Error: Error informing the kernel about modifications to partition /dev/sdc2 -- Device or resource busy.  This means Linux won't know about any changes you made to /dev/sdc2 until you reboot -- so you shouldn't mount it or use it in any way before rebooting.
Error: Failed to add partition 2 (Device or resource busy)
Mounting device
mount: special device /dev/sdc3 does not exist
Injecting OS distro choice
chmod: cannot access `mnt/.distro': No such file or directory
Unmounting, clean up
umount: /dev/sdc3: not found

i tried as you said and this is what the output was. Maybe something else is going on..i'm gonna continue to play with it
find quote
Wikking Offline
Junior Member
Posts: 30
Joined: Aug 2010
Reputation: 1
Post: #75
while trying the installer (internal hdd) i found and corrected some errors.

1. disk will not be resized whatsoever. exactly the same size as the usb image
2. all references are wrong (should be sda*, is sdb*). this concerns the bootlist and fstab, mtab <-- that's why people are reporting a non booting system when installing it on the internal drive

my guess is that the diskimage in http://download.stmlabs.com/atv-images/i...ler.img.gz is just the regular usb image. that's why the references are wrong.

after manually changing the references the system boots and all is well. hope this helps.
find quote
Post Reply