[DRBD-user] Best way to use LVM with drbd: xfs directory quotas

Lars Ellenberg lars.ellenberg at linbit.com
Fri Feb 15 19:08:32 CET 2008

Note: "permalinks" may not be as permanent as we would like,
direct links of old sources may well be a few messages off.


On Fri, Feb 15, 2008 at 09:03:06AM -0800, rois wrote:
> I'm running XFS on top of DRBD on top of LVM on top of a hardware
> RAID-5.  My reasoning was I didn't want to leave a ton of room for my
> system and log files but wanted to be able to expand them later if I
> needed to.  I figured the easiest way was to put my whole HWRaid-5 Array
> into the LVM and then parse it out as needed.  I'm also running several
> servers/apps on this cluster whose data I wanted isolated so one service
> couldn't be crashed by another one using all the space up.  This also
> seemed the most flexible.
> 
> /dev/sda1 (100%) -> vg0 (lvm2)  [sda1 is my HWRAID-5 array]
> 
> /dev/vg0 >	vg0/root “/” (1G) xfs filesystem
> 		vg0/var “/var” (1G) xfs filesystem
> 		vg0/swap “swap” (1g) swap
> 
> drbd0 = /dev/vg0/home  - HA mounts drbd0 on /home (XFS)
> drbd1 = /dev/vg0/mysql - HA mounts drbd1 on /mnt/mysql (XFS)
> drbd2 = /dev/vg0/basic - HA mounts drbd2 on /usr/lib/basic (XFS)
> drbd3 = /dev/vg0/smb   - HA mounts drbd3 on /mnt/smb (XFS)
> 
> Expanding the drbd's is a little bit of a hassle but since I should have
> to do it that often I don't care that much.  I wonder if there is a
> linux quota service somewhere that could monitor directory usage instead
> of using partitions to do that.  Hadn't thought of that before but may
> need to look into it.  Expanding a quota (like on a webserver) would be
> a lot easier.  Oh well.

nothing to do directly with drbd, but, since you are using xfs:
it supports "project quotas", see man xfs_quota, search for directory
tree quota.
(you maybe want to check for upgrades of your xfsprogs package)

man page is slightly confusing in the examples, though.  basically, for
your setup on one single mountpoint, you'd have something like

/etc/projects
10:/mntpoint/home
11:/mntpoint/mysql
12:/mntpoint/basic
13:/mntpoint/smb

/etc/projid
home:10
mysql:11
basic:12
smb:13

mkfs.xfs /dev/drbdX
mount -o prjquota /dev/drbdX /mntpoint
mkdir /mntpoint/{home,mysql,basic,smb}
xfs_quota -x -c 'project -s home mysql basic smb' /mntpoint
xfs_quota -x -c 'limit -p bhard=20G home' /mntpoint
xfs_quota -x -c 'limit -p bhard=10G basic' /mntpoint
...

-- 
: Lars Ellenberg                           http://www.linbit.com :
: DRBD/HA support and consulting             sales at linbit.com :
: LINBIT Information Technologies GmbH      Tel +43-1-8178292-0  :
: Vivenotgasse 48, A-1120 Vienna/Europe     Fax +43-1-8178292-82 :
__
please use the "List-Reply" function of your email client.



More information about the drbd-user mailing list