This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# : Lets mount everything inside the new rootvol | |
# mount /dev/rootvg/varvol /mnt/new/root/var | |
# mount /dev/sda1 /mnt/new/root/boot | |
# mount -o bind /dev /mnt/new/root/dev | |
# mount -t sysfs sys /mnt/new/root/sys | |
# mount -t procfs none /mnt/new/root/proc | |
# : Chrooting now.. | |
# chroot /mnt/new/root |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# mkdir /mnt/new/boot && mount /dev/sda1 /mnt/new/boot | |
# rsync -avAX /mnt/new/root/boot/ /mnt/new/boot/ | |
# umount /mnt/new/boot | |
# rsync -avAX /mnt/new/root/boot/ /mnt/new/boot/ | |
# cat /mnt/new/root/etc/fstab | |
/dev/sda1 /boot ext4 defaults 1 2 | |
/dev/rootvg/rootvol / ext4 defaults 1 1 | |
/dev/rootvg/varvol /var ext4 defaults 1 2 | |
/dev/datavg/epiclulz /home/epiclulz btrfs defaults 1 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# : Create new mount directories | |
# mkdir -p /mnt/new/{root,var,home/epiclulz,home/somebody} | |
# mkdir -p /mnt/old/root | |
# : Mount lvms | |
# mount /dev/rootvg/rootvol /mnt/new/root | |
# mount /dev/rootvg/varvol /mnt/new/var | |
# mount /dev/datavg/epiclulz /mnt/new/home/epiclulz |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# mkfs -t ext4 /dev/rootvg/rootvol | |
# mkfs -t ext4 /dev/rootvg/varvol | |
# mkfs -t btrfs /dev/datavg/epiclulz | |
# mkfs -t btrfs /dev/datavg/somebody |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
lvm> lvcreate -T datavg/homepool -L 15G | |
Logical volume "lvol1" created | |
Logical volume "homepool" created | |
lvm> lvcreate -T datavg/homepool -V5G -n epiclulz | |
Logical volume "epiclulz" created | |
lvm> lvcreate -T datavg/homepool -V5G -n somebody | |
Logical volume "somebody” created |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# : Creating two VGs | |
# lvm | |
lvm> vgcreate rootvg /dev/sdb1 /dev/sdc1 /dev/sdd1 /dev/sde1 | |
Volume group "rootvg" successfully created | |
lvm> vgcreate datavg /dev/sdb2 /dev/sdc2 /dev/sdd2 /dev/sde2 | |
Volume group "datavg" successfully created | |
# : Create root volume in thin pool 'rootpool' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# lvm | |
lvm> pvcreate -y /dev/sdb1 /dev/sdb2 /dev/sdc1 /dev/sdc2 /dev/sdd1 /dev/sdd2 /dev/sde1 /dev/sde2 | |
Physical volume "/dev/sdb1" successfully created | |
Physical volume "/dev/sdb2" successfully created | |
Physical volume "/dev/sdc1" successfully created | |
Physical volume "/dev/sdc2" successfully created | |
Physical volume "/dev/sdd1" successfully created | |
Physical volume "/dev/sdd2" successfully created | |
Physical volume "/dev/sde1" successfully created | |
Physical volume "/dev/sde2" successfully created |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# sfdisk -d /dev/sdb | sfdisk /dev/sdc | |
# sfdisk -d /dev/sdb | sfdisk /dev/sdd | |
# sfdisk -d /dev/sdb | sfdisk /dev/sde | |
# fdisk -l | grep ^/dev | grep -v sda | |
/dev/sdb1 2048 10487807 5242880 83 Linux | |
/dev/sdb2 10487808 20971519 5241856 83 Linux | |
/dev/sdc1 2048 10487807 5242880 83 Linux | |
/dev/sdc2 10487808 20971519 5241856 83 Linux | |
/dev/sdd1 2048 10487807 5242880 83 Linux |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# [email protected] | |
SSHCONFIG_Linux=$(cat << 'HERE-DOC' | |
Host * | |
StrictHostKeyChecking no | |
ServerAliveInterval 60 | |
ForwardAgent yes | |
ServerAliveCountMax 4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo () { | |
echo "sudossh wrapper i.e. 'ssh root@localhost'"; | |
curdir=$(pwd); | |
sudossh="ssh -q -t"; | |
if [[ "${1-bash}" == "bash" ]]; then | |
$sudossh root@localhost "PATH=$PATH; export PATH; PS1=(ROOT)$PS1; export PS1; cd $curdir && bash"; | |
else | |
$sudossh root@localhost "PATH=$PATH; export PATH; PS1=(ROOT)$PS1; export PS1; cd $curdir && $@"; |
NewerOlder