Giving /opt/Autodesk more space

Sometimes when installing Linux for Flame, you get everything setup and running but much later discover /opt/Autodesk is running out of space because you accidentally made your root / partition (where /opt is) kind of small, while /home (that you're not using a lot of) is kind of giant.

There's any number of ways of correcting this; the most drastic is to back up all your projects and other work, and just start from scratch with a re-format and re-install, fixing your partitioning from the beginning. Blech!

"But wait, I'm running on LVM! Can't I just resize the virtual partitions?" Well, yes, but in this case not easily. While LVM does allow you to grow and shrink its virtual partitions (that's part of the point), the underlying filesystem also has to be shrink-capable – which, in the case of XFS, is not. You could however destroy /home and add its space to / (XFS can grow) but that means having to temporarily backup/move your existing /home, destroy the /home LVM partition, resize the / LVM partition, expand the filesystem on /, then finally restore your old /home on the new single /. There's a guide in Autodesk's knowledge base if you want to do this. Don't mess anything up.

But there's an easier, safer workaround.

If you're not in a position (or the mood) to re-partition/re-install or start screwing with LVM, there's an easier solution: Move /opt/Autodesk onto a partition that has more space, like /home, and then mount /opt/Autodesk from the new location. From both yours' and the system's standpoint, nothing will have actually changed – you still use /opt/Autodesk like you normally do, but the data just happens to physically live somewhere else. And doing it is a benign operation that doesn't involve screwing with your partitions or filesystems.

How-To

First, quit Flame and use the Autodesk Service Monitor app to stop ALL the background services, so nothing is running with open files making changes in /opt/Autodesk. Click each Stop button until all the lights to the left are red.

flame-service-monitor.png

Next, copy your existing /opt/Autodesk directory to a new place that has space. Generally speaking this is usually /home in the default setup, but it could even be a separate HD/SSD you've added to the system. For the purposes of this guide, we are going to use /home. Open a terminal and type:

sudo cp -p -r /opt/Autodesk /home/

Please note the trailing slash on /home/ and the lack of trailing slash on /opt/Autodesk so you copy the entire Autodesk directory into /home, winding up as /home/Autodesk. This process could take awhile, depending on the speed of your disks and how many Flame projects you have/how big they are – there are a lot of individual files.

Once completed, temporarily rename the old /opt/Autodesk directory:

sudo mv /opt/Autodesk /opt/Autodesk_BACKUP

Keep it around as a backup while finishing the rest of the process. It can be deleted later to reclaim the space once you've verified everything is working right after completing the rest of the setup.

Now we want to mount our new /home/Autodesk as /opt/Autodesk so everything is accessed as /opt/Autodesk transparently and works like it always did:

sudo mkdir /opt/Autodesk
sudo mount -o bind /home/Autodesk /opt/Autodesk

Assuming you see no errors, do:

ls /opt/Autodesk

and you should see all the Flame contents as normally would.

Using the Service Manager again, start all the services back up by clicking the Start buttons until all the lights to the left are green. Launch Flame, and give it a quick test. Everything should be just as it was.

Make it permanent

If all went well, the last thing to do is add the mount we manually did above to /etc/fstab to make it automatic and "permanent" across reboots. Edit /etc/fstab with something like nano:

sudo nano /etc/fstab

and add the following line to it somewhere (at the bottom is fine):

/home/Autodesk  /opt/Autodesk  none  bind

and save it.

Now you can reboot the system, make sure things are still working as expected, and go on about your Flame business! Once you are comfortable everything is running correctly, you can delete the old backup /opt/Autodesk_BACKUP directory to reclaim the space on your crowded / partition.

Final note

Remember that /opt/Autodesk is really living its life in /home/Autodesk (or wherever you put it) so don't forget about it in 6 months and delete it thinking it's just a backup you forgot you made. For all practical purposes, /opt/Autodesk and /home/Autodesk are identical and anything you do in one affects both.

Also note that it's only /opt/Autodesk specifically that is mounted from elsewhere – /opt its self is still on your root partition /, so any other directories/files inside /opt (like /opt/Tangent for instance) remain in and consume space on the root partition.