(Marvell) migrating RAID1 from MBR (1TB) to GPT (6TB): U-Boot and GPT?

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

(Marvell) migrating RAID1 from MBR (1TB) to GPT (6TB): U-Boot and GPT?

Emanuele Olivetti
Hi,

I'm using a Marvell-based QNAP TS-219 with Debian (currently Stretch) since many years with 2 x 1TB hard disk (both with DOS/MBR partition table) in RAID1: /dev/md0 mounted as /boot and /dev/md1 with LVM hosting /  and /home.

Recently I bought 2 x 6TB hard disk, to upgrade the system. My aim is to use the two new disks instead of the old ones and migrate the system without reinstalling it. My first step was to swap one disk and exactly copy (gdisk) the partition layout from the old 1TB to the new 6TB disk and then add and synchronize the RAID1. All went well and the system boots even with only the new disk. During the second step - so swapping the second disk - I realized that... I need to use GPT partition tables and maybe something more (UEFI? Bios partition?) in order to use all 6TB and have a bootable system. BTW, the system uses U-boot. For now, I've just attempted to create a GPT partition table on the second 6TB disk and to create the two partitions for md0 and md1. The RAID1 works well as expected but, clearly, the system does not boot from this second disk alone.

What are the steps I should do in order to obtain a fully working system with the new 2x6TB disks, with GPT, without reinstalling? Unfortunately, I don't know much of how U-Boot works. 

Thanks in advance for your help,

Emanuele 
Reply | Threaded
Open this post in threaded view
|

Re: (Marvell) migrating RAID1 from MBR (1TB) to GPT (6TB): U-Boot and GPT?

Martin Michlmayr
* Emanuele Olivetti <[hidden email]> [2019-04-16 16:56]:
> I'm using a Marvell-based QNAP TS-219 with Debian (currently
> Stretch) since many years with 2 x 1TB hard disk (both with DOS/MBR
> partition table) in RAID1: /dev/md0 mounted as /boot and /dev/md1
> with LVM hosting /  and /home.

> What are the steps I should do in order to obtain a fully working
> system with the new 2x6TB disks, with GPT

With Debian on the QNAP, the Debian kernel and ramdisk are stored in
flash and not on the disk, so MBR vs GPT doesn't really matter (u-boot
won't access the disk anyway).

Generally, when moving disks on QNAP systems, you have to be aware
that we put some disk information into the ramdisk (since you cannot
pass a root= paramter via the command line easily).  In most cases,
this is the UUID= from /etc/fstab.

I cannot remember how this is done for RAIDs.  Maybe we just use
/dev/md1 in that case.

--
Martin Michlmayr
https://www.cyrius.com/

Reply | Threaded
Open this post in threaded view
|

Re: (Marvell) migrating RAID1 from MBR (1TB) to GPT (6TB): U-Boot and GPT?

Emanuele Olivetti
On Tue, Apr 16, 2019 at 5:04 PM Martin Michlmayr <[hidden email]> wrote:
With Debian on the QNAP, the Debian kernel and ramdisk are stored in
flash and not on the disk, so MBR vs GPT doesn't really matter (u-boot
won't access the disk anyway).


Martin, thanks a lot for the information! This is very good news and simplifies a lot the process.
But I am also puzzled...
 

Generally, when moving disks on QNAP systems, you have to be aware
that we put some disk information into the ramdisk (since you cannot
pass a root= paramter via the command line easily).  In most cases,
this is the UUID= from /etc/fstab.

I cannot remember how this is done for RAIDs.  Maybe we just use
/dev/md1 in that case.


...in my /etc/fstab I have:
----
# /etc/fstab: static file system information.
#
# Use 'vol_id --uuid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point>   <type>  <options>       <dump>  <pass>
proc            /proc           proc    defaults        0       0
/dev/mapper/vg00-root /               ext4    errors=remount-ro 0       1
# /boot was on /dev/md0 during installation
UUID=8ecca189-7483-4324-8de2-13f6a5ad7a8b /boot           ext2    defaults        0       2
/dev/mapper/vg00-home /home           ext4    defaults        0       2
/dev/mapper/vg00-swap none            swap    sw              0       0
----
and UUID=8ecca189-7483-4324-8de2-13f6a5ad7a8b (boot) is /dev/md0. All seems correct. But the system won't boot from the second 6TB disk alone - the one with GPT.
Maybe initrd.img is not updated and I just need to execute "update-initramfs"? I expect that I don't have to manually change initrd.img...

I'm very cautious in these steps because, as you know, it's not straightforward to fix a non-booting QNAP :-)

Best,

Emanuele

Reply | Threaded
Open this post in threaded view
|

Re: (Marvell) migrating RAID1 from MBR (1TB) to GPT (6TB): U-Boot and GPT?

Ian Campbell-5
On Tue, 2019-04-16 at 19:04 +0200, Emanuele Olivetti wrote:

> ...in my /etc/fstab I have:
> ----
> # /etc/fstab: static file system information.
> #
> # Use 'vol_id --uuid' to print the universally unique identifier for
> a
> # device; this may be used with UUID= as a more robust way to name
> devices
> # that works even if disks are added and removed. See fstab(5).
> #
> # <file system> <mount point>   <type>  <options>       <dump>
> <pass>
> proc            /proc           proc    defaults        0       0
> /dev/mapper/vg00-root /               ext4    errors=remount-ro 0  
>    1
> # /boot was on /dev/md0 during installation
> UUID=8ecca189-7483-4324-8de2-13f6a5ad7a8b /boot           ext2  
> defaults        0       2
> /dev/mapper/vg00-home /home           ext4    defaults        0    
>  2
> /dev/mapper/vg00-swap none            swap    sw              0    
>  0
> ----
> and UUID=8ecca189-7483-4324-8de2-13f6a5ad7a8b (boot) is /dev/md0. All
> seems correct. But the system won't boot from the second 6TB disk
> alone - the one with GPT.

I don't think /boot is the one which actually matters here, it's the /
one. The initramfs should have /conf/params.conf in it which should
contain ROOT="/dev/mapper/vg00-root" I think to force that (since the
uboot config doesn't know about the Debian setup).

> Maybe initrd.img is not updated and I just need to execute "update-
> initramfs"? I expect that I don't have to manually change
> initrd.img...

/etc/mdadm.conf is in the initramfs and contains a uuid (for the array
itself?). I'm unsure if this is something which might have changed with
the gpt stuff you did?

> I'm very cautious in these steps because, as you know, it's not
> straightforward to fix a non-booting QNAP :-)

Might be a good idea to test your recovery stuff first, e.g. ensure you
have copies of the current mtd stuff and can use the recovery mode to
load them over tftp etc (that's assuming you don't have serial, if you
do it's a little easier...).

You'll probably not find many people who have specific experience of
the situation you are in, so good advice might be hard to come by :-/

Ian.