ZFS and FreeBSD jails

The ZFS file system is nicely integrated with Solaris’ zones. It came to my mind a long ago that will be very cool to integrate ZFS with FreeBSD jails.

People are talking for a long time about making jails more feature full, but mostly on networking front - my multiple IPs in jail patch, Marko Zec vimage, etc., but they forget about storage.


Unfortunately we can’t allow jail’s administrators to access raw disks/partitions (GEOM providers), create file systems on them and mount those file systems. The reason is that we can’t handle corrupted file system metadata, which will allow someone from within a jail to write some garbage to file system partition and panic entire system.


And here comes ZFS. ZFS can very nicely be used for such needs, because we operate on raw disks only when we operate on pools. When we operate on file systems, we don’t have access to raw disks anymore.


The basic idea is to allow pool management only from outside a jail, and assign ZFS file systems to the jails.


For example:
main# zfs create tank/jail

main# zfs set jailed=on tank/jail

main# zfs jail 1 tank/jail

Now from within a jail we can:
jail# zfs create tank/jail/home

jail# zfs create tank/jail/home/pjd

jail# zfs create tank/jail/home/pawel

jail# zfs snapshot tank/jail/home/pjd@backup

jail# zfs destroy tank/jail/home/pawel

jail# zfs rollback tank/jail/home/pjd@backup

jail# zfs set compression=on tank/jail/home/pjd

I’ll use this slot to keep list of dataset names accessable inside the jail.Good, now we need to allow for mounting/unmounting file systems from within a jail.

I added security.jail.mount_allowed sysctl, which when set to 1, grants PRIV_VFS_MOUNT and PRIV_VFS_UNMOUNT privileges to jailed root. I’m not really happy with this sysctl, because currently it allows to mount file systems like devfs and procfs from within a jail, which is very wrong, especially for devfs.


We also need to set security.jail.enforce_statfs to 0, so zfs command can see mounted file systems.


What is described to this point is already implemented and work.

I’d also like to add ’jails’ property, which tells to which jails the given dataset is attached.

