1

I have a question about a disk which is almost full in my Ubuntu server.

$ df -Th
/dev/sdc  ext4 1008G 884G 73G 93% /mnt
/dev/sdd1 ext4 1.5T  69M  1.5T   1% /newmnt

Web application storage : /mnt/var/www/***
SVN repository storage : /mnt/var/repository/svn

The web apps and the repository is residing in /mnt which is almost full and my IT team had problems extending the disk and rather provided me with a new partition /newmnt. So I will have to move all the contents of /mnt to the new partition /newmnt.

There are two concerns for me now :

  • The repository table in the MYSQL database is having hard coded values of the repository location. For ex - '/mnt/var/repository/svn/example_repository'. There are many repositories and all of them are stored in the DB as hard-coded values.
  • Apache configuration is also having the hard coded variables for the web app and the SVN authentication.

There are too many web apps connected to many repositories so I cannot afford to change them as it is time consuming.

So coming to the question, my plan is to copy all the contents of /mnt to /newmnt. Later editing /etc/fstab and changing /mnt to /mnt_old and /newmnt to /mnt and reboot the server.

Will the renamed structure work ? Will my web apps and repositories still work like before?

  • 1
    yes, that layer of abstraction between the name of your mount point and wherever it maps to is the beauty and the whole point... which sound like you specifically need /mnt for things to work... wherever the /mnt folder gets mapped to such as/dev/sdd1 or /dev/sdz4 and whatever those storage devices are be it a hard disk, or SSD, or usb flash memory or somewhere across a network generally does not matter with regards to software configurations working except maybe for speed and timeouts. – ron Mar 27 '18 at 17:55
1

To a more ellaborate answer.

I would

  1. rename in /etc/fstab first (change /mnt to /mnt_old and leave /newmnt )
  2. reboot host

    2.1 if you can prevent application from running the better

    2.2 if no, that shoudn't be a problem since /mnt is empty

  3. do the copying

  4. edit /etc/fstab (change/newmnt to /mnt ), you still have /mnt_old as backup.
  5. reboot.

please note :

  • don't forget to create mount point (aka directory).
  • kernel have no need of /etc/fstab to dismount active mount point.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.