Results 1 to 3 of 3

Thread: Moving /opt to another drive

  1. #1
    Join Date
    Jul 2015
    Location
    Essex, UK
    Beans
    703
    Distro
    Xubuntu

    Moving /opt to another drive

    I have invested in another M2 1TB drive and would like to move /opt to the new drive from its current location /opt.

    /opt currently contains 3 directories including google and teamviewer. The third program is minecraft and I know I can move that easily but I am unsure about the others. I could uninstall teamviewer and reinstall it after the move, but google which contains earth and chrome?

    How do I deal with this?

  2. #2
    Join Date
    Nov 2007
    Location
    London, England
    Beans
    7,365
    Distro
    Xubuntu 20.04 Focal Fossa

    Re: Moving /opt to another drive

    I would format the new drive and mount it to a temporary location, then copy all the files across to the new drive (e.g. cp -a /opt/* /mnt/newopt). Once happy everything is there, you can unmount the temp location and mount the new drive, rename /opt to /old-opt, create a new empty /opt and mount the new drive there. Once you're happy it all works, you can add the new drive's /opt mount point to /etc/fstab so it mounts on every boot, and reboot. Once you are happy everything is still working, all that remains is to delete the original /old-opt directory.

  3. #3
    Join Date
    Oct 2005
    Location
    Lab, Slovakia
    Beans
    10,501

    Re: Moving /opt to another drive

    Simple solution: Copy it, delete the original and put a simlink to the new place.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •