There’s no easy way to shrink a filesystem on the celerra. Once the filesystem size has grown or has been set it can’t be shrunk. However, you can get around it with a very short outage by creating a copy and then swapping the two over via re-mounting. Here’s how to do it.
Let’s assume we have a filesystem like this one:
- Filesystem Name = myfilesystem
- Filesystem Size = 300GB of pre-allocated space
- Data Type = file data shared via CIFS totalling 50GB in size
- DHSM enabled with data archived to secondary filesystem (CIFS in this case)
In this case we have 250GB of wasted space in our filesystem. The goal is to shrink this down to 100GB of pre-allocated space and have 50% file usage on the filesystem.
1] Create a new filesystem 100GB in size (the target size) = myfilesystem_new
2] Use a copy utility to copy the data from the old to the new filesystem. If you’re using DHSM you’ll want to use emcopy which by default will only copy the stubs.
3) Delete all checkpoints and checkpoint schedules on both filesystems (you need to do this before it’ll let you rename the filesystem).
4] SSH onto the celerra and type the following to unmount both myfilesystem and myfilesystem_new filesystems
/nas/bin/server_umount vdmname -p myfilesystem /nas/bin/server_umount vdmname -p myfilesystem_new
as soon as you do this the share and filesystem is offline until you remount it. This should only be a few seconds.
5] Swap the names of the filesystems around
/nas/bin/nas_fs -rename myfilesystem myfilesystem_old /nas/bin/nas_fs -rename myfilesystem_ myfilesystem
6] Remount the filesystems now they’ve been renamed
/nas/bin/server_mount vdmname myfilesystem myfilesystem /nas/bin/server_mount vdmname myfilesystem_old myfilesystem_old
Now the filesystem is back online and you can test it is working OK by browsing to the share.
7] Delete the old mountpoint which isn’t being used (we named it old)
/nas/bin/server_mountpoint vdmname -delete myfilesystem_new
8] Recreate your checkpoint schedule.
What we’re left with is myfilesystem_new now called myfilesystem and the production filesystem. The old filesystem is now myfilesystem_old, which can be deleted when you’re happy all the data is there. The umount, rename, remount steps should take about 10 seconds.
You can even do a final check to see the data is OK and there wasn’t any last minute writes by comparing \\mycifsshare\c$\myfilesystem with \\mycifsshare\c$\myfilesystem_old.