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

Thread: How to resize existing partition?

  1. #1
    Join Date
    Apr 2011
    Location
    Australia
    Posts
    9

    Default How to resize existing partition?

    I know this shouldn't be difficult.

    I have a HDD that was partitioned into two partitions; one as /home, the other for Windows backup. I wanted to extend by /home partition to the full HDD size, so I deleted the Windows backup partition. All good so far. Now I can't figure out how to make my /home partition the full HDD size. If I try to resize, it does not see the additional free space. I can add a new partition using the newly available space, but that doesn't help. Clearly, I am trying to increase the size of my existing partition without wiping all my data. Is this even possible? I have memories of extending partitions in Windows years ago, so I figure I can do it in Linux.

    I guess I'm missing something, but I cant't figure it out.

    All guidance gratefully accepted.

    Peter

  2. #2
    Join Date
    Jun 2008
    Location
    Yorkshire
    Posts
    391

    Default Re: How to resize existing partition?

    The sytem does not extend backwards so if windows was the first partition, you're stuck. Was it the first partition?

    If yes you might be able to reset it and copy your /home to the first partition if it's big enough. You would then need to reset it in /etc/fstab and probably in Yast>Security and Users. If that works you can then delete the other partition and extend.

    If you want to try that make sure you back up first.

    Edit: As long as you don't scrap the existing /home partiton until you're sure everything is OK, you should be safe.
    Last edited by peteh100; 22-Dec-2017 at 04:37. Reason: add extra info for safety.
    Pete

  3. #3
    Join Date
    Jun 2008
    Location
    Netherlands
    Posts
    29,741

    Default Re: How to resize existing partition?

    Quote Originally Posted by wilted924 View Post
    I know this shouldn't be difficult.

    I have a HDD that was partitioned into two partitions; one as /home, the other for Windows backup. I wanted to extend by /home partition to the full HDD size, so I deleted the Windows backup partition. All good so far. Now I can't figure out how to make my /home partition the full HDD size. If I try to resize, it does not see the additional free space. I can add a new partition using the newly available space, but that doesn't help. Clearly, I am trying to increase the size of my existing partition without wiping all my data. Is this even possible? I have memories of extending partitions in Windows years ago, so I figure I can do it in Linux.

    I guess I'm missing something, but I cant't figure it out.

    All guidance gratefully accepted.

    Peter
    First and for all. please do not tell a srory alone, but show!
    Code:
    fdisk -l
    And yes, you can not extend "backwards". And most important message from @peteh100 is: make an extra backup.

    BTW, when you try to follow up @peteh's advice, do not forget that when manipulating the /home file system and/or it's partition, it must be unmounted. Thus you can not use any of your users, that have their home directory in /home, while loged in into the GUI.
    Henk van Velden

  4. #4
    Join Date
    Jun 2008
    Location
    Yorkshire
    Posts
    391

    Default Re: How to resize existing partition?

    Quote Originally Posted by hcvv View Post
    First and for all. please do not tell a srory alone, but show!
    Code:
    fdisk -l
    And yes, you can not extend "backwards". And most important message from @peteh100 is: make an extra backup.

    BTW, when you try to follow up @peteh's advice, do not forget that when manipulating the /home file system and/or it's partition, it must be unmounted. Thus you can not use any of your users, that have their home directory in /home, while loged in into the GUI.
    I've tried several times to fill a gap in partitions and have only ever been able to do it from th partition before the gap. I'd be interested to know how it's done.
    Of course you're right about /home manipulation and I should hav theought of it. I always have at least 2 systmes and manipulate from one of the others.
    Pete

  5. #5
    Join Date
    Nov 2009
    Location
    West Virginia Sector 13
    Posts
    16,286

    Default Re: How to resize existing partition?

    Move it then expand it

    Must be done when partition is not in use ie not mounted

  6. #6
    Join Date
    Jun 2008
    Location
    San Diego, Ca, USA
    Posts
    13,295
    Blog Entries
    2

    Default Re: How to resize existing partition?

    Can't extend "backwards?"
    AFAIK it's always possible to extend into adjacent free space, forwards or backwards.
    If that's possible, then the next issue is whether you're trying to preserve data instead of restoring from backup or something else, in which case you probably do have to do a "move" since the start of the partition and file system is changed.

    In any case,
    Although it's probably possible to do this because it's not the root partition,
    I'd still use Gparted Live for <all> partition modifications because it supports every scenario I can think of.

    https://gparted.org/livecd.php

    TSU
    Beginner Wiki Quickstart - https://en.opensuse.org/User:Tsu2/Quickstart_Wiki
    Solved a problem recently? Create a wiki page for future personal reference!
    Learn something new?
    Attended a computing event?
    Post and Share!

  7. #7
    Join Date
    Jun 2008
    Location
    Netherlands
    Posts
    29,741

    Default Re: How to resize existing partition?

    Quote Originally Posted by tsu2 View Post
    AFAIK it's always possible to extend into adjacent free space, forwards or backwards.
    While I doubt many file systems can be extended "backwards". I can imagine that a high level tool (you name Gparted, which I never used) is able to do the steps:
    • create a new partition covering the whole disk;
    • move the file system from it's place (now somewhere in the middle of the new partition, but the tool will have noted where that is) to the beginning of the new partition; note that for this it is not needed that the former first partition is larger then the former second partition, copying must be done begin to end (that is what mostly happens) and when it is smaller, the end of the newly placed file system will overwrite the beginning of the old place;
    • extend the file system on it's new place to the end of the partition.


    Of course, to the user of the high level tool this would look as extending the file system "backwards".

    That said, we all are assuming a lot here because of the lack of information (the fdisk listing). It seems that the OP has gone sleeping soon after starting his thread, first answers/suggestions/requests for info were there within 1 - 1½ hour.
    Henk van Velden

  8. #8
    Join Date
    Apr 2011
    Location
    Australia
    Posts
    9

    Default Re: How to resize existing partition?

    Yes, being the other side of the world, I went to bed. Thanks for the abundant and informative replies.

    The Linux partition is at the end of the disk. I actually have another option as I've just popped in a new HDD. I'll copy \home to that disk, set it as home then change the "old" drive. I'll use GParted for this.

    Thanks again.

  9. #9
    Join Date
    Jun 2008
    Location
    San Diego, Ca, USA
    Posts
    13,295
    Blog Entries
    2

    Default Re: How to resize existing partition?

    Quote Originally Posted by wilted924 View Post
    Yes, being the other side of the world, I went to bed. Thanks for the abundant and informative replies.

    The Linux partition is at the end of the disk. I actually have another option as I've just popped in a new HDD. I'll copy \home to that disk, set it as home then change the "old" drive. I'll use GParted for this.

    Thanks again.
    For what you're describing, IMO it's simple to use YaST partitioner for that.
    - Create new partition on your new drive
    - Format the partition
    - Find the mount for your current /home and point it instead to your new partition
    - Copy all the data from your old partition to your new partition
    - reboot.

    TSU
    Beginner Wiki Quickstart - https://en.opensuse.org/User:Tsu2/Quickstart_Wiki
    Solved a problem recently? Create a wiki page for future personal reference!
    Learn something new?
    Attended a computing event?
    Post and Share!

  10. #10
    Join Date
    Jun 2008
    Location
    Netherlands
    Posts
    29,741

    Default Re: How to resize existing partition?

    Quote Originally Posted by wilted924 View Post
    Yes, being the other side of the world, I went to bed. Thanks for the abundant and informative replies.

    The Linux partition is at the end of the disk. I actually have another option as I've just popped in a new HDD. I'll copy \home to that disk, set it as home then change the "old" drive. I'll use GParted for this.

    Thanks again.
    That is again a nice story (apart from the fact that you have thick fingers, typing \ instead of /), but we asked for real information. At least:
    Code:
    fdisk -l

    And please also be aware that when you change things (as it seems to be the case) you have to inform us anew about the real situation. People here do not like to shoot at a fast moving duck.
    Last edited by hcvv; 23-Dec-2017 at 03:07.
    Henk van Velden

Page 1 of 2 12 LastLast

Posting Permissions

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