linux建立邏輯卷,遠端共享為備份盤
今天給客戶做一個vg,掛載到遠端,供備份使用,現把linux建立vg及lv的進行下說明。
由於客戶的資料量在增加,可能以後會再擴盤,所我們採用vg的方式,方便以後直接加盤
[root@mytest ~]# fdisk -l
Disk /dev/sda: 896.9 GB, 896998047744 bytes
255 heads, 63 sectors/track, 109053 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sda1 * 1 13 104391 83 Linux
/dev/sda2 14 109053 875863800 8e Linux LVM
Disk /dev/sdb: 1797.9 GB, 1797999558656 bytes
255 heads, 63 sectors/track, 218594 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
可以看到這裡有一個1.7t左右的盤,所以根據計算,我們的pe,應該是64m,即64*65536=4t
建立分割槽:
[root@mytest ~]# fdisk /dev/sdb
Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
Building a new DOS disklabel. Changes will remain in memory only,
until you decide to write them. After that, of course, the previous
content won't be recoverable.
The number of cylinders for this disk is set to 218594.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
(e.g., DOS FDISK, OS/2 FDISK)
Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)
Command (m for help): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-218594, default 1): 1
Last cylinder or +size or +sizeM or +sizeK (1-218594, default 218594): 218594
Command (m for help): w
The partition table has been altered!
Calling ioctl() to re-read partition table.
Syncing disks.
重新掃描認一下盤
[root@mytest ~]# partprobe
[root@mytest ~]# df -h
檔案系統 容量 已用 可用 已用% 掛載點
/dev/mapper/VolGroup00-LogVol00
747G 64G 645G 9% /
/dev/sda1 99M 13M 82M 14% /boot
tmpfs 32G 0 32G 0% /dev/shm
[root@mytest ~]# fdisk -l
Disk /dev/sda: 896.9 GB, 896998047744 bytes
255 heads, 63 sectors/track, 109053 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sda1 * 1 13 104391 83 Linux
/dev/sda2 14 109053 875863800 8e Linux LVM
Disk /dev/sdb: 1797.9 GB, 1797999558656 bytes
255 heads, 63 sectors/track, 218594 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sdb1 1 218594 1755856273+ 83 Linux
建立邏輯盤:
[root@mytest ~]# pvcreate /dev/sdb1
Physical volume "/dev/sdb1" successfully created
建立備份的vg,注意這裡要加-s 64mb
[root@mytest ~]# vgcreate -s 64mb backupvg /dev/sdb1
Volume group "backupvg" successfully created
建立備份用的lv
[root@mytest ~]# lvcreate -L 1600G -n backuplv01 backupvg
Logical volume "backuplv01" created
建立掛載點
[root@mytest ~]# cd /u01
[root@mytest /]# mkdir -p /u02/databackup
[root@mytest /]# cd /dev/backupvg
[root@mytest backupvg]# ls -a
. .. backuplv01
格式化邏輯卷(linux5,只能格式化為ext3格式)
[root@mytest dev]# mkfs.ext3 /dev/backupvg/backuplv01
mke2fs 1.39 (29-May-2006)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
209715200 inodes, 419430400 blocks
20971520 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=4294967296
12800 block groups
32768 blocks per group, 32768 fragments per group
16384 inodes per group
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
4096000, 7962624, 11239424, 20480000, 23887872, 71663616, 78675968,
102400000, 214990848
Writing inode tables: done
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information:
進行掛載
[root@mytest dev]# mount /dev/backupvg/backuplv01 /u02/databackup
由於本盤不是放置到資料庫的機器上的,所以需要透過nfs掛載的方式進行共享
[root@mytest dev]# vi /etc/exports
新增:
/u02/databackup 192.168.10.*(rw,sync,no_root_squash)
開啟nfs服務
[root@mytest dev]# service nfs start
注意,這裡需要把iptables防火牆停止,否則可能連線不上!
在遠端資料伺服器進行掛載
[root@mydata ~]# mount 192.168.10.10:/u02/backup /u02/backup
將遠端/u02/backup掛載到本地端的/u02/backup
這樣就可以直接在oracle資料庫部署備份了,當本地盤用了
由於客戶的資料量在增加,可能以後會再擴盤,所我們採用vg的方式,方便以後直接加盤
[root@mytest ~]# fdisk -l
Disk /dev/sda: 896.9 GB, 896998047744 bytes
255 heads, 63 sectors/track, 109053 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sda1 * 1 13 104391 83 Linux
/dev/sda2 14 109053 875863800 8e Linux LVM
Disk /dev/sdb: 1797.9 GB, 1797999558656 bytes
255 heads, 63 sectors/track, 218594 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
可以看到這裡有一個1.7t左右的盤,所以根據計算,我們的pe,應該是64m,即64*65536=4t
建立分割槽:
[root@mytest ~]# fdisk /dev/sdb
Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
Building a new DOS disklabel. Changes will remain in memory only,
until you decide to write them. After that, of course, the previous
content won't be recoverable.
The number of cylinders for this disk is set to 218594.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
(e.g., DOS FDISK, OS/2 FDISK)
Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)
Command (m for help): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-218594, default 1): 1
Last cylinder or +size or +sizeM or +sizeK (1-218594, default 218594): 218594
Command (m for help): w
The partition table has been altered!
Calling ioctl() to re-read partition table.
Syncing disks.
重新掃描認一下盤
[root@mytest ~]# partprobe
[root@mytest ~]# df -h
檔案系統 容量 已用 可用 已用% 掛載點
/dev/mapper/VolGroup00-LogVol00
747G 64G 645G 9% /
/dev/sda1 99M 13M 82M 14% /boot
tmpfs 32G 0 32G 0% /dev/shm
[root@mytest ~]# fdisk -l
Disk /dev/sda: 896.9 GB, 896998047744 bytes
255 heads, 63 sectors/track, 109053 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sda1 * 1 13 104391 83 Linux
/dev/sda2 14 109053 875863800 8e Linux LVM
Disk /dev/sdb: 1797.9 GB, 1797999558656 bytes
255 heads, 63 sectors/track, 218594 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sdb1 1 218594 1755856273+ 83 Linux
建立邏輯盤:
[root@mytest ~]# pvcreate /dev/sdb1
Physical volume "/dev/sdb1" successfully created
建立備份的vg,注意這裡要加-s 64mb
[root@mytest ~]# vgcreate -s 64mb backupvg /dev/sdb1
Volume group "backupvg" successfully created
建立備份用的lv
[root@mytest ~]# lvcreate -L 1600G -n backuplv01 backupvg
Logical volume "backuplv01" created
建立掛載點
[root@mytest ~]# cd /u01
[root@mytest /]# mkdir -p /u02/databackup
[root@mytest /]# cd /dev/backupvg
[root@mytest backupvg]# ls -a
. .. backuplv01
格式化邏輯卷(linux5,只能格式化為ext3格式)
[root@mytest dev]# mkfs.ext3 /dev/backupvg/backuplv01
mke2fs 1.39 (29-May-2006)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
209715200 inodes, 419430400 blocks
20971520 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=4294967296
12800 block groups
32768 blocks per group, 32768 fragments per group
16384 inodes per group
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
4096000, 7962624, 11239424, 20480000, 23887872, 71663616, 78675968,
102400000, 214990848
Writing inode tables: done
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information:
進行掛載
[root@mytest dev]# mount /dev/backupvg/backuplv01 /u02/databackup
由於本盤不是放置到資料庫的機器上的,所以需要透過nfs掛載的方式進行共享
[root@mytest dev]# vi /etc/exports
新增:
/u02/databackup 192.168.10.*(rw,sync,no_root_squash)
開啟nfs服務
[root@mytest dev]# service nfs start
注意,這裡需要把iptables防火牆停止,否則可能連線不上!
在遠端資料伺服器進行掛載
[root@mydata ~]# mount 192.168.10.10:/u02/backup /u02/backup
將遠端/u02/backup掛載到本地端的/u02/backup
這樣就可以直接在oracle資料庫部署備份了,當本地盤用了
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/29371470/viewspace-1312731/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- linux邏輯卷組建立以及修改Linux
- Linux邏輯盤卷管理LVM詳解LinuxLVM
- Linux作業系統邏輯盤卷管理LVM建立步驟(轉)Linux作業系統LVM
- HP-UX 建立邏輯卷UX
- 邏輯備份--mysqldumpMySql
- linux 邏輯卷等Linux
- Linux-使用者管理與建立邏輯卷Linux
- 【AIX 命令學習】建立邏輯卷!AI
- mysql 邏輯備份 (mysqldump)MySql
- mysql的邏輯備份MySql
- Linux LVM邏輯卷LinuxLVM
- Linux的邏輯卷管理Linux
- linux 邏輯卷介紹Linux
- linux系統掛載邏輯卷和擴充套件邏輯卷組Linux套件
- Mysql備份與恢復(2)---邏輯備份MySql
- 揭祕ORACLE備份之--邏輯備份(EXP)Oracle
- 揭祕ORACLE備份之--邏輯備份(EXPDP)Oracle
- linux之LVM邏輯卷LinuxLVM
- linux LVM邏輯卷配置LinuxLVM
- Linux擴充套件邏輯卷Linux套件
- MongoDB 邏輯備份工具mongodumpMongoDB
- Oracle 邏輯備份 expdp/impdpOracle
- expdp 邏輯備份指令碼指令碼
- MySql邏輯備份恢復MySql
- Oracle邏輯備份指令碼Oracle指令碼
- openGauss-邏輯備份
- 將linux資料庫用rman備份到遠端win共享目錄Linux資料庫
- SQLServer遠端備份SQLServer
- innobackupex遠端備份
- Windows邏輯備份-EXPDP(保留5天內邏輯備份)批處理指令碼Windows指令碼
- 邏輯備份全庫或者邏輯備份多個使用者的資料
- Linux 系統邏輯盤卷管理LVM 詳細介紹LinuxLVM
- Oracle裡邏輯備份、物理備份、Rman備份的區別Oracle
- ORACLE備份和恢復 - 邏輯備份 exp/impOracle
- Linux下LVM邏輯卷管理LinuxLVM
- 資料庫邏輯備份(轉)資料庫
- 如何在 Linux 分割槽或邏輯卷中建立檔案系統Linux
- 企業網盤伺服器資料異地備份、遠端備份、增量備份解決方案伺服器