45 Responses to “ZFS and FreeBSD jails”

  1. ZFS and FreeBSD jails Says:

    [...] Read more [...]

  2. Zfs udah di freebsd current « alamsyah rasyid blogry Says:

    [...] Malahan udah ada yang gandeng ZFS dan Jail di sini [...]

  3. Live, Learn and Study | ZFS and FreeBSD current Says:

    [...] about jails?  Just check this blog for more ilustrative [...]

  4. xiaoxinwow Says:

    Welcome to our website for you World of Warcraft Gold,Wow Gold,Cheap World of Warcraft Gold,cheap wow gold,buy cheap wow gold,real wow gold,sell wow gold, ...wow powerleveling Here wow gold of 1000 gold at $68.99-$80.99 ,World Of Warcraft Gold,buy wow gold,sell world of warcraft gold(wow gold),buy euro gold wow Cheap wow gold,cheapest wow gold store … buy euro gold wow wow gold—buy cheap wow gold,sell wow gold.wow powerleveling welcome to buy cheap wow gold—cheap, easy, powerleveling wow gold purchasing.World of Warcraft,wow gold Super …
    We can have your wow gold,buy wow gold,wow gold game,world of warcraft gold, wow Gold Cheap wow, Cheap wow gold,world of warcraft gold deal,Cheap WOW Gold …

    Welcome to our website for you World of Warcraft Gold,Wow Gold,Cheap World of Warcraft Gold,wow gold,buy cheap wow gold,real wow gold,sell wow gold, ...
    Here wow gold of 1000 gold at $68.99-$80.99,powerleveling World Of Warcraft Gold,buy wow gold,sell world of warcraft gold(wow gold),buy gold wow lightninghoof instock Cheap wow gold,cheapest wow gold store …
    wow gold—buy cheap wow gold,sell wow gold.welcome to buy cheap wow gold—cheap, easy, wow gold purchasing.World of Warcraft,wow gold Super …
    Wow gold- Gold for buy gold wow lightninghoof instock EU-Server: ...wow Gold EU: starting from 84,99?; 3000 WoW Gold EU: starting from 119,99?. wow Gold- Leveling Services: ...
    We can have your wow Gold,buy wow Gold,wow Gold game,wow gold, Cheap wow Gold, Cheap World of Warcraft Gold,world of warcraft gold deal,buy cheap wow gold,Cheap WOW Gold …

    Here wow Gold of 1000 gold at $68.99-$80.99,World Of Warcraft Gold,buy wow Gold,sell world of warcraft gold(wow gold),Cheap wow gold,cheapest World of Warcraft Gold store …

  5. Arearx Says:

    Arearx

    Arearx

  6. insurance loans cheapest car Says:

    only car cheapest insurance insurance car 21 cheapest

  7. acuralgnd Says:

    Hey guys,
    I just bought myself an acura legend from a friend!
    anyways!... Im searching for cheap car insurance..
    can any of you recommend some good, cheap car insurance companies to me please?
    would really appreciate it.

    Thank you!

  8. sevenfold avenged videos Says:

    avenged sevenfold videos piece avenged sevenfold

  9. buy kitchen appliances 7 Says:

    buy kitchen appliances

    buy kitchen appliances

  10. buy video games online Says:

    buy video games online

    buy video games online

  11. prescription order hydrocodone no Says:

    hydrocodone buy no prescription no prescription hydrocodone needed

  12. Terry (the car finder) Bolton Says:

    me too ;ask for somone recommend a good, cheap car insurance company to me please?
    lot of thanks

  13. çeviri Says:

    nice log.

  14. ikinci el i? makinalar? Says:

    thanks.

  15. money soma online Says:

    online soma some soma online adventure

  16. $anchor$basketball Betting,final Four,final Four Betting,final Four Gambling,final Four Sports Book,final Four Sportsbook,march Madness,march Madness Betting,march Madness Gambling,march Madness Sports Book,march Madness Sportsbook,ncaa,ncaa Betting,ncaa Says:

    $anchor$basketball Betting,final Four,final Four Betting,final Four Gambling,final Four Sports Book,final Four Sportsbook,march Madness,march Madness Betting,march Madness Gambling,march Madness Sports Book,march Madness Sportsbook,ncaa,ncaa Betting,...

    $anchor$basketball Betting,final Four,final Four Betting,final Four Gambling,final Four Sports Book,final Four Sportsbook,march Madness,march Madness Betting,march Madness Gambling,march Madness Sports Book,march Madness Sportsbook,ncaa,ncaa Betting,nc…

  17. $anchor$basketball Betting,final Four,final Four Betting,final Four Gambling,final Four Sports Book,final Four Sportsbook,march Madness,march Madness Betting,march Madness Gambling,march Madness Sports Book,march Madness Sportsbook,ncaa,ncaa Betting,ncaa Says:

    $anchor$basketball Betting,final Four,final Four Betting,final Four Gambling,final Four Sports Book,final Four Sportsbook,march Madness,march Madness Betting,march Madness Gambling,march Madness Sports Book,march Madness Sportsbook,ncaa,ncaa Betting,...

    $anchor$basketball Betting,final Four,final Four Betting,final Four Gambling,final Four Sports Book,final Four Sportsbook,march Madness,march Madness Betting,march Madness Gambling,march Madness Sports Book,march Madness Sportsbook,ncaa,ncaa Betting,nc…

  18. zxevil162 Says:

    KimwzW cool blog, man!

  19. Frankssportscircle1499$anchor$basketball Betting,final Four,final Four Betting,final Four Gambling,final Four Sports Book,final Four Sportsbook,march Madness,march Madness Betting,march Madness Gambling,march Madness Sports Book,march Madness Sportsbook,n Says:

    Frankssportscircle1499$anchor$basketball Betting,final Four,final Four Betting,final Four Gambling,final Four Sports Book,final Four Sportsbook,march Madness,march Madness Betting,march Madness Gambling,march Madness Sports Book,march Madness Sportsb…

    Frankssportscircle1499$anchor$basketball Betting,final Four,final Four Betting,final Four Gambling,final Four Sports Book,final Four Sportsbook,march Madness,march Madness Betting,march Madness Gambling,march Madness Sports Book,march Madness Sportsboo…

  20. zxevil161 Says:

    FjYsWu U from Russia?

  21. penis enlargement Says:

    love u all for this post. thanks for allowing comments here – good luck buddy

  22. Hit Counter Says:

    Counters are to count hits and hits to count is to count hits for free so free hit counterz for you to have free hits.

  23. tercüme Says:

    thanks.

  24. penis enlargement Says:

    penis enlargement

  25. Wow Gold Says:

    Hi Hello ! it seems you write the same articles as i do over the internet for the same things, i liked a lot the article about ZFS and FreeBSD jails , I was looking for articles about wow gold and i found your blog on Hotbot engine . I just stumbled your article to stumbleupon so you will have a chance to have over 100 visitors a day to this article about ZFS and FreeBSD jails . Congrats ! Great content ;)

  26. Free Cool Online Car Games Says:

    Hey! Finally I found a site the has some good information on Free Cool Online Car Games. I was searching around and found your post ZFS and FreeBSD jails, thanks for the good info..I’ll be checkin back soon.

  27. Car Cheapest Insurance Says:

    Nice topic you have started.

  28. bob Says:

    LvwB9D hi nice site thanks http://peace.com

  29. googlaaaa Says:

    wNtHQ3 http://googlaaaa.com/

  30. webmaster Says:

    Oh… Your blog used to be nice, but now it’s spoiled. Stop posting trash like that or stop posting at all.

  31. rickh Says:

    Wow! Cool news!Sounds a little weird, but interesting anyway. what do you guys think about it?

  32. ComputerScreensaver Says:

    Realy cool, brother :-)

  33. penis enlargement Says:

    [...][...]Penis enlargement products, American Most Trustworthy Natural herbal productz store for penis enlargement,Which increase your size 4-6 inches, Double the size Double the fun.(Yes No Pain ALL Gain) And more productslike weight loss, male enhancement, skin care, acne solutions, breast enlargement, hairLoss for men and women , multi Vitamin for men and women, optimum Diabetics, eazol Pain Relief , stretch mark prevention, revitol skin brightener, revitol hair removal cream, revitol anti-aging solution.
    http://www.naturalherbalproductz.com
    [...][...]

  34. penis enlargement Says:

    Penis enlargement products, American Most Trustworthy Natural herbal productz store for penis enlargement,Which increase your size 4-6 inches, Double the size Double the fun.(Yes No Pain ALL Gain) And more productslike weight loss, male enhancement, skin care, acne solutions, breast enlargement, hairLoss for men and women , multi Vitamin for men and women, optimum Diabetics, eazol Pain Relief , stretch mark prevention, revitol skin brightener, revitol hair removal cream, revitol anti-aging solution.This blog is very informative and thanks for the updates and the blog colour and desiging is very beautiful after seeing this u must be a creative man
    http://www.naturalherbalproductz.com

  35. ComputerScreensavers Says:

    Men, U cool

  36. Screensavers Says:

    U cool, man

  37. Cheapest Auto Financing Says:

    I have to say, that I could not agree with you in 100%, but it?s just my opinion, which could be wrong.

  38. Cheapest Car Insurance Says:

    You got a nice post on ZFS and FreeBSD jails. Really very nice to read and useful, thanks for the nice share.

  39. Business Says:

    Nobody can stop me by posting these comments.
    http://www.businesswebhostings.net

  40. tercüme Says:

    tercüme

  41. Meetings Says:

    great side

  42. Penis Enlargement Says:

    Enlargement Your Penis Quickly & Safely Herbal Penis Enlargement

  43. Penis Enlargement Says:

    http://www.skincarefairy.com/penis-enlargement.html

  44. roulette systems Says:

    There is no doubt that the Bush Administration is slow to fill both confirmed appointments and day-to-day non-confirmed political appointments. Historically – this shortage of appointments occurs later is a lame duck administration – people don’t want to leave another permanent job for a few months in a closing administration – and in this case more than others – it is tough to get people to serve an unpopular President.
    how to play video poker
    It is also true that the party in control of the Senate is slow to approve appointments which have permanent terms – perhaps 5-12 years long and install the other party in for the long pull when there is a chance they might own the White House in January 2009 and can fill those jobs with their own people.

  45. horse racing system Says:

    CONFIDENTIAL EMAIL
    The information in this email is confidential and may be privileged or subject to copyright. It is intended for the exclusive use of the addressee(s). If you are not an addressee, please do not copy, distribute or otherwise act on the email.

    blackjack game

Leave a Reply