ZFS and FreeBSD jails

March 18, 2007 by · 394 Comments 

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.

About pjd

Comments

394 Responses to “ZFS and FreeBSD jails”
  1. Today, youngers pay more attention to fashion, even in chilly winter, they still choose fashionable chothing as their first choice. Womens will silm their figure with spyder jackets instead of North face jackets. They all think that they can be stars in the street, but it is wrong. North face jackets also can wear out your styles, a small belt, a tight jean, or a high-heel boot also can show your personality at first glance. Well, the greatest art is not art itself, it was the people that make ordinary clothing to special things. However, fashion is what we see, it just a feeling, even you will North Face Jackets, you will find your style dress at once. Also with North Face Jackets, it doesn’t bound you, so you can do extreme action as you want, prefect your performance in show or just a match.

  2. The nib is handcrafted, 14 caret gold. This is a single of the scaled-down intended pens and is intended, according to the site, for a lady’s purse or for inclusion in an organizer. That would make it some special organizer, yes? As a piece of the Meisterstruck line, this pen is focused to the brilliance and will work of Wolfgang Amadeus Mozart.

  3. Thank you for sharing your stuff on blog. It is doubtless that we have similar interests. Something are very helpful to me.

  4. Its northern border Face Jackets also are about the most successful products. They are appreciated worldwide with their quality and fashions. North Face Jackets are around for both men and women; moreover there will be another

  5. miu miu bags says:

    Usually, women pick a Boot, the fur you will like it in winter. Enjoy the sexy red bottoms from . The sale shoe can reach your style.And we offer women and , you can enjoy the online. The fashion which are one series of Prada.

  6. Gucci Outlet says:

    Nice post keep up with this interesting work. Our online Gucci are sale hot in our [url=http://www.guccioutletorg.com]Gucci Outlet[/url]. Famous brand Gucci is loved by many women. You can take a bag or handbag from here.

  7. Gucci Outlet says:

    Nice post keep up with this interesting work. Our online Gucci are sale hot in our http://www.guccioutletorg.comGucci Outlet. Famous brand Gucci is loved by many women. You can take a bag or handbag from here.

  8. I’m definitely enjoying the information. All Louis Vuitton Outlet is created with only the very best materials and top-quality engineering and design.

  9. Gucci Outlet says:

    Nice site I liked very much. Thanks to sharing.Are you become fashion? Welcome to look at my Gucci Outlet website and hope we can become good friends, and exchange and to help each other.Thanks!

  10. Gucci Outlet says:

    I have never read so wonderful article before, I have learned more after read your article. If you go to our Gucci Outlet, you will like all of our products.

  11. Thank you for sharing with us. The content is very good and helpful for me, I learn and know more about it.

  12. promotional item, say, your notepad printing, tagged along with your washer-dryer. It makes sense to think in sets when promoting your business.

  13. Writing is always smooth and easy with a fountain pen. In a fountain pen, a nib at the tip of the pen controls the ink reservoir present inside the pen.

  14. Excellent site, keep up the good work my colleagues would love this. I read a lot of blogs on a daily basis and for the most part, people lack substance but, I just wanted to make a quick comment

  15. I liked the posts and cool layouthttp://www.clotheswholesalecheap.com
    you have here! I would like to thank you for sharing your experience and the time it took to post!! Two Thumbs up!

  16. I would like to congratulate the author http://www.inoakleyoutlet.netfor his brilliant efforts in putting this great article together. Thanks for sharing.

  17. http://www.okfake-oakleys.com/To wear glasses of the mm for,Fake ray bans make up seems , just more need to highlight your makeup through facial advantages.Fake ray bans Glasses makeup the most importa glasses added together to face show

  18. http://www.newerahatswholesale.net/ To wear glasses of the mm for,Fake ray bans make up seems , just more need to highlight your makeup through facial advantages.Fake ray bans Glasses makeup the most importa glasses added together to face show

  19. http://www.newerahatswholesale.net/ Stylist more and more like play some flowers in the hat kind.Cheap New Era Hats Aalexander McQueen even transplant a peacock technique the expression just a concept,Cheap New Era Hats you want to understand the essence of popular, garnish with realistic works, make belong to real life Style.Red cowboy hat with classical suits have new idea, if you weren

  20. They have no institution license and only give poor-high quality Oakley sunglasses. The negative impact in the reduced-high quality crucial oil Rig Oakley Sunglasses is self-explanatory.

  21. I honestly believe you understand what you really are discussing. Out of your enthusiasm, you have turn out to be an authority on blogging. Great job.http://www.vikicks.com

  22. http://www.theoakleyscheap.net
    This is the really good start reading for me, Must admit that you will be a great bloggers I ever noticed.Thanks for post this informative article.

  23. Testimonials says:

    Then, ZhangXiaoHai said the base would “disappointed”, feel sincerity nirvana hall is not enough, not only refused to visit, are still in the hall of nirvana news conference, held a small press conference, refutes hall of nirvana. And in the conference hall of nirvana reporters after visiting the meeting, and the company’s invited a 16 research of Chinese medicine and zoology of experts, including former deputy director of the health YaoZhengJu, original state, the administration’s chief drug registration division of China pharmaceutical university ZhangShiChen and traditional Chinese medicine information.Christian Louboutin Escarpins

  24. Very nice and impressive article you have posted. Its very helpful, i have read and bookmark this site and will recommend it to more other peoples.

  25. May your love soar on the wings of a dove in flight.

  26. Ecommerce is a new pace to trade where almost every thing is been sold online

  27. John says:

    This is one example of a quality blog. The ideas are presented very well and can be understood easily by the readers. Good job blogger!

  28. http://www.karenmillenoutletdu.net made using plastic which made them very popular instantly.

  29. and fancied the ideal indicates of effecting it will be by not wanting him also prolonged. Edmund wasn’t unwilling being persuaded to engage with the organization;

  30. Please contact us if you need our products.Welcome to patronize our Website! Led Web-Stores

  31. Smithd7 says:

    Very nice! bkefbaadda

Trackbacks

Check out what others are saying about this post...
  1. [...] Malahan udah ada yang gandeng ZFS dan Jail di sini [...]

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

  3. buy kitchen appliances

    buy kitchen appliances

  4. buy video games online

    buy video games online

  5. $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…

  6. $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…

  7. 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…

  8. Everglades boats…

    … if you check out my various articles around these keywords sound very natural so you will have the ability to discover how you can compel these people happy, they are ever misplaced. you then get, not only effective but it really doesn’t give you …

  9. avoid premature ejaculation…

    Do you need some new nice templates about WordPress…



Speak Your Mind

Tell us what you're thinking...
and oh, if you want a pic to show with your comment, go get a gravatar!