. WIKIMERIONET
Merion Mertics , ,

-
-
CRM

8

: Linux (Hyper-V VMware, ), . , . () - . , Linux/CentOS?

, () Linux/CentOS, PV (Physical Volume, ), VG (Volume Group, ) LV (Logical Volume, ).

     CentOS?

?

. : , 4 . . CentOS fdisk -l:

# fdisk -l
Disk /dev/sda: 187.9 GB, 187904819200 bytes
255 heads, 63 sectors/track, 22844 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1          25      200781   83  Linux
/dev/sda2              26        2636    20972857+  8e  Linux LVM

, - . - /dev/sda1 /dev/sda2. .

, :

# fdisk -l

Disk /dev/sda: 187.9 GB, 187904819200 bytes
255 heads, 63 sectors/track, 22844 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1          25      200781   83  Linux
/dev/sda2              26        2636    20972857+  8e  Linux LVM
/dev/sda3            2637       19581   136110712+  8e  Linux LVM
/dev/sda4           19582       22844    26210047+  8e  Linux LVM

, , . , . !


fdisk -l

# fdisk -l

Disk /dev/sda: 10.7 GB, 10737418240 bytes
255 heads, 63 sectors/track, 1305 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         391     3036285   8e  Linux LVM

10.7 . () fdisk /dev/sda. , n, :

# fdisk /dev/sda

The number of cylinders for this disk is set to 1305.
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)

Command (m for help): n

, p . - - 4 !

Command action
e   extended
p   primary partition (1-4)
 p

. /dev/sda1 /dev/sda2, , 3:

Partition number (1-4): 3

, Enter , :

First cylinder (392-1305, default 392): 
Using default value 392
Last cylinder or +size or +sizeM or +sizeK (392-1305, default 1305): 
Using default value 1305

. . , t, , (, 3), 3, Hex code 8e, Enter:

Command (m for help): t
Partition number (1-4): 3
Hex code (type L to list codes): 8e
Changed system type of partition 3 to 8e (Linux LVM)

. fidsk. w Etner, :

Command (m for help): w

, - ! partprobe:

#  partprobe -s

, partx:

#  partx -v -a /dev/sda

- , . fdisk, :

# fdisk -l

Disk /dev/sda: 10.7 GB, 10737418240 bytes
255 heads, 63 sectors/track, 1305 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         391     3036285   8e  Linux LVM
/dev/sda3             392        1305     7341705   8e  Linux LVM

LV

: (PV) , (VG) PV, LV. , , !

, : (PV). : /dev/sda3, , 4, , /dev/sdb3! , .

# pvcreate /dev/sda3
Physical volume "/dev/sda3" successfully created

. (VG, Volume Group). , . vgdisplay:

# vgdisplay
--- Volume group ---
VG Name               MerionVGroup00
...

. VG MerionVGroup00. PV vgextend:

# vgextend MerionVGroup00 /dev/sda3
Volume group "MerionVGroup00" successfully extended

LV VG. LV, lvs:

#  lvs
  LV      VG        Attr       LSize
  MerionLVol00    MerionVGroup00 

MerionLVol00 - . LV, lvextend /dev/MerionVGroup00/MerionLVol00 /dev/sda3:

# lvextend /dev/MerionVGroup00/MerionLVol00 /dev/sda3
Extending logical volume MerionLVol00 to 9.38 GB
Logical volume MerionLVol00 successfully resized

. , , VG, . resize2fs:

# resize2fs /dev/MerionVGroup00/MerionLVol00
resize2fs 1.39 (29-May-2006)
Filesystem at /dev/MerionVGroup00/MerionLVol00 is mounted on /; on-line resizing required
Performing an on-line resize of /dev/MerionVGroup00/MerionLVol00 to 2457600 (4k) blocks.
The filesystem on /dev/MerionVGroup00/MerionLVol00 is now 2457600 blocks long.

. df -h. Enjoy!


resize2fs: Couldn't find valid filesystem superblock

:

$ resize2fs /dev/MerionVGroup00/MerionLVol00
resize2fs 1.42.9 (28-Dec-2013)
resize2fs: Bad magic number in super-block while trying to open /dev/MerionVGroup00/MerionLVol00
Couldn't find valid filesystem superblock.

, XFS, ext2/ext3. , xfs_growfs:

$  xfs_growfs /dev/MerionVGroup00/MerionLVol00
meta-data=/dev/MerionVGroup00/MerionLVol00 isize=256    agcount=4, agsize=1210880 blks
         =                       sectsz=512   attr=2, projid32bit=1
         =                       crc=0
data     =                       bsize=4096   blocks=4843520, imaxpct=25
         =                       sunit=0      swidth=0 blks
naming   =version 2              bsize=4096   ascii-ci=0 ftype=0
log      =internal               bsize=4096   blocks=2560, version=2
         =                       sectsz=512   sunit=0 blks, lazy-count=1
realtime =none                   extsz=4096   blocks=0, rtextents=0

, ?


?


: