volume management

Pawel Jakub Dawidek pjd at FreeBSD.org
Tue Apr 10 11:58:47 UTC 2007


On Tue, Apr 10, 2007 at 01:37:02PM +0200, Gergely CZUCZY wrote:
> The mot accurate description would be the functionality
> of linux's LVM in the scope of volume management, that's why
> i had given this subject to this email/topic.
> 
> I have a storage pool (the last part of a disk), from which
> i want to chop little pieces for services, and i want to be
> able to increment these little pieces whenever needed.
> 
> Like i have a pool of 100G. i have two services, i allocate
> 10G and 20G for them. 30G is used. Upon need, i allocate a bit
> more first to service1, then it will have 15G of space
> available. After this, the other one might need a bit more
> space, so i give it a bit more, let's say 8G, and it will
> have 28G of space.
> 
> It's really what i have described here several times. Having
> a storage pool, from which volume management can be done. Dynamic
> allication of storage areas from the same pool, and having the
> abilit to increase the size of the previously allocated storage
> areas when it's needed. It's kinda like what's Linux's LVM's
> main feature. And i'm a bit surprised that FreeBSD doesn't
> have a similar thing.

Yeah... If you can afford running 7-CURRENT, you should really try ZFS.
Even if you don't want to use ZFS file systems, you can still use ZFS
ZVOLs and run UFS on top of them.
For example:

	# zpool create tank mirror da0 da1
	# zfs create -V 10g tank/foo
	# zfs create -V 20g tank/bar
	# diskinfo -v /dev/zvol/tank/{foo,bar}
	/dev/zvol/tank/foo
		512		# sectorsize
		10737418240	# mediasize in bytes (10G)
		20971520	# mediasize in sectors

	/dev/zvol/tank/bar
		512		# sectorsize
		21474836480	# mediasize in bytes (20G)
		41943040	# mediasize in sectors
	# newfs /dev/zvol/tank/foo
	# mount /dev/zvol/tank/foo /foo
	# newfs /dev/zvol/tank/bar
	# mount /dev/zvol/tank/bar /bar

Now, when you want to grow tank/foo:

	# umount /foo
	# zfs set volsize=30g tank/foo
	# growfs /dev/zvol/tank/foo
	# mount /dev/zvol/tank/foo /foo

Not to mention you have fast UFS snapshots, clones and other cool
stuff:)

The hardest part of ZFS was ZPL (ZFS POSIX Layer), which only comes into
play for ZFS file systems and is not used when using ZVOLs.

-- 
Pawel Jakub Dawidek                       http://www.wheel.pl
pjd at FreeBSD.org                           http://www.FreeBSD.org
FreeBSD committer                         Am I Evil? Yes, I Am!
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-geom/attachments/20070410/8fe56cbf/attachment.pgp


More information about the freebsd-geom mailing list