Notes on booting plug with large HDDs > 2TB

Support for your TonidoPlug
Tuxedo
Tonido Team
Tonido Team
Posts: 1458
Joined: Wed Jan 28, 2009 11:30 pm

Notes on booting plug with large HDDs > 2TB

Postby Tuxedo » Tue Jan 18, 2011 10:02 pm

This section is created by user agarajag
Profile: http://tonido.com/forum/memberlist.php?mode=viewprofile&u=1407

After some more testing i've got some Updates for you:

  1. I've deleted all partitions and partition tables from the HDD, to start from a fresh environment. Than i added only a MBR partitiontable with just one 2GB partition and formated it with ext3. Than i copied over the bootsystem from the Stick again.
    And...
    ... the HDD boots from the HDD :!:

    So i think the HDD Spin-Up is NOT the Problem here.

  2. After that i just want to know, if the GPT is the Problem.
    So i removed all partitiontables from the Stick (remember: it worked just fine before).
    I added only a GPT partitiontable with one ext3 partition.
    Copied over the Bootsystem and...
    ...The Stick doesn't boot anymore :cry:

So what we know so far:
  • Does TonidoPlug support GPT?
    Yes.
  • Does TonidoPlug support partitions >2TB?
    Yes, if the partitiontable is GPT.
  • Does TonidoPlug boot from a GPT partitiontable?
    No, it doesn't. TonidoPlug Boots only from MBR partitions.
  • Does TonidoPlug boot from partitions >2TB
    No, because it only boots from MBR based partitions and they're limited to 2TB.

I think you could add this to your docs and to your FAQs ;)

But we know just more:
We're able to mixup MBR and GPT based Partitiontables with "gptsync".
But sadly the first MBR partition will be the link to the GPT-Table and the Plug boots only from the first partition (which becomes the 2nd in MBR, in GPT still the 1st).

So here are the possible Sollutions (and one workaround):
  1. Make the Plug boot from GPT partitions.
    Any Ideas how to do that, or if it's possible?
  2. Make the Plug boot from the 2nd MBR partition.
    Same here.
  3. Move the GPT link in MBR to the 2nd entry
    Possible? Ideas? HowTo?
  4. What about to add an "extended" partition to the MBR and add GPT to that?
    Possible? (Is "extended" working this way?)
  5. Workaround: Add an MBR-table with a small system partition and splitt up the rest in 2TB partitions.
    On Tonido build an LVM with the splitted 2TB partitions and add an 4TB+ logical volume with a 4TB+ GPT partition on it :ugeek:

    Silly and ugly, but will work

Any other solutions are welcome.

And now i'm going to eat something :!:

User avatar
agrajag
Veteran Tonidoid
Veteran Tonidoid
Posts: 77
Joined: Tue Dec 14, 2010 9:25 am

Re: Notes on booting plug with large HDDs > 2TB

Postby agrajag » Wed Jan 19, 2011 6:34 am

So after some googling i found that you can customize the uBoot process through an "Serial-Console-Cable".
And here i found exactly, what i'm searching for:

Now we are ready to reboot. Type reboot and wait for the Marvell count down to appear and hit any key to stop the autoboot.
Now at the Marvell command prompt type
set x_bootargs_root root=/dev/sdc2 rootdelay=10
Be sure to use the correct root= line for your drive. This may be sda1 or sdb1 or even sdc1.
Next type boot and hit enter

from:http://www.errr-online.com/index.php/2010/05/29/guruplug-server-plus-booting-from-esata/

So if i understand that right this guy is changing the bootprocess to boot from an different partition.

Here are some more interesting links for uBoot:
http://www.plugcomputer.org/plugwiki/in ... ug_support
http://www.plugcomputer.org/plugwiki/in ... g_Computer
http://www.cyrius.com/debian/kirkwood/s ... grade.html
http://www.cyrius.com/debian/kirkwood/s ... /boot.html
http://plugcomputer.org/plugforum/index.php?topic=891.0
http://plugcomputer.org/plugforum/index ... pic=2544.0
http://plugcomputer.org/plugforum/index.php?topic=131.0

