ubuntuusers.de

lvm_reduce_try_1

Autor:
fleet_street
Datum:
17. November 2019 14:11
Code:
 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
ubuntu-mate@ubuntu-mate:~$ sudo lvreduce --resizefs -L 15G ubuntu-mate-vg/root
fsck from util-linux 2.31.1
/dev/mapper/ubuntu--mate--vg-root: 168612/1831424 files (0.1% non-contiguous), 1144613/7317504 blocks
resize2fs 1.44.1 (24-Mar-2018)
Resizing the filesystem on /dev/mapper/ubuntu--mate--vg-root to 3932160 (4k) blocks.
The filesystem on /dev/mapper/ubuntu--mate--vg-root is now 3932160 (4k) blocks long.

  Size of logical volume ubuntu-mate-vg/root changed from 27.91 GiB (7146 extents) to 15.00 GiB (3840 extents).
  Logical volume ubuntu-mate-vg/root successfully resized.
ubuntu-mate@ubuntu-mate:~$ sudo pvresize --test --setphysicalvolumesize 15G/dev/sda1
  No command with matching syntax recognised.  Run 'pvresize --help' for more information.
  Correct command syntax is:
  pvresize PV ...

ubuntu-mate@ubuntu-mate:~$ sudo pvresize --test --setphysicalvolumesize 15G /dev/sda1
  TEST MODE: Metadata will NOT be updated and volumes will not be (de)activated.
/dev/sda1: Requested size 15.00 GiB is less than real size 28.87 GiB. Proceed?  [y/n]: y
  WARNING: /dev/sda1: Pretending size is 31457280 not 60551168 sectors.
  /dev/sda1: cannot resize to 3839 extents as 4084 are allocated.
  0 physical volume(s) resized / 1 physical volume(s) not resized
ubuntu-mate@ubuntu-mate:~$ sudo pvresize --test --setphysicalvolumesize 16G /dev/sda1
  TEST MODE: Metadata will NOT be updated and volumes will not be (de)activated.
/dev/sda1: Requested size 16.00 GiB is less than real size 28.87 GiB. Proceed?  [y/n]: y
  WARNING: /dev/sda1: Pretending size is 33554432 not 60551168 sectors.
  /dev/sda1: cannot resize to 4095 extents as later ones are allocated.
  0 physical volume(s) resized / 1 physical volume(s) not resized
ubuntu-mate@ubuntu-mate:~$ # …
ubuntu-mate@ubuntu-mate:~$ # duch Ausproboeren die richtige Anzahl der Extends ermittelt, trotzdem
ubuntu-mate@ubuntu-mate:~$ # …
ubuntu-mate@ubuntu-mate:~$ sudo pvresize -v --setphysicalvolumesize 15.958G /dev/sda1
    Wiping internal VG cache
    Wiping cache of LVM-capable devices
    Archiving volume group "ubuntu-mate-vg" metadata (seqno 4).
/dev/sda1: Requested size <15.96 GiB is less than real size 28.87 GiB. Proceed?  [y/n]: y
    Accepted input: [y]
  WARNING: /dev/sda1: Pretending size is 33466351 not 60551168 sectors.
    Resizing volume "/dev/sda1" to 33466351 sectors.
    Resizing physical volume /dev/sda1 from 7391 to 4084 extents.
  /dev/sda1: cannot resize to 4084 extents as later ones are allocated.
  0 physical volume(s) resized / 1 physical volume(s) not resized
ubuntu-mate@ubuntu-mate:~$ # …
ubuntu-mate@ubuntu-mate:~$ # und dann hat es mit s für sectors endlich geklappt
ubuntu-mate@ubuntu-mate:~$ # …
ubuntu-mate@ubuntu-mate:~$ sudo pvresize -v --setphysicalvolumesize 33460060s /dev/sda1
    Wiping internal VG cache
    Wiping cache of LVM-capable devices
  WARNING: Device /dev/sda1 has size of 60551168 sectors which is smaller than corresponding PV size of 68526200832 sectors. Was device resized?
  One or more devices used as PVs in VG ubuntu-mate-vg have changed sizes.
    Archiving volume group "ubuntu-mate-vg" metadata (seqno 5).
/dev/sda1: Requested size 15.95 GiB is less than real size 28.87 GiB. Proceed?  [y/n]: y
    Accepted input: [y]
  WARNING: /dev/sda1: Pretending size is 33460060 not 60551168 sectors.
    Resizing volume "/dev/sda1" to 33460060 sectors.
    Resizing physical volume /dev/sda1 from 8365014 to 4084 extents.
  /dev/sda1: cannot resize to 4084 extents as later ones are allocated.
  0 physical volume(s) resized / 1 physical volume(s) not resized
ubuntu-mate@ubuntu-mate:~$ # …
ubuntu-mate@ubuntu-mate:~$ # ABER:
ubuntu-mate@ubuntu-mate:~$ # …
ubuntu-mate@ubuntu-mate:~$ sudo pvscan
  WARNING: Device /dev/sda1 has size of 60551168 sectors which is smaller than corresponding PV size of 68526200832 sectors. Was device resized?
  One or more devices used as PVs in VG ubuntu-mate-vg have changed sizes.
  PV /dev/sda1   VG ubuntu-mate-vg   lvm2 [<31.91 TiB / 31.89 TiB free]
  Total: 1 [<31.91 TiB] / in use: 1 [<31.91 TiB] / in no VG: 0 [0   ]
ubuntu-mate@ubuntu-mate:~$ 
ubuntu-mate@ubuntu-mate:~$ # …
ubuntu-mate@ubuntu-mate:~$ # also zurück
ubuntu-mate@ubuntu-mate:~$ # …
ubuntu-mate@ubuntu-mate:~$ sudo pvresize /dev/sda1
  WARNING: Device /dev/sda1 has size of 60551168 sectors which is smaller than corresponding PV size of 68526200832 sectors. Was device resized?
  One or more devices used as PVs in VG ubuntu-mate-vg have changed sizes.
  Physical volume "/dev/sda1" changed
  1 physical volume(s) resized / 0 physical volume(s) not resized
ubuntu-mate@ubuntu-mate:~$ sudo pvscan
  PV /dev/sda1   VG ubuntu-mate-vg   lvm2 [28.87 GiB / <12.92 GiB free]
  Total: 1 [28.87 GiB] / in use: 1 [28.87 GiB] / in no VG: 0 [0   ]
ubuntu-mate@ubuntu-mate:~$