“Shrinking” a Celerra filesystem

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.

Tagged , , , , ,

8 thoughts on ““Shrinking” a Celerra filesystem

  1. th says:

    great post; worked like a charm.

    just missing / on the step 6: i had to add them for this to work on our VNX
    /nas/bin/server_mount vdmname myfilesystem /myfilesystem
    /nas/bin/server_mount vdmname myfilesystem_old /myfilesystem_old

  2. jaideep says:

    Good post.. is there any EMC Primus no for this solution…

  3. Derek says:

    I am having a problem with this. I have one filesystem that is 1.8 TB in size and is using 1.7 TB of it. I created a new file system that was just over what is being used in the 1.8 and made sure to make it read only. When i try to copy to the new file system it just tells me “The system could not find a read-only file system on the destination side that is the same size and file-level retention setting as the source file system. ” Any ideas? Thanks.

    • stujordan says:

      If I’m reading your post right you’ve created a new read-only file system to which you want to copy your current files onto. Wouldn’t you want this new FS to be a read-write?

  4. David Rippey says:

    Some good advice on the process. Thank you

  5. Carlos says:

    Thanks for the useful post. Using this as a guide I was able to successfully split a 7.0 TB file system into two smaller,distinct file systems over the past week. :)

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: