Question : Problem: how to backup primary drive to secondary in LVM

I have server with 2 hard disk of 500gb. Operating system is installed on one drive and other is free.
How can I write a script to copy folder of operating system to other drive /folder.
Below are the details

I want to know if this will help
I creat a folder /tmp/disk
mount /dev/hdc1
cp /data /tmp/disk

how can I view the disk usage of the secondary drive because when I run df -h it shows one consolidated output of both the disk.


[root@localhost ~]# vgdisplay
  --- Volume group ---
  VG Name               VolGroup00
  System ID
  Format                lvm2
  Metadata Areas        2
  Metadata Sequence No  3
  VG Access             read/write
  VG Status             resizable
  MAX LV                0
  Cur LV                2
  Open LV               2
  Max PV                0
  Cur PV                2
  Act PV                2
  VG Size               931.41 GB
  PE Size               32.00 MB
  Total PE              29805
  Alloc PE / Size       29805 / 931.41 GB
  Free  PE / Size       0 / 0
  VG UUID               OiLkQJ-jn1F-wcbD-kybr-ihBI-NcPX-3s2BZr

[root@localhost ~]# pvdisplay
  --- Physical volume ---
  PV Name               /dev/hda2
  VG Name               VolGroup00
  PV Size               465.66 GB / not usable 3.56 MB
  Allocatable           yes (but full)
  PE Size (KByte)       32768
  Total PE              14901
  Free PE               0
  Allocated PE          14901
  PV UUID               uk5nCZ-cjdR-xKoG-JjTN-So5S-cEFs-mIJBph

  --- Physical volume ---
  PV Name               /dev/hdc1
  VG Name               VolGroup00
  PV Size               465.76 GB / not usable 9.50 MB
  Allocatable           yes (but full)
  PE Size (KByte)       32768
  Total PE              14904
  Free PE               0
  Allocated PE          14904
  PV UUID               2E3bhH-CTLI-Z1C2-d2zL-D3Dn-coNV-kfmdKK


fdisk -l

Disk /dev/hda: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/hda1   *           1          13      104391   83  Linux
/dev/hda2              14       60801   488279610   8e  Linux LVM

Disk /dev/hdc: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/hdc1   *           1       60801   488384001   8e  Linux LVM


Answer : Problem: how to backup primary drive to secondary in LVM

Use df -m, it will list you your seperate mount points. Like this

df -m
Filesystem           1M-blocks      Used Available Use% Mounted on
/dev/mapper/VolGroup00-Root
                          9672      7282      1891  80% /
/dev/sda1                  190        12       169   7% /boot
tmpfs                      501         0       501   0% /dev/shm
/dev/mapper/VolGroup00-vmware
                         62996      7461     52337  13% /home/vmware

Do you want a snapshot made of your root drive or just an archive of it?
Random Solutions  
 
programming4us programming4us