tmpfs /dev/shm tmpfs defaults 0 0
proc /proc proc defaults 0 0
sysfs /sys sysfs defaults 0 0
/dev/main/swap swap swap defaults 0 0
/dev/main/home /home ext3 defaults 1 2
/dev/main/multimedia /tmp/media ext3 defaults 1 2
/dev/main/survey /usr/lib/survey ext3 defaults 1 2
The new line (highlighted in bold) contains the filesystem block device, the mount point, the filesystem type, any mount options ( defaults specifies the default options, which include mounting the filesystem at boot time), whether the filesystem should be backed up ( 1 meaning
6.1.1.3.6. Creating a snapshot logical volume
The
# lvcreate -s
Logical volume 'survey-snap' created
The -s option indicates that this is a snapshot LV. Specify the origin LV as the first positional argument, and use the --name and --size options as you would for a regular
Once the snapshot has been created, it can be mounted and used:
# mkdir
# mount
To have the snapshot automatically mounted when the system is booted, edit the file
To see how much of a snapshot's storage is in use, use
# lvs
LV VG Attr LSize Origin Snap% Move Log Copy%
home main -wi-ao 1.00G
multimedia main -wi-a- 752.00M
root main -wi-ao 9.77G
survey main owi-ao 5.00G
survey-snap main swi-ao 500.00M survey 8.27
swap main -wi-ao 1.00G
# lvdisplay
LV Name /dev/main/survey-snap
VG Name main
LV UUID IbG5RS-Tcle-kzrV-Ga9b-Jsgx-3MY6-iEXBGG
LV Write Access read/write
LV snapshot status active destination for /dev/main/survey
LV Status available
# open 1
LV Size 5.00 GB
Current LE 1280
COW-table size 500.00 MB
COW-table LE 125
Allocated to snapshot 8.27%
Snapshot chunk size 8.00 KB
Segments 1
Allocation inherit
Read ahead sectors 0
Block device 253:7
In this case, 8.27% of the snapshot storage has been used, or about 41 MB. If this approaches 100%, you can grow the snapshot LV using
6.1.1.3.7. Removing a logical volume
To remove a logical volume, unmount it, and then use
# umount
# lvremove
Do you really want to remove active logical volume 'survey-snap'? [y/n]: y
Logical volume 'survey-snap' successfully removed
Removing an LV is irreversible, so be sure that you're not deleting any important data.
6.1.1.3.8. Adding a partition
To set up a partition for use as a physical volume, use the
# pvcreate
Physical volume '/dev/sde1' successfully created
If the disk is not partitioned, you can use