tests: Fix read_file test.
[libguestfs.git] / recipes / resize.sh
1 #!/bin/sh -
2
3 guestfish <<EOF
4 alloc test.img 130M
5 run
6 # You can uncomment the following to see the
7 # geometry (CHS), which is needed to repartition.
8 #sfdisk-disk-geometry /dev/sda
9 sfdisk /dev/sda 0 0 0 ,
10 pvcreate /dev/sda1
11 vgcreate VG /dev/sda1
12 lvcreate LV1 VG 32M
13 lvcreate LV2 VG 32M
14 lvcreate LV3 VG 32M
15 sync
16 EOF
17
18 truncate --size=260M test.img
19
20 guestfish -a test.img <<EOF
21 run
22 # Turn off the VGs before we can repartition.
23 vg-activate-all false
24 sfdisk-N /dev/sda 1 32 255 63 0,31
25 vg-activate-all true
26
27 pvresize /dev/sda1
28
29 # The following command would fail if the
30 # partition or PV hadn't been resized:
31 lvcreate LV4 VG 64M
32
33 echo New LV list:
34 lvs
35 EOF