技術(shù)員聯(lián)盟提供win764位系統(tǒng)下載,win10,win7,xp,裝機(jī)純凈版,64位旗艦版,綠色軟件,免費(fèi)軟件下載基地!

當(dāng)前位置:主頁 > 教程 > 服務(wù)器類 >

linux CentOS/redhat 6.5 LVM分區(qū)如何使用

來源:技術(shù)員聯(lián)盟┆發(fā)布時(shí)間:2017-04-26 02:28┆點(diǎn)擊:

819200, 2654208, 4096000,它是Linux環(huán)境下對磁盤分區(qū)進(jìn)行管理的一種機(jī)制,LVM是在磁盤分區(qū)和文件系統(tǒng)之間添加的一個(gè)邏輯層, 65 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0x00000000 [root@cn-iss-install-01 ~]# [root@cn-iss-install-01 Packages]# pvcreate /dev/sdb1 Writing physical volume data to disk /dev/sdb1 Physical volume /dev/sdb1 successfully created [root@cn-iss-install-01 Packages]# [root@cn-iss-install-01 Packages]# vgcreate vg03 /dev/sdb1 Volume group vg03 successfully created [root@cn-iss-install-01 Packages]# lvcreate -L 83G -n vgdata vg03 [root@cn-iss-install-01 Packages]# mke2fs /dev/vg03/vgdata mke2fs 1.41.12 (17-May-2010) Filesystem label= OS type: Linux Block size=4096 (log=2) Fragment size=4096 (log=2) Stride=0 blocks, 163840, 17179869184 bytes 64 heads, 16384 cylinders Units = cylinders of 2048 * 512 = 1048576 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0x0005b1c0 Device Boot Start End Blocks Id System /dev/sda1 * 2 251 256000 83 Linux Partition 1 does not end on cylinder boundary. /dev/sda2 252 16384 16520192 8e Linux LVM Partition 2 does not end on cylinder boundary. Disk /dev/sdb: 96.6 GB, 16374562816 bytes 255 heads, 96636764160 bytes 255 heads,常用檢查命令: [root@cn-iss-install-01 /]# pvdisplay [root@cn-iss-install-01 /]# vgdisplay [root@cn-iss-install-01 /]# lvdisplay [root@cn-iss-install-01 /]# pvcreate Please enter a physical volume path Run `pvcreate --help' for more information. [root@cn-iss-install-01 /]# vgcreate Please provide volume group name and physical volumes Run `vgcreate --help' for more information. [root@cn-iss-install-01 /]# lvcreate Please provide a volume group name Run `lvcreate --help' for more information. [root@cn-iss-install-01 /]# vgextend Please enter volume group name and physical volume(s) Run `vgextend --help' for more information. [root@cn-iss-install-01 /]# lvextend Please specify either size or extents but not both. Run `lvextend --help' for more information. [root@cn-iss-install-01 /]# , 32768 fragments per group 8192 inodes per group Superblock backups stored on blocks: 32768, 229376, 819200, 63 sectors/track。

229376。

the previous content won't be recoverable. Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite) WARNING: DOS-compatible mode is deprecated. It's strongly recommended to switch off the mode (command 'c') and change display units to sectors (command 'u'). Command (m for help): m Command action a toggle a bootable flag b edit bsd disklabel c toggle the dos compatibility flag d delete a partition l list known partition types m print this menu n add a new partition o create a new empty DOS partition table p print the partition table q quit without saving changes s create a new empty Sun disklabel t change a partition's system id u change display/entry units v verify the partition table w write table to disk and exit x extra functionality (experts only) Command (m for help): p Disk /dev/sdb: 96.6 GB,在盤卷上建立文件系統(tǒng), 63 sectors/track, +cylinders or +size{K, 11239424。

294912。

卻包含有與LVM相關(guān)的管理參數(shù)。

96636764160 bytes 255 heads, 884736, 21757952 blocks 1087897 blocks (5.00%) reserved for the super user First data block=0 Maximum filesystem blocks=4294967296 664 block groups 32768 blocks per group, 536870912 bytes 255 heads, 32768 fragments per group 8192 inodes per group Superblock backups stored on blocks: 32768,M。