I would do some testing, but i think i'll lose my guaranty on the Plug, if i try to hack the uBoot-process.
So i think it's up to you tonido-guys to find an "official way" (update/patch/howto) to make the uBoot boot from another partition than the 1st (or to boot from a GPT partition) without breaking the guaranty.
Or you can send me a free-tonidoplug for doing some experiments on it :mrgreen: (i don't want to brick my own Plug)

User avatar
agrajag
Veteran Tonidoid
Veteran Tonidoid
Posts: 77
Joined: Tue Dec 14, 2010 9:25 am

Re: Notes on booting plug with large HDDs > 2TB

Postby agrajag » Wed Jan 19, 2011 8:05 am

[*]What about to add an "extended" partition to the MBR and add GPT to that?
Possible? (Is "extended" working this way?)


No, that won't work.
The "extended" partition in this case would be a >2TB, too.
So we can remove possible solution #4 from the list.

User avatar
agrajag
Veteran Tonidoid
Veteran Tonidoid
Posts: 77
Joined: Tue Dec 14, 2010 9:25 am

Re: Notes on booting plug with large HDDs > 2TB

Postby agrajag » Fri Jan 21, 2011 8:09 am

OK.
Found something new on the web:
http://www.rodsbooks.com/gdisk/hybrid.html
http://www.rodsbooks.com/gdisk/walkthrough.html

I think i will do some experiments this evening.

User avatar
agrajag
Veteran Tonidoid
Veteran Tonidoid
Posts: 77
Joined: Tue Dec 14, 2010 9:25 am

Re: Notes on booting plug with large HDDs > 2TB

Postby agrajag » Mon Jan 24, 2011 3:42 pm

Yippiieeeeeee!!!!!
I've got this working!
:mrgreen: :mrgreen: :mrgreen: :mrgreen: :mrgreen:
Hail to the King, Baby!

The Trick is, to move the GPT Link in the MBR-Table to the 2nd partition (Solution Nr. 2 in my previous posts).
But the "gptsync"-Tool adds the GPT-Link everytime to the 1st partition.
But i found the solution within the link i posted in my last post:
http://www.rodsbooks.com/gdisk/hybrid.html

With the "gdisk"-Tool it's possible to add the GPT link to another MBR-entry than the 1st.
And...
...It workes!

I'm now booting from my 4TB HDD (of corse from an extra system-Partition on it).

So here comes the HowTo:

Note: I did the Following Steps on my Ubuntu-desktop, not from the Plug.

1. install the "gdisk" Tool:

Code: Select all

sudo apt-get install gdisk


2. Prepare your Disk

Note: Don't forget to unmount all partitions on the Drive!
Note: All your Data will get lost!

You can do the follwing steps with the new "gdisk"-Tool, too.
But i'm more familiar with "parted", so i will use this for the next steps.

Code: Select all

sudo parted /dev/sdX

Replace the X with your device letter (in my case "sdb").

3. Remove all partitions from the disk

Code: Select all

 (parted) print

This command shows you all partitions.
In my case there are two partitions (my Ubuntu-Desktop is german, so the output may differ on your System):

Modell: JMB352 JBOD (scsi)
Festplatte /dev/sdb: 4001GB
Sektorgröße (logisch/physisch): 512B/512B
Partitionstabelle: gpt

Anzahl Beginn Ende Größe Dateisystem Name Flags
1 17,4kB 2000MB 2000MB ext3 TonidoSys
2 2001MB 4001GB 3999GB ext3 TonidoData


Now delete them:

Code: Select all

(parted) rm 2

Code: Select all

(parted) rm 1


4. Add a GPT Table to the disk:

Code: Select all

(parted) mklabel gpt


Answer the following question with "yes":

Warnung: Die bestehende Partitionstabelle und alle Daten auf /dev/sdb werden
gelöscht. Wollen Sie fortfahren?
Ja/Yes/Nein/No? yes


5. add two partitions to the disk:

Code: Select all

(parted) mkpart primary ext3 0 2GB


If you see the following message type "ignore:

Warnung: The resulting partition is not properly aligned for best performance.
Ignorieren/Ignore/Abbrechen/Cancel? ignore


Code: Select all

(parted) mkpart primary ext3 2GB 100%


Now you can check the new Table:

Code: Select all

(parted) print


It should be like this:

Modell: JMB352 JBOD (scsi)
Festplatte /dev/sdb: 4001GB
Sektorgröße (logisch/physisch): 512B/512B
Partitionstabelle: gpt

Anzahl Beginn Ende Größe Dateisystem Name Flags
1 17,4kB 2000MB 2000MB ext3 primary
2 2001MB 4001GB 3999GB ext3 primary


Now you can exit "parted"

Code: Select all

(parted) quit


6. Format the new partitions

Code: Select all

sudo mkfs.ext3 /dev/sdX1
sudo mkfs.ext3 /dev/sdX2

Replace X with you device letter.

7. Here comes the main Trick: Now make a hybrid MBR+GPT Table

Code: Select all

sudo gdisk /dev/sdX

Replace X with you device letter.

On the gdisk prompt type "r"

Code: Select all

Command (? for help): r


Now the prompt changes. Type p to print the partitiontable:

Code: Select all

recovery/transformation command (? for help): p


You should see something similar to this:

Disk /dev/sdb: 7814058304 sectors, 3.6 TiB
Disk identifier (GUID): 327B4A48-FB98-4FC0-AE8D-74B3276E3236
Partition table holds up to 128 entries
First usable sector is 34, last usable sector is 3519090974
Total free space is 1620 sectors (810.0 KiB)

Number Start (sector) End (sector) Size Code Name
1 34 3906250 1.9 GiB 0700 primary
2 3907584 3519090687 3.6 TiB 0700 primary


Now type "h" to make a hybrid partitiontable:

Code: Select all

recovery/transformation command (? for help): h


You will see a warning and you will be asked to type in the Partitions you want to add to the MBR-Table. In our case we only want the 1st partition, so we only type "1".

Code: Select all

WARNING! Hybrid MBRs are flaky and potentially dangerous! If you decide not
to use one, just hit the Enter key at the below prompt and your MBR
partition table will be untouched.

Type from one to three GPT partition numbers, separated by spaces, to be
added to the hybrid MBR, in sequence: 1


And now comes the Important Question, witch did the trick. I must answer this with :!: "N" :!:

Code: Select all

Place EFI GPT (0xEE) partition first in MBR (good for GRUB)? (Y/N): N


This adds the GPT link after the other MBR partitions.
If you answer with "y" the GPT-Link will be added to the 1st.

For the following Question you can use the default (just press enter):

Code: Select all

Enter an MBR hex code (default 07):


Next you will be asked, if you want to add the Bootflag to the 1st partition. Type "y".

Code: Select all

Set the bootable flag? (Y/N): Y


Now you will be asked, if you want the "free" space (it's your GPT-Partition in real) to mark as used in the MBR. I think you should answer this with "Y", but the tool crashes on that.
And therefor you type "N".

Code: Select all

Unused partition space(s) found. Use one to protect more partitions? (Y/N): N


Print out the MBR Table to check it:

Code: Select all

recovery/transformation command (? for help): o


It should show up like this:

MBR disk identifier: 0x00000000
MBR partitions:
Number Boot Start (sector) Length (sectors) Type
1 * 34 3906217 0x07
2 1 33 0xEE

Disk size is 7814058304 sectors (3.6 TiB)


Finally write the changes to disk:

Code: Select all

recovery/transformation command (? for help): w


You will see a Warning. Type "Y".

Code: Select all

Final checks complete. About to write GPT data. THIS WILL OVERWRITE EXISTING
MBR PARTITIONS!! THIS PROGRAM IS BETA QUALITY AT BEST. IF YOU LOSE ALL YOUR
DATA, YOU HAVE ONLY YOURSELF TO BLAME IF YOU ANSWER 'Y' BELOW!

Do you want to proceed, possibly destroying your data? (Y/N) Y


Done!

8. Now build a tonido Bootsystem on the first 2GB partition.

I don't want to describe the process again. You'll find it in other threads, for example here:

viewtopic.php?f=32&t=2217

(You'll only need the first part.)

9. Finally: Add a mountpoint to fstab

Now we want the 2nd (4TB) partition to be automounted on startup.
The most safety way is to use the UUID of the partition.
So let's show up our UUIDs:

Code: Select all

sudo ls -l /dev/disk/by-uuid


This lists all your partitions UUIDs.

insgesamt 0
lrwxrwxrwx 1 root root 10 2011-01-14 20:05 124ae392-7cd6-41ad-aa22-3dda9f25c7aa -> ../../sdb2
lrwxrwxrwx 1 root root 10 2010-11-23 09:55 30730ec1-a72f-4b6a-8afe-22b98ab0bce7 -> ../../sda5
lrwxrwxrwx 1 root root 10 2011-01-14 20:04 51c3f729-e535-43a2-856f-51b2992f3dd9 -> ../../sdb1
lrwxrwxrwx 1 root root 10 2010-11-23 09:55 bbce16ba-6514-4199-b2e5-0ddf1413ec78 -> ../../sda1


Look for your partition and copy the UUID.

Now edit the fstab of your new tonido bootdevice (i've mounted the Sys-Partition to "/media/TonidoSys". So in this case you've to edit "/media/TonidoSys/etc/fstab"

Code: Select all

sudo nano /media/TonidSys/etc/fstab


Add the following line at the end of the file:

Code: Select all

UUID=124ae392-7cd6-41ad-aa22-3dda9f25c7aa  /media/disk1part1  ext3  defaults 0 0

Replace the UUID (behind the "=") with yours.

Ok this might be confusing. Im mounting the 2nd partition of the HDD to disk1part1. But since the 1st partition will be mounted as root-system, we should skip this.

10. Now unmount everything, connect the Disk to your Plug and start it.

Now it's time for a Beer :ugeek:

User avatar
madhan
Admin Tonidoid
Admin Tonidoid
Posts: 8617
Joined: Tue Dec 30, 2008 12:13 am
Location: Austin, TX, USA
Contact:

Re: Notes on booting plug with large HDDs > 2TB

Postby madhan » Mon Jan 24, 2011 6:53 pm

Pretty Awesome! :D

rydgaze
Tonido Team
Tonido Team
Posts: 1354
Joined: Wed Jan 28, 2009 11:26 pm

Re: Notes on booting plug with large HDDs > 2TB

Postby rydgaze » Mon Jan 24, 2011 7:02 pm

Now it's time for a Beer :ugeek:


I concur good sir!


Return to “TonidoPlug Support”

Who is online

Users browsing this forum: No registered users and 9 guests