Extending the /var partition on a Citrix NetScaler VPX

E

last update: November 16 2023

There is a question coming up every now and then: How to extend space on a Citrix ADC formerly called NetScaler. First of all: There is no supported way to do so!

With this in mind, we can continue.

Is there a real need to extend the disk space?

The answer is no. There is plenty of space for all needs.

You said, there is space enough, why did I run out of diskspace?

That’s hard to answer. There may be several reasons. Probably, you have plenty of data that could get erased:

    1. You have plenty of old firmware in /var/nsinstall. You may delete these remains. They are not needed at all.
    2. You have core dumps in /var/core. The intention of these dumps is, to send them to Citrix, so Citrix can fix firmware bugs. There is absolutely no reason to keep them if you didn’t do so in a timely manner.
    3. You have crash dumps in /var/crash. The intention of these dumps is, to send them to Citrix, so Citrix can fix firmware bugs. There is absolutely no reason to keep them if you didn’t do so in a timely manner.
    4. There is something wrong with your log-file rotation. Check, if there are over-sized logs in /var/log or /var/nslog

I am pretty sure, you will have space enough if you clean up your installation, and no more need to extend /var. You should now have about 50% of free space.


No matter, I want to extend space on /var

I warned you about disk space extensions not being supported. I never do so, however, I think it’s not that dangerous to do. There are two methods:

Add a second vDisk

That’s more or less simple. You might mount it to /var/nsinstall and you’ll always have plenty of space to upgrade your Citrix ADC / NetScaler. It takes rather little knowledge to do so.

Extend the existing vDisk

  1. Extend the vDisk to whatever size you like.
  2. Boot the VM using a BSD boot CD, run life-CD. Alternatively, you could boot the NetScaler into single user mode. That’s what Mike Streetz suggested. Thanks for this tipp!)
  3. Wen needed, in VMWare, I could extend my drive under VM-Ware during running my ADC, but not under XEN without Le-BSD)
  4. execute gpart show to prove, there is some free (unalocated) space on the drive. It will also tell you the name of the current drive (i.E. da0, ad0)
  5. execute gpart resize -i 1 ad0 (or what ever name your drive has)
  6. execute gpart commit ad0s1 (to commit changes)
  7. execute gpart show to see the extended partition. There should now be unused space on the partition.
  8. execute gpart resize -i 5 ad0s1 to extend /var (or -i 1 to extend /flash, -i 2 for swap)
  9. execute growfs -M /var /dev/ad0s1 to adapt the file-system (thanks, Lukas, I’ve forgotten to mention this one)

That’s all. Reboot, double-check, your /var should be bigger now 🙂


I hope that helped. Drop me a comment, if you are happy with this blog

About the author

Johannes Norz

Johannes Norz is a Citrix Certified Citrix Technology Advocate (CTA), Citrix Certified Instructor (CCI) and Citrix Certified Expert on Application Delivery and Security (CCE-AppDS).

He frequently works for Citrix international Consulting Services and several education centres all around the globe.

Johannes lives in Austria. He had been borne in Innsbruck, a small city (150.000 inhabitants) in the middle of the most beautiful Austrian mountains (https://www.youtube.com/watch?v=UvdF145Lf2I)

5 comments

  • Hi! Thanks for the how-to. However one last step seems to be missing:
    growfs /dev/ad0s1

    Regards, Lukas

    • Thanks, Mike. Sure, you could do like that. I didn’t think of single user mode.

      My definition about “not supported” is “not documented”. Not supported means, Citrix support will refuse to give support, if this modification is guilty for troubles that came up. It’s very unlikely to happen, and usually they’ll never find out. But Citrix Professional Services won’t extend the /var partition (not to mention /flash!).

      I wrote this blog because a student in one of my classes wanted to extend the /var partition. I spent an evening in a hotel to do so. This student was a “I do all tricks I’ll ever hear of, because I’m a real pro” guy. He had plenty of troubles to solve, most of them because of these tricks. That’s why I added a warning to this blog article. By the way, his need to extend /var was, because he installed and runs several additional services in BSD. This is neither supported, nor a good idea, as it constantly overruns the management CPU. His management CPU running on 100 % caused several “funny” side effects like not logging every event but skipping some, authentication failing sporadically and some more.

By Johannes Norz

Recent Posts

Recent Comments