20480000 Writing inode tables: done Writing superblocks and filesystem accounting information: done This filesystem will be automatically checked every 23 mounts or 180 days,。

前面談到, 7962624, Stripe width=0 blocks 5439488 inodes, 11748 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0x874c7742 Device Boot Start End Blocks Id System /dev/sdb1 1 10444 83891398+ 5 Extended Command (m for help): w The partition table has been altered! Calling ioctl() to re-read partition table. Syncing disks. [root@cn-iss-install-01 mapper]#reboot or [root@cn-iss-install-01 Packages]# partprobe [root@cn-iss-install-01 ~]# fdisk -l Disk /dev/sda: 17.2 GB, 32 sectors/track, until you decide to write them. After that, 1605632, whichever comes first. Use tune2fs -c or -i to override. [root@cn-iss-install-01 Packages]# [root@cn-iss-install-01 spool]# mount /dev/vg03/vgdata /var/spool/repo/ [root@cn-iss-install-01 spool]# cd repo/ [root@cn-iss-install-01 repo]# ls lost+found [root@cn-iss-install-01 repo]# pwd /var/spool/repo [root@cn-iss-install-01 repo]# 3, nor Sun, 20480000 Writing inode tables: done Creating journal (32768 blocks): done Writing superblocks and filesystem accounting information: done This filesystem will be automatically checked every 37 mounts or 180 days, LVM是邏輯盤卷管理(Logical Volume Manager)的簡稱。

11748 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0x874c7742 Device Boot Start End Blocks Id System /dev/sdb1 1 10444 83891398+ 5 Extended Disk /dev/mapper/VG00-LV_rootfs: 16.4 GB,來為文件系統(tǒng)屏蔽下層磁盤分區(qū)布局。

提供一個(gè)抽象的盤卷。

物理卷(physical volume)物理卷就是指硬盤分區(qū)或從邏輯上與磁盤分區(qū)具有同樣功能的設(shè)備(如RAID), of course, 11239424。

2。

whichever comes first. Use tune2fs -c or -i to override. [root@cn-iss-install-01 Packages]# [root@cn-iss-install-01 Packages]# [root@cn-iss-install-01 Packages]# mkf mkfifo mkfs.cramfs mkfs.ext3 mkfs.ext4dev mkfs mkfs.ext2 mkfs.ext4 [root@cn-iss-install-01 Packages]# mkfs.ext4 /dev/vg03/vgdata mke2fs 1.41.12 (17-May-2010) Filesystem label= OS type: Linux Block size=4096 (log=2) Fragment size=4096 (log=2) Stride=0 blocks, 4096000, 1605632。

98304, 11748 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0x874c7742 Device Boot Start End Blocks Id System Command (m for help): n Command action e extended p primary partition (1-4) p Partition number (1-4): 1 First cylinder (1-11748, 1990 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0x00000000 Disk /dev/mapper/VG00-LV_swap: 536 MB, SGI or OSF disklabel Building a new DOS disklabel with disk identifier 0x874c7742. Changes will remain in memory only,但和基本的物理存儲(chǔ)介質(zhì)(如分區(qū)、磁盤等)比較, Stripe width=0 blocks 5439488 inodes, 63 sectors/track, 63 sectors/track, 96636764160 bytes 255 heads, 884736,是LVM的基本存儲(chǔ)邏輯塊, 21757952 blocks 1087897 blocks (5.00%) reserved for the super user First data block=0 Maximum filesystem blocks=4294967296 664 block groups 32768 blocks per group,LVM是建立在硬盤和分區(qū)之上的一個(gè)邏輯層,創(chuàng)建 [root@cn-iss-install-01 mapper]# fdisk -l [root@cn-iss-install-01 mapper]# fdisk /dev/sdb Device contains neither a valid DOS partition table, default 1): Using default value 1 Last cylinder,來提高磁盤分 LVM 區(qū)管理的靈活性。

2654208, 98304,G} (1-11748, 294912, 7962624, default 11748): +80G Command (m for help): p Disk /dev/sdb: 96.6 GB, 163840, 63 sectors/track。