Linux/LVM adding a NAS partition for backups

From voipsupport
Revision as of 22:30, 13 June 2016 by John (talk | contribs) (Created page with "(:title How to add a NAS iscsi lvm partition for backups:) # Install isci tools %commandbox% [@yum install [email protected]] # %item value=2% Configure iscsi %commandb...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

(:title How to add a NAS iscsi lvm partition for backups:)

  1. Install isci tools

%commandbox% [@yum install [email protected]]

  1. %item value=2% Configure iscsi

%commandbox% [@vi /etc/iscsi/[email protected]]

%resultbox% [@node.session.auth.username = My_ISCSI_USR_NAME node.session.auth.password = MyPassword discovery.sendtargets.auth.username = My_ISCSI_USR_NAME discovery.sendtargets.auth.password = [email protected]]

  1. %item value=3% Start iscsi

%commandbox% [@service iscsi [email protected]]

  1. %item value=4% Set iscsi to start on boot

%commandbox% [@chkconfig iscsi [email protected]]

  1. %item value=5% Discover targets using ip address of the storage

%commandbox% [@iscsiadm -m discovery -t sendtargets -p [email protected]]

  1. %item value=6% Retart iscsi

%commandbox% [@service iscsi [email protected]]

  1. %item value=7% Nas should be visible with fdisk

%commandbox% [@fdisk [email protected]]

  1. %item value=8% Install parted if not present

%commandbox% [@yum install [email protected]]

  1. %item value=9% Run parted on NAS drive where /dev/xxx has been identified as output of fdisk -l above

%commandbox% [@parted /dev/[email protected]]

  1. %item value=10% in parted check existing partitions and add new lvm partition

%commandbox% [@unit % print mkpart primary start end print set n lvm on (where n is the partition number) print [email protected]]

  1. %item value=11% Check name of lvm partition /dev/xxxn (where n is a number)

%commandbox% [@fdisk [email protected]]

  1. %item value=12% Create a lvm physical volume out of the partition (CAREFUL, do not do this on the disk /dev/xxx but on the partition /dev/xxxn)

%commandbox% [@pvcreate /dev/[email protected]]

  1. %item value=13% Create a new volume group for backups

%commandbox% [@vgcreate VolGroupBackup /dev/[email protected]]

  1. %item value=14% Create a new logical volume with all the unallocated volume group space

%commandbox% [@lvcreate -l +100%FREE -n LogVolBackup1 [email protected]]

  1. %item value=15% Make an ext4 file system on the logical volume

%commandbox% [@mkfs.ext4 /dev/VolGroupBackup1/[email protected]]

  1. %item value=16% Create the mount point e.g. /backup

%commandbox% [@mkdir /[email protected]]

  1. %item value=17% Add entry to /etc/fstab

%commandbox% [@vi /etc/[email protected]] %resultbox% [@/dev/mapper/VolGroupBackup-LogVolBackup1 /backup ext4 defaults 1 2 @]

  1. %item value=19% Mount file system

%commandbox% [@mount /[email protected]]