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:
-
- You have plenty of old firmware in /var/nsinstall. You may delete these remains. They are not needed at all.
- 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.
- 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.
- 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
- Extend the vDisk to whatever size you like.
- 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!)
- Wen needed, in VMWare, I could extend my drive under VM-Ware during running my ADC, but not under XEN without Le-BSD)
- 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)
- execute gpart resize -i 1 ad0 (or what ever name your drive has)
- execute gpart commit ad0s1 (to commit changes)
- execute gpart show to see the extended partition. There should now be unused space on the partition.
- execute gpart resize -i 5 ad0s1 to extend /var (or -i 1 to extend /flash, -i 2 for swap)
- 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
Hi! Thanks for the how-to. However one last step seems to be missing:
growfs /dev/ad0s1
Regards, Lukas
You are right. I forgot about that step! How could I! Thanks!
Good to know, thanks.
You could do this by booting into single user mode instead of having to use a boot CD.
https://support.citrix.com/article/CTX322857/unable-to-boot-vpx-into-single-user-mode-console-gets-stuck-at-nskern-devmd0-for-compatibilty
It”s not so much that gparted isn”t supported, but that there isn”t public documentation on it (yet).
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.