aboutsummaryrefslogtreecommitdiff
path: root/examples/lvmpbuilder/sample_device_creator
blob: 4c388101899bdf6b64de4701a581f503cbfb6909 (plain)
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
#!/bin/sh
#The files in this directory (except pbuilderrc) were written by
#(C) 2006 Kapil Hari Paranjape <kapil@imsc.res.in>. 
#They are placed in the public domain. You can do with them exactly as you wish.

## Uncomment these lines after filling the
## full path of a device with at least 2G
# DISK=/dev/hda5
## ...and...
## Comment these lines to use the actual device
## You entered above
LOOPTMP=$(mktemp /tmp/loop.XXXXXX)
dd if=/dev/zero of=$LOOPTMP bs=10M count=200
DISK=$(losetup -f)
losetup $DISK $LOOPTMP

# Possible steps to create base and cow devices
pvcreate $DISK
vgcreate pbuilder $DISK
lvcreate -L 500M -n base pbuilder
lvcreate -L 1.5G -n cow pbuilder

echo BASEDEV=$(ls /dev/pbuilder/base) && \
echo COWDEV=$(ls /dev/pbuilder/cow)