Welcome! Log In Create A New Profile

Advanced

Support for a multi boot?

Posted by habibie 
Support for a multi boot?
February 09, 2015 10:23AM
I wonder if this is possible to achieve through u-boot.

I have a Seagate GoFLEX Home with a 1 TB HDD that I have created 3 partition on it, i.e. 30GB on 1st partition (EXT4 format), 2GB on 2nd partition (SWAP format), and the rest on 3rd partition (EXT4 format). I want to create /alarm, /debian, and /openwrt sub-directories on the 1st partition and install ARM Linux, Debian, and OpenWRT into the respective sub-directory. Then, configure u-boot to default booting openwrt from /openwrt sub-directory. If needed, a small scripting file is needed to run at the current boot to switch which OS to boot at the next reboot.
Re: Support for a multi boot?
February 09, 2015 01:52PM
habibie,

It would be easier to do if you have individual partition for each OS. Then it is just standard installation where u-boot controls which patition to load appropriate kernel. There is also the issue of mounting rootfs. You would need initrd for each rootfs so that it can be mounted properly. So it is possible, but the needed customization is not just with u-boot alone.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)



Edited 1 time(s). Last edit at 02/09/2015 01:52PM by bodhi.
Re: Support for a multi boot?
February 09, 2015 11:13PM
Hello Bodhi,

I was hoping to be able to achieve this with a single primary partition for many different OSes, i.e. not limited to 3 OSes as I mentioned above. If I go with your suggestion, perhaps it will be limited to 4 different OSes due to limitation of 4 primary partitions (don't know if logical partition will work)?
Re: Support for a multi boot?
February 11, 2015 01:22PM
habibie,

If you switch to GPT then you can have 128 partitions!

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Support for a multi boot?
February 13, 2015 09:41AM
Hello Bodhi,

Thank you for your suggestion on GPT. Is this GPT the same as the gdisk on a debian Wheezy (v7.1.xx)?

Currently, I have a 1TB SATA HDD on a Seagate GoFLEX Home flashed with ArchLinux ARM (including the uboot from ArchLinux ARM). If I format my 1TB SATA HDD with gdisk (which will replace its MBR with GPT format), will the existing uboot from ArchLinux ARM be able to work with the 1 TB SATA HDD formatted with GPT or do I also need to upgrade the current uboot from ArchLinux ARM to yours?
Re: Support for a multi boot?
February 13, 2015 02:19PM
habibie Wrote:
-------------------------------------------------------
> Hello Bodhi,
>
> Thank you for your suggestion on GPT. Is this GPT
> the same as the gdisk on a debian Wheezy
> (v7.1.xx)?
>
> Currently, I have a 1TB SATA HDD on a Seagate
> GoFLEX Home flashed with ArchLinux ARM (including
> the uboot from ArchLinux ARM). If I format my 1TB
> SATA HDD with gdisk (which will replace its MBR
> with GPT format), will the existing uboot from
> ArchLinux ARM be able to work with the 1 TB SATA
> HDD formatted with GPT or do I also need to
> upgrade the current uboot from ArchLinux ARM to
> yours?

GPT is the disk partition fomat, gdisk is a tool for GPT.

Do you know which u-boot version? If not, when did you install it?

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Support for a multi boot?
February 13, 2015 11:17PM
Hello Bodhi,

Unfortunately, I don't know the u-boot version. IIRC, this was flashed somewhere in 8/2014 by a friend. I believe she just followed the instructions on the ArchLinux ARM site and the procedure automatically upgraded the u-boot. Right now, I don't even know if the original PogoPlug OS on the NAND space is still there or not. However, if I take out the HDD, the LED just keep flashing sans any Internet connection.

BTW, I created an ext4 partition on /dev/sda1 and my GoFLEX Home boots OK with either ArchLinux ARM and/or OpenWRT on the /dev/sda1 partition. So, it looks like the u-boot has a support for ext4.
Re: Support for a multi boot?
February 14, 2015 03:18AM
habibie,

> IIRC, this was flashed somewhere in 8/2014 by a
> friend. I believe she just followed the
> instructions on the ArchLinux ARM site and the
> procedure automatically upgraded the u-boot.

This is the later version.

> Right
> now, I don't even know if the original PogoPlug OS
> on the NAND space is still there or not. However,
> if I take out the HDD, the LED just keep flashing
> sans any Internet connection.
>

This u-boot version does not copy the original u-boot, so you can't boot Pogo OS.


> BTW, I created an ext4 partition on /dev/sda1 and
> my GoFLEX Home boots OK with either ArchLinux ARM
> and/or OpenWRT on the /dev/sda1 partition. So, it
> looks like the u-boot has a support for ext4.

IIRC, this does support GPT. So you are good to go with the plan to boot GPT.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Support for a multi boot?
February 14, 2015 09:41AM
Hello Bodhi,

I will give it a try to see how it goes. The only problem I can think of right now is do I have to make any necessary changes to the u-boot environments when migrating to GPT? What I tried to say is if GPT still uses the /dev/sdXn, where X can be a, b, c, etc. and n starts from 1 to 128?

Another question: After switching to GPT, is it possible to go back to MBR by just using the (c)fdisk to repartition the HDD?



Edited 1 time(s). Last edit at 02/14/2015 09:42AM by habibie.
Re: Support for a multi boot?
February 14, 2015 11:56AM
habibie,

> I will give it a try to see how it goes. The only
> problem I can think of right now is do I have to
> make any necessary changes to the u-boot
> environments when migrating to GPT? What I tried
> to say is if GPT still uses the /dev/sdXn, where X
> can be a, b, c, etc. and n starts from 1 to 128?

With the new u-boot, I am not aware there is any difference in the drive assignment between MBR and GPT. I can't say it with 100% certainty (need to look at code to be sure). I have never seen any changes when switching from MBR to GPT drives, though.

>
> Another question: After switching to GPT, is it
> possible to go back to MBR by just using the
> (c)fdisk to repartition the HDD?

Yes. Because you are going to wipe out partition table (the HDD) in doing this. So use a tool that allows you to select GPT/MBR type. I don't know any tool that can non-destructively change partition type.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)



Edited 1 time(s). Last edit at 02/14/2015 02:08PM by bodhi.
Re: Support for a multi boot?
February 15, 2015 11:06AM
Bodhi,

Thank you. When I get some times, I will try and report back.
Re: Support for a multi boot?
February 22, 2015 01:41PM
Hello Bodhi,

I just partitioned my 1TB HDD into 7 20-GB partitions + 1 large partition from left over using GPT (cgdisk). Then, I installed ArchLinuxARM OS on /dev/sda1. Now, it boots OK on my Seagate GoFLEX Home device. The next thing to do is to decide whether I will upgrade the existing ALARM uboot with the mainline u-boot to take the advantage of all new features or to install your latest u-boot. If you and/or anyone here can point out the pros and/or cons on either u-boots, that certainly will be great.

FYI, the partitions created by GPT are addressed as /dev/sdXn, where X=1, 2, ..., etc., and n=1, 2, ..., 128. As such, they are transparent to the existing mkfs.ext utilities, except [c]fdisk.
Re: Support for a multi boot?
February 23, 2015 12:12AM
habibie,

They are very similar in capabilities. Take your pick.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Support for a multi boot?
February 23, 2015 06:48AM
Hello Bodhi,

OK and thank you.
Re: Support for a multi boot?
February 24, 2015 02:57PM
Well, I've just remembered this: the most significant difference between the 2 u-boots is netconsole. My u-boot builds have netconsole patched (work around) and working. Arch's version does not seem to support it, iirc.

The other difference is jffs2 file system in NAND (this is a minor difference, since ubifs is preferred).

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)



