UNIX Consulting and Expertise
Golden Apple Enterprises Ltd. » Page 'Easy imaging of Solaris using flars – Solaris Flash Archives'

Easy imaging of Solaris using flars – Solaris Flash Archives

As previously posted about, the Solaris install is a bit of a slug due to the way the package manager processes the huge amount of files contained in a package.

Flash Archives (flar files) are one solution to this problem. Let’s say you’ve built a model install – everything is in place, all your custom packages, banners, OE tweaks – the works. Wouldn’t it be nice if you could take an image of that Solaris install, to slap down somewhere else?

Or maybe take point in time image snapshots of an environment, for use by developers to let them quickly roll back to a known previous version of their software?

Flash archives let you do all of this. At their most basic, they’re a way of taking an image of a Solaris install. You end up with a single (large) file, which can then be archived/transferred/restored/whatever.

flars are easy to use – the flarcreate command is all you need:

bash-3.00# flarcreate -n "T2k Sol10 8/07" -x /var/flars -R / /var/flars/sun4v_sol_10_Generic_120011-14.flar
Full Flash
Checking integrity...
Integrity OK.
Running precreation scripts...
Precreation scripts done.
Creating the archive...
2019951681 blocks
Archive creation complete.
Running postcreation scripts...
Postcreation scripts done.

Running pre-exit scripts...
Pre-exit scripts done.

The syntax is pretty straightforward:

  • -n specifies the name you’re giving to your flar
  • -x says what files and directories to exclude – in this case, we don’t want to include the directory where we’re creating and storing our flars
  • -R says where the root of the flar will be – in this case we’re imaging a full Solaris install, so we want to start from /
  • and the final part is the full path and filename of the flar we are creating

One thing that it’s important to remember, is that flarcreate will follow symlinks and mount points. If you have a 100gb /export/home, it will try and add that to your flar. This may not be what you want – especially if you’re creating a Solaris image for Jumpstart – so flars are best created from single user mode, when the system is idle and nothing unnecessary is mounted or running.

Another important point to note is that flars are hardware class dependant. If I create an image of a sun4v Solaris install (in this case, a trusty Sun T2000) then the flar will just contain the kernel and driver files for sun4v. If you try and boot a sun4u box (like a Sun V440) it’s going to go horribly wrong.

If you want to use flars to Jumpstart machines, you’ll need to have a master flar image for each machine hardware class you have in your estate – we can find this out with the uname command:

bash-3.00# uname -m

We can use flar info to query a flar file to see what it contains:

bash-3.00# flar info sun4v_sol_10_Generic_120011-14.flar 

And that’s it, basically. There’s not much to it, and it’s pretty simple to use. flars function in pretty much the same way as a normal archive file – we can use the flar command to list files inside the archive and find out more about the archive itself.

Like this post? Spread the word!
delicious digg google
stumbleupon technorati Yahoo!

3 comments to “Easy imaging of Solaris using flars – Solaris Flash Archives”

  1. […] as covered in a previous post, Solaris Flash Archives give us a nice way to image a Solaris installation, and then to use that to build a machine via […]

  2. […] zones. Unlike a normal zone, which installs from the global zone, a branded zone uses a flar (Solaris flash archive) to install a different Solaris OE. In this case I’m going to go through setting up a Solaris […]

  3. Good article, but I don’t see how to use a FLAR once is gets created.

Top of page / Subscribe to new Entries (RSS)