H Mottaleb via plug on 13 Jan 2021 11:36:43 -0800


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: [PLUG] I need help with configuring Raid on Ubuntu server 20.04


I’m a bit confused about the mounting part. Please see the screenshot. Am I entering the commands right? Also, I have some files on the Usb drive that I would have to copy to the $HOME/eth2deposit-cli/validator_keys
according to the guide. How would I mount the usb to the server?


On Jan 13, 2021, at 1:32 PM, Rich Freeman <r-plug@thefreemanclan.net> wrote:

On Wed, Jan 13, 2021 at 1:08 PM H Mottaleb <h_mottaleb@yahoo.com> wrote:

I re-configured to Raid 5+1 hot spare.

Below are the screenshots:

Excellent!

Notice the output of vgs - it says you have 3.44t of free space.  That
is space that is allocated to the volume group (which gathers data
from multiple drives into a single usable space, though right now you
only have one "physical drive" which is what your RAID card is
exposing to the OS).

That is, /dev/sda3 is a partition on /dev/sda which is your RAID
logical drive.  That partition is a physical volume in the ubuntu-vg
volume group.

Ubuntu has created a 200gb logical volume called ubuntu-lv inside the
ubuntu-vg volume group, and that is mounted as your root.

Suppose you want to allocate 1TiB for now for geth.  You could do
something like this:
lvcreate --name geth --size 1T ubuntu-vg

Then if you run lvs you'll see another line called geth that is 1TiB
(I think it uses TiB but it calls them "t" - gotta love CS majors).

Then you can format it with:
mkfs.ext4 /dev/ubuntu-vg/geth
(I normally stick -O dir_index,sparse_super in there but I suspect
those are defaults these days.)

Then you can mount that:
mkdir /var/lib/goethereum
echo "/dev/ubuntu-vg/geth /var/lib/goethereum ext4 noatime,noexec 0 0"
/etc/fstab
mount /var/lib/goethereum

Then if you run df you should see the new mountpoint with 1TiB of
space on /var/lib/goethereum.

I did most of that off the top of my head - if you get an error just
stop as it is easy to fix - none of those commands should do anything
bad if there is a problem.

If it is all working you can just follow that guide you linked.  Set
any permissions on /var/lib/goethereum after it is mounted - the
permissions get overridden after mounting it and are stored on the new
filesystem.  With that config it should auto-mount on boot and
preserve whatever permissions you set up.

You will still have 2+TiB of space free.  You can use that later as
needed.  You can also expand the space available on
/var/lib/goethereum at any time with two commands.  Shrinking it is
also possible but slower (and I'm not sure if it can be mounted while
that is in progress).  Expanding can actually be done while geth is
running.

This is all just LVM-101.  You seem relatively new to Linux so that
might not be the first topic you'll want to study, but it is a VERY
useful topic to understand.  Some of the newer filesystems
(zfs/ceph/btrfs) are replacing it in some uses, but it is a best
practice to use it unless you have something better instead.

--
Rich
___________________________________________________________________________
Philadelphia Linux Users Group         --        http://www.phillylinux.org
Announcements - http://lists.phillylinux.org/mailman/listinfo/plug-announce
General Discussion  --   http://lists.phillylinux.org/mailman/listinfo/plug