Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: [SOLVED] Moving Root Partition to the Left

  1. #1
    Join Date
    May 2008
    Beans
    14

    [SOLVED] Moving Root Partition to the Left

    Hello,

    Ive been using ubuntu full time for about a month now, and started getting very low on space.

    I decided to take the full plunge and delete my windows partition and add its space into my ubuntu partition.

    Unfortunately, my windows partition was the 1st partition, and as far as I can tell, I cannot resize my existing ubuntu partition to the left to use up that unallocated space.

    I have tried booting into the live cd and messing around with no luck.

    I posted my screen shot of gparted below.

    My goal is to add all of the unallocated space shown below, into the ext3 partition shown below, Without completely formatting.

    Thanks for any help!
    Brian


  2. #2
    Join Date
    Jun 2007
    Location
    K-o-T,
    Beans
    Hidden!
    Distro
    Ubuntu Development Release

    Re: Moving Root Partition to the Left

    You cannot resize a partition to the left,but you can move the start of the partition to the left using the Live CD.

    As it has to move all your data as well,this can take a while,so be patient.

    Once the move has been completed,you can then resize the partition.Do each step separately.


    Or if you are feeling daring,you could create a separate partition of the unallocated space and move your /home data there.

    See this link for Creating a separate home partition


    Good Luck
    Hypertension = Take with a pinch of salt
    | Psychocats | Ubuntu Documentation | Howto [Solved] | BBcode list | Brother Website |

  3. #3
    Join Date
    May 2008
    Beans
    14

    Re: Moving Root Partition to the Left

    Would I use gparted from the live cd to do this? I couldn't find the correct option to do this when I was using the live cd + gparted.

    Anymore help would be greatly appreciated.

    Thanks again,
    Brian

  4. #4
    Join Date
    Jun 2006
    Location
    Texas
    Beans
    3,930
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: Moving Root Partition to the Left

    Just a thought. Create a partition at the start of the unused space the same size as your current partition and copy the current partition there.

    once you get it booting to the new partition it will be easy enough to grow it to the right. and much faster than growing it to the left.

    And as plucky pointed out you need to run GParted from a Live CD.

    My favorite live CD for partition work is the SystemRescueCd
    UNIX was not designed to stop you from doing stupid things, because that would also stop you from doing clever things. -- Doug Gwyn
    SystemRescueCd | Dual Boot | psychocats | FAQ

  5. #5
    Join Date
    May 2008
    Beans
    14

    Re: Moving Root Partition to the Left

    Before I attempt that I just wanna double check...

    1.) Boot from the live CD
    2.) Create new ext3 Partition
    3.) Move the entire file system to the new partition.
    -Is it really as simple as just dragging and dropping the file system into the new mounted partition?

    4.) Resize the new partition into the old partition.
    5.) Fix grub to boot from the new partition.

    Thanks again for all the help

  6. #6
    Join Date
    Feb 2005
    Location
    Melbourne, Australia
    Beans
    13,510
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: Moving Root Partition to the Left

    Quote Originally Posted by merkel04 View Post
    Before I attempt that I just wanna double check...

    1.) Boot from the live CD
    2.) Create new ext3 Partition
    3.) Move the entire file system to the new partition.
    -Is it really as simple as just dragging and dropping the file system into the new mounted partition?

    4.) Resize the new partition into the old partition.
    5.) Fix grub to boot from the new partition.

    Thanks again for all the help
    Do yourself a favour and create a separate /home partition in the free space, then you will have a far more robust system and more than enough space in the original root partition (without having to touch it now).

    Do a forum search for detailed instructions.
    Regards, David.
    Please use the Forum search and Wiki search for immediate help
    Please mark your thread as Solved when appropriate
    New to technical forums?: How To Ask Questions The Smart Way

  7. #7
    Join Date
    Apr 2007
    Beans
    3,111
    Distro
    Ubuntu

    Re: Moving Root Partition to the Left

    I support the suggestion of dcstar to create a separate data partition. the other approaches are more complex to achieve and are only recommended if your know some linux system administration. It can be easier than what dcstar suggests, though. Instead of moving the home partition (also a quite technical operation), you can just move your user data, documents, spreadsheets, pictures, etc. to the new big partition. Most of it can be done just using the graphical tools, from within a normal Ubuntu session. Even when things can be done graphically with a nautilus instance with root privileges ("gksudo nautilus") I will give the commands because that is much easier for me.

    1. Creating the partition
    1.1 Install gparted if you did not already using Synaptic Package manager.
    1.2 Start gparted: Alt+F2, type "gksudo gparted" <enter>.
    The advantage of running gparted from a normal session is that there is no possibility for you to accidentely delete or harm your system partitions.
    1.3 Create a partition filling the unallocated space. Format it in ext3 format. This can all be done from within gparted. Take note of the device name that is assigned to the new partition (e.g. /dev/sda7)

    2. Mounting the partition
    Here, we will need some command line work to obtain the needed information.
    2.1 Open a terminal and lookup the UUID of the newly created partition: "sudo blkid". Along the lines, you will find one for your newly created partition. It will look like:

    Code:
    /dev/sda7: UUID="c9cb8b29-152a-47ac-b952-5b9909a290ba" TYPE="ext3"
    You will need the UUID part for your /etc/fstab.
    2.2 Open /etc/fstab for editing. At the terminal: "sudo gedit /etc/fstab". This opens the usual text editor gedit, displaying the current contents of your /etc/fstab. Add two lines for your new partition that looks like (the first one is just a comment and can be omitted)

    Code:
    # /dev/sda7
    UUID="c9cb8b29-152a-47ac-b952-5b9909a290ba" /mnt/data ext3 defaults 0 2
    (Just copy/paste the UUID from the terminal to gedit: that way, you won't make a mistake).

    Save /etc/tab when done and close gedit.

    2.3 Creating a mount point and mounting the partition

    Code:
    sudo mkdir /mnt/data
    sudo mount -a
    The last command does execute all mounts specified in /etc/fstab. It will therefore also mount the newly specified partition under /mnt/data. THERE SHOULD NOT BE ANY OUTPUT from the mount -a command. If there is, stop here and post the output: it means there is a mistake or something else in your /etc/fstab is not correct.
    [/code]

    3. Moving the data. Now you can move your current data to the new partition and create symbolic links in your home directory to them. The symbolic links will make sure that you can access the data just like before. In other words: as a regular user, you won't see that the data have actually moved to a new location.

    You need to do this with a nautilus with root permissions. Load that with "alt+F2" "gksudo nautilus<enter>". Cut / paste your "Documents" folder (just as an example) to the /mnt/data partition. Next, create a symbolic link. That can be done with nautilus (right-click, Make link, then move the link to the location where your data were intially), or with the command "ln -s /mnt/data/Documents ~/. Now, your data reside on the other partition, but are accessible from within your home just like before.
    Last edited by vanadium; October 1st, 2008 at 10:33 AM.

  8. #8
    Join Date
    May 2008
    Beans
    14

    Re: Moving Root Partition to the Left

    After looking around I think I will go ahead and give moving my home dir to its own partition. I think ill try out the directions that plucky posted tonight sometime.

    Another quick question though...

    Are program files stored in the home partition or in the file system? I know my wine apps are all in the home partition, but what about native linux programs?


    Thanks again,
    Brian

  9. #9
    Join Date
    Jun 2007
    Location
    K-o-T,
    Beans
    Hidden!
    Distro
    Ubuntu Development Release

    Re: Moving Root Partition to the Left

    Are program files stored in the home partition or in the file system?
    Programs are installed in the root filesystem,only configuration files are stored in your home partition,usually as hidden files.(i.e they have a . before the filename)

    If you follow the link I posted earlier,all your program configurations should stay the same.

    Good Luck
    Hypertension = Take with a pinch of salt
    | Psychocats | Ubuntu Documentation | Howto [Solved] | BBcode list | Brother Website |

  10. #10
    Join Date
    May 2008
    Beans
    14

    Re: Moving Root Partition to the Left

    Just got done doing it using the directions you posted.

    It amazes me how easy that was lol.

    Thanks again for the help,
    Brian

Page 1 of 2 12 LastLast

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
  •