:: Re: [DNG] install on a raid 1 array
Top Page
Delete this message
Reply to this message
Author: Hendrik Boom
Date:  
To: dng
Subject: Re: [DNG] install on a raid 1 array
On Thu, Jun 23, 2022 at 05:03:23PM +0100, Marjorie Roome via Dng wrote:
> Hi,
>
> On Wed, 2022-06-22 at 16:26 -0500, o1bigtenor via Dng wrote:
> > On Sat, Jun 4, 2022 at 3:03 PM Simon <linux@???> wrote:
> > >
> > > o1bigtenor via Dng <dng@???> wrote:
> > >
> > > > I have not ever installed like this so first the configuration.
> > > >
> > > > Ryzen 7 3800X
> > > > Asus TUF Gaming X570-Pro   mobo
> > > > 64 GB ram
> > > > 2 - 1 TB M2 drives
> > > > 2 - 1 TB SSDs
> > > >
> > > > I want to set the system up so that the drives are 2 sets of
> > > > Raid-1 with
> > > > (proposed)
> > > > set 1
> > > > /efi, /boot, /, /usr, /usr/local, /var, swap
> > > > set 2
> > > > /home
> > > >
> > > > How do I set up the raid arrays?
> > > > Are they set up first and then the system is installed?
> > > > Or do I set up what I want on one of each of the sets and the
> > > > copy
> > > > that setup to the second (of the set) and make it raid after
> > > > system
> > > > install?
> > > >
> > > > I can't seem to find anything done within the last 2 years
> > > > talking about this.
> > > > Don't see where it should be difficult but then - - - well I've
> > > > thought that before(!!!!) and had a boat load of male bovine
> > > > excrement
> > > > to wade through!
> > > > (So I'm asking before doing to forestall issues - - - I hope!)
> > >
> > > Others have given good information. Unless things have changed
> > > since I last did an install (couple of years I think), you can just
> > > go into manual disk partitioning and do it from there.
> > > Unfortunately, to do an optimum install means getting the
> > > calculator out as the defaults are sub-optimal …
> > >
> > > AFAIK, all disks these days are 4k sectors, or for SSD, probably
> > > bigger. Ideally you want your partitions aligned to these
> > > boundaries. So for example, leave sectors (unix 512 byte sectors)
> > > 0-63 unused, and start your first partition at sector 64. If you
> > > know that your SSD uses (say) 64k blocks internally, then leave
> > > sectors 0-127 unused and start the first partition at sector 128.
> > > From memory the partitioning tool in the installer doesn’t do this
> > > alignment unless you manually calculate all your partition start &
> > > end blocks.
> > > Everything will work fine if things are not aligned, but
> > > performance will be sub-optimal in some situations.
> >
> >
> > OK - - - finally have a working system - - - -lots of joys - - -
> > first
> > a dead psu then
> > a cabling issue (the usb3.0 front panel connector on the mobo has a
> > specific
> > installation orientation) and then the mob said there was room for 8
> > SATA drives
> > and 2 M2 drives - - - well when you use the M2 slots you lose a SATA
> > drive for
> > each - - - lots of joys and time wasted - - - if only these gotchas
> > were easier to find!!!
> >
> > Now I come to the install.
> >
> > First attempt
> > set up 2 raid 1s
> > except now I can't partition the drives
> > second attempt
> > set up 2 drives with some spacer partitions (4.0 MB each) and some 8
> > partitions
> > set up 2 drives with same spacer partitions and a large /home
> > partition
> > then wanted to make 2 raid arrays
> > - - - - except I'm only allowed to use 2 partitions  - - - -  one
> > from
> > each member
> >    of the array.
> >    (There was also complaining that there were 2 /root partitions
> > before I tried to
> >     create the array.)
> >
> > Neither of these options is what I want.
> > (This is only some couple hours down the drain - - - argh)
> >
> > So - - - how do I achieve 2 raid 1 arrays?
> > #1 has partitions for /efi, /boot, /root/, swap, /tmp, /var, /usr,
> > /usr/local
> >    with a spacer of 4.0 MB between (and before the first and after
> > each)
> > #2 has a partition for /home
> >    with a spacer of 4.0 MB between (and before the first and after)
> >
> > The destructions that I have been able to find are - - - - well - - -
> > -
> > they're mostly talking about using LVM - - - - which I have not ever
> > used.
> >
> > So - - - please - - - - what do I do besides abandon my idea?
> >
> > (There must be some kind of mystery step someplace - - - 
> > and I can't find it!!!!)
> >
> OK, this is based on what I've done myself.
>
> In the past I created multiple RAID1 partitions on the same disc pair
> for /, /home and swap. So /dev/md0 was /, /dev/md1 was /home and
> /dev/md2 was swap.
>
> More recently I changed this to 3 LVM2 partitions in a single LVM2
> physical partition/logical volume. 
>
> In principle the logical partition could span a number of physical
> partitions on one or more disk.
>
> I assume that you've created two RAID1 arrays on 2 pair of disks. 
> Lets say they are named /dev/md0 and /dev/md1.
>
> Then let dev/md1 be for /home. Just create a partition on /dev/md1 for
> /home.
>
> On the other, dev/md0 you want to put the rest of your partitions. 
> I find the number of separate partitions you want to create somewhat
> excessive but I would strongly recommend you set these up using LVM2,
> as this will mean that you can dynamically resize them if you find the
> initial sizes you have created become too small or excessively large at
> some future date.
>
> To do this you need to create a LVM2 physical partition on your
> /dev/md0, which you can then put a LVM2 logical volume and then I you
> are paranoid you may want separate partition(s) for /boot (and /efi? -
> sorry I don't use uefi) as well.
>
> You can then create your other partitions /, swap, /tmp, /var, /usr,
> /usr/local on the LVM2 logical volume. All these have UUID.
> To tie them all together you'll need to have an /etc/fstab on your /
> partition that IDs them by their UUID and has the appropriate mount
> point and a grub stanza that points to your root partition UUID to
> find your active linux-image and initrd.
>
> You could put /boot (nt sure about /efi as I don't have one?) on your
> LVM2 volume, but you'll then need to ensure that your initramfs
> contains the LVM2 as well as mdadm RAID1 filesystems or your system
> won't boot.
>
> In my case I created a separate (small) partition on my RAID1 so I
> could have a separate boot but in practice I've not needed as /boot
> worked fine even embedded within my / LVM2 partition.


I set up a separate RAID 1 pair for /boot.

I don' know if it is necessary now, but there's an older mdadm [artition
format where the RAID signature is placed at the end of th partition.

I specified this older format when I reated the RAID pair for /boot.

So when I boot, there's no problem finding the boot partition and reading it, because the important stuff that's used at boot time (i'e', the file system) is found at the start of the partition. And it doesn't matter which of the two copies I boot from becuase they are identical. All this booting is done before RAID assembly. If one of the disks is missing because of hardware failute, it just boots from the other.

The actual OS and user data are on separate partition wthing LVM on another RAID pair, where I use the neweer RAID format.

And don't have an /efi either.

-- hendrik