Showing posts with label linux. Show all posts
Showing posts with label linux. Show all posts

Monday, March 2, 2020

GROWING RAID+LVM


GROWING RAID+LVM


Step by step howto:




Add Drive
mdadm --add /dev/md0 /dev/sdb3


Tunning
echo 50000 > /proc/sys/dev/raid/speed_limit_min
echo 200000 > /proc/sys/dev/raid/speed_limit_max


Grow the Array
 mdadm --grow /dev/md0 --raid-devices=4


Resize PV
# pvresize /dev/md1
  Physical volume "/dev/md1" changed
  1 physical volume(s) resized or updated / 0 physical volume(s) not resized


Extend LV
# lvextend -L +400G -n /dev/XXXX00/LV-HOME
  Size of logical volume XXXX00/LV-HOME changed from 565.66 GiB (144809 extents) to 965.66 GiB (247209 extents).
  Logical volume XXXX00/LV-HOME successfully resized.


Grow filesystem
# resize2fs /dev/mapper/XXXX00-LV--HOME
resize2fs 1.44.5 (15-Dec-2018)
Filesystem at /dev/mapper/XXXX00-LV--HOME is mounted on /home; on-line resizing required
old_desc_blocks = 71, new_desc_blocks = 121
The filesystem on /dev/mapper/XXXX00-LV--HOME is now 253142016 (4k) blocks long.


Check
# df -h /home
Filesystem                   Size  Used Avail Use% Mounted on
/dev/mapper/XXXX00-LV--HOME  950G  431G  477G  48% /home



Friday, July 23, 2010

Linux: Automatic Reboot on Kernel Panic

Automatic Reboot on Kernel Panic

This guide will help you configure your server so that in the event of a kernel
panic your server will automatically restart itself. This saves you the trouble
of submitting a reboot request for your server and has the side-effect of
helping to prevent downtime.

There are several different ways that this little-known trick can be
accomplished. We'll go over each method.

On-Startup Command This command can be placed into your server startup scripts.
It must be performed each restart to be effective. This method is sure-fire and
should work on any distribution of linux.

    echo 60 > /proc/sys/kernel/panic

Using Lib

If you are unsure if you are using lib or not, see if you have a file
/etc/lib.conf. If this file exists, then you are okay to place the command
below into the file. If you do not have this file, use a different method.

    append="panic=15"

Once you modify this file and save it you will want to restart lib:

    # /sbin/lib

Using Grub

 If you utilize grub, you may append this to your boot config line:

    panic=15

Bear in mind that by doing this, unless you carefully monitor your system logs
you will not know if a kernel panic has occurred. It does help minimize the
effect of downtime in the event of a kernel panic however.