-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhh_lvm.txt
88 lines (51 loc) · 1.65 KB
/
hh_lvm.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
pvcreate /dev/sdb
pvcreate --dataalignment 1024k /dev
vgcreate 4tb /dev/sdb
vgextend data /dev/sdb # Add new pv to a vg.
lvcreate -n images -L 500G 4tb
lvdisplay
lvresize -L +500G /dev/mapper/4tb-images
xfs_growfs /dev/data/backup
btrfs filesystem resize max /var/lib/libvirt/images
## Entends volume
```bash
$ lvextend -L+100GB /dev/vg-data/data
$ resize2fs /dev/vg-data/data # ext4
```
# HD Performance
sync; dd if=/dev/zero of=tempfile bs=1M count=10240; sync; /sbin/sysctl -w vm.drop_caches=3; dd if=tempfile of=/dev/null bs=1M count=10240; rm tempfile
hdparm -Tt /dev/sda
# Extend disk tha contain and LVM partition
## 1. Redimensionar el disco (proxmox GUI)
## 2. Redimensionar la partición
Desmontar la particion que queremos extender
parted /dev/mapper/pve-vm--102--disk--0
(parted) print
Model: Linux device-mapper (thin) (dm)
Disk /dev/mapper/pve-vm--102--disk--0: 70.9GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags:
Number Start End Size File system Name Flags
1 1049kB 2097kB 1049kB bios_grub
2 2097kB 2150MB 2147MB ext4
3 2150MB 53.7GB 51.5GB
(parted) resizepart 3
End? [53.7GB]? 100%
(parted) quit
## 3. Extender el LVM
### Extendemos el PV
pvresize /dev/vda3
pvs
vgdisplay
### Extendemos el VG
vgextend NombreVG /dev/vda3
vgs
### Extendemos el LVM
lvextend -l +100%FREE /dev/mapper/ubuntu--vg-dockers
lvs
### Extender la partición que está dentro del lvm
#### XFS
xfs_growfs
#### ext4
resize2fs /dev/mapper/ubuntu--vg-dockers