Results 1 to 5 of 5

Thread: Resizing a partition running production Ubuntu Server

  1. #1
    Join Date
    Mar 2017
    Beans
    2

    Resizing a partition running production Ubuntu Server

    While installing Ubuntu Server edition from a Ubuntu Live CD, I had chosen the 'Use entire disk' option. On top of Ubuntu, I installed Redmine, MySql etc. and the application is in production. (It's a very small two member team, so the word 'production' may be a big one to use). I am a novice to Ubuntu Server, I adopted it as a quick means to using Redmine. If it matters, I also have a Lubuntu Desktop and WebMin installed on the server. (Yes, I know desktops shouldn't be installed on servers, LoL).
    Now I am assuming Ubuntu Server must have created a single partition spanning the whole disk. I would like to reduce that partition in which Ubuntu Server is installed, create another partition in the same disk unrelated to the Ubuntu Server so that I can use the new partition for backups storing partition image, other docs etc.
    For resizing, I usually boot from any Linux CD that has Gparted (such as Puppy) and go about the shrinking, new partition etc. In this case, will the shrinking of the Ubuntu Server partition, affect the Ubuntu installation or the application ? It shouldn't happen that Ubuntu Server sees the reduced size when it is booting and then go bonkers trying to resolve it and mess up the server installation. I don't want to be in a position where I have to go through the whole installation process once again.
    I shall take a disk image using clonezilla/PING and backup the Mysql database and redmine application user files.
    But is there anything else I need to worry about or take precaution before I go about the resizing the Ubuntu Server partition ?

  2. #2
    Join Date
    Oct 2006
    Location
    Ayrshire.
    Beans
    54,614
    Distro
    Ubuntu Development Release

    Re: Resizing a partition running production Ubuntu Server

    Thread moved to the "Server Platforms" forum, probably a better fit.

  3. #3
    Join Date
    Sep 2011
    Location
    Behind you!
    Beans
    701
    Distro
    Ubuntu 16.04 Xenial Xerus

    Re: Resizing a partition running production Ubuntu Server

    I have never shrunk a Linux partition so I wouldn't know. I do know it isn't as easy as seeing the partition as a bunch of free space since the OS has the right to place data anywhere inside the partition it wants so it would need to be much smarter than simply changing the size of the partition.

    For future reference, you might want to review my notes on installing an Ubuntu Server on how I configure partitions for a true production server...which allows you to keep unused space available for other reasons and only increase when needed.

    LHammonds

  4. #4
    Join Date
    Nov 2009
    Location
    Mataro, Spain
    Beans
    13,851
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: Resizing a partition running production Ubuntu Server

    You will have to shrink the filesystem first. I have never done partition shrink too, but the way I understand it, the filesystem is "always at the front of the partition". Which means if you have a partition of 100GB and you shrink the filesystem to 50GB, and you have only used 25GB of those, the 25GB can be where ever in the 50GB but they can never be out of them. So in theory it would be safe to shrink the partition "cutting out" the last 50GB from it.

    But that is how I understand the theory, I have never done it either.

    Using Gparted from live mode can also help and I believe it does both operations for you in one (shrink the FS and shrink the partition).

    PS. Another thing to consider is do you actually need this risky operation of shrinking the partitions. You said you want to use the new partition for storing backups, other docs, etc. If that's backups from the same machine, storing it on the same disk/machine is not a backup anyway. If the disk goes, your backup file is also gone. As for docs, you can probably manage to store them elsewhere too, or inside the ubuntu server itself without shrinking the partition.
    Last edited by darkod; March 17th, 2017 at 01:41 PM.
    Darko.
    -----------------------------------------------------------------------
    Ubuntu 14.04 LTS 64bit & Windows 10 Pro 64bit

  5. #5
    Join Date
    Mar 2017
    Beans
    2

    Re: Resizing a partition running production Ubuntu Server

    @LHammonds : and @darkod :
    Thank you for all the inputs. Shall keep those in mind.

Tags for this Thread

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
  •