Edited 1 time(s). Last edit at 02/24/2015 02:59PM by bodhi.
Re: Support for a multi boot?
February 24, 2015 07:36PM
Hello Bohdi,

Thank you and I noticed that too on ALARM forum.

I am tempted to use netconsole. However, I was told netconsole will only work for u-boot. In other words, it cease to work once the device boots Linux kernel. I was hoping it will continue to work even within Linux environment. This way, there will no need for a serial/console connection unless netconsole is dead.
Re: Support for a multi boot?
February 24, 2015 07:49PM
habibie Wrote:
-------------------------------------------------------
> Hello Bohdi,
>
> Thank you and I noticed that too on ALARM forum.
>
> I am tempted to use netconsole. However, I was
> told netconsole will only work for u-boot. In
> other words, it cease to work once the device
> boots Linux kernel. I was hoping it will continue
> to work even within Linux environment. This way,
> there will no need for a serial/console connection
> unless netconsole is dead.

True. You can only interact with netconsole during u-boot booting. But you can also see kernel boot log until it finish booting (dmesg output). Once you are inside Linux, then it is not possible to input to netconsole (iirc, there is some method to make this possbile, but it is too ugly to even try).

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Support for a multi boot?
February 25, 2015 09:45AM
bodhi Wrote:
-------------------------------------------------------
> ... (iirc, there is some method to
> make this possbile, but it is too ugly to even
> try).

If you remember the links and/or where to get such information, I sure would like to peruse it.
Author:

Your Email:


Subject:


Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.
Message: