Ubuntu 18.04 - Safely remove/change a specific partition and allocate free space to root












1















I have a dual boot setup. On the original disk I have Windows installed (on a uefi setup) ... and on a second drive ubuntu. It all works fine.



Yet, when I installed ubuntu on the second drive ... I manually defined the partitions. Basically I defined a swap partition, a / root partition (5GB) and a /home partition as explained in various tutorials. I allocated most of the space to the /home (90GB) partition though.



When working (me as a user with sudo priviliges) now ... it seems like all my stuff (Downloads, Projects, ...) is stored on the / root partition ... in the home folder. Which is fine with me if it is supposed to be like that. (Or like the web projects in the var folder.). But slowly I'm running out of space and I'm not even using the rest of the 90GB.



For what is the originally defined /home partition even for? And how can I savely redefine the partition size? My first thought now is to move more space to the / root partition.



When I run gparted ... the partitions are looked and I can't resize/remove them. See here:



enter image description here



Edit:



$ df /home

Filesystem 1k-blocks Used Available Use% Mounted on
/dev/sda5 1876072 8552072 9057344 49% /


Edit 2:



$ df

Filesystem 1K-blocks Used Available Use% Mounted on
udev 1901092 0 1901092 0% /dev
tmpfs 386268 2100 384168 1% /run
/dev/sda5 18576072 8552616 9056800 49% /
tmpfs 1931340 0 1931340 0% /dev/shm
tmpfs 5120 4 5116 1% /run/lock
tmpfs 1931340 0 1931340 0% /sys/fs/cgroup
/dev/loop0 3840 3840 0 100% /snap/gnome-system-monitor/57
/dev/loop1 91648 91648 0 100% /snap/core/6130
/dev/loop2 35456 35456 0 100% /snap/gtk-common-themes/818
/dev/loop3 13312 13312 0 100% /snap/gnome-characters/103
/dev/loop4 2432 2432 0 100% /snap/gnome-calculator/180
/dev/loop5 3840 3840 0 100% /snap/gnome-system-monitor/51
/dev/loop6 2304 2304 0 100% /snap/gnome-calculator/260
/dev/loop7 150912 150912 0 100% /snap/skype/66
/dev/loop9 13312 13312 0 100% /snap/gnome-characters/139
/dev/loop8 14976 14976 0 100% /snap/gnome-logs/45
/dev/loop10 133760 133760 0 100% /snap/postman/80
/dev/loop11 35584 35584 0 100% /snap/gtk-common-themes/319
/dev/loop12 89088 89088 0 100% /snap/core/4917
/dev/loop13 14848 14848 0 100% /snap/gnome-logs/37
/dev/loop14 144128 144128 0 100% /snap/gnome-3-26-1604/74
/dev/loop15 144384 144384 0 100% /snap/gnome-3-26-1604/70
/dev/sda2 524272 6228 518044 2% /boot/efi
tmpfs 386268 20 386248 1% /run/user/121
tmpfs 386268 96 386172 1% /run/user/1000
/dev/mnnlk1p4 60439548 20301204 40138344 34% /media/mark/98F46CVFG76D9D6E


Edit 3:



$ less etc/fstab

# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point> <type> <options> <dump> <pass>
# / was on /dev/sda5 during installation
UUID=ad139b04-0cf2-5183-ccf2-fb90cc1ac2b1 / ext4 errors=remount-ro 0 1
# /boot/efi was on /dev/sda2 during installation
UUID=6E9C-A4F3 /boot/efi vfat umask=0077 0 1
/swapfile none swap sw 0 0
~
~
~
~
(END)









share|improve this question

























  • It doesn't look like your 90GB partition is mounted at /home from your gparted screenshot. If you boot into Ubuntu and run df /home from a terminal, what is the output?

    – Arronical
    Jan 8 at 12:09








  • 1





    Please see the above edit

    – Philipp M
    Jan 8 at 12:22











  • I think something has gone awry with the home partition creation. I'll put together an answer which will hopefully help.

    – Arronical
    Jan 8 at 12:39











  • What's the full mount point for /dev/sda4?

    – Arronical
    Jan 8 at 12:41











  • Please see Edit 2. That's the whole output of df. /dev/sda4 is not on the list ... and mnnlk1p4 is the other (orignal) drive with windows installed.

    – Philipp M
    Jan 8 at 12:54


















1















I have a dual boot setup. On the original disk I have Windows installed (on a uefi setup) ... and on a second drive ubuntu. It all works fine.



Yet, when I installed ubuntu on the second drive ... I manually defined the partitions. Basically I defined a swap partition, a / root partition (5GB) and a /home partition as explained in various tutorials. I allocated most of the space to the /home (90GB) partition though.



When working (me as a user with sudo priviliges) now ... it seems like all my stuff (Downloads, Projects, ...) is stored on the / root partition ... in the home folder. Which is fine with me if it is supposed to be like that. (Or like the web projects in the var folder.). But slowly I'm running out of space and I'm not even using the rest of the 90GB.



For what is the originally defined /home partition even for? And how can I savely redefine the partition size? My first thought now is to move more space to the / root partition.



When I run gparted ... the partitions are looked and I can't resize/remove them. See here:



enter image description here



Edit:



$ df /home

Filesystem 1k-blocks Used Available Use% Mounted on
/dev/sda5 1876072 8552072 9057344 49% /


Edit 2:



$ df

Filesystem 1K-blocks Used Available Use% Mounted on
udev 1901092 0 1901092 0% /dev
tmpfs 386268 2100 384168 1% /run
/dev/sda5 18576072 8552616 9056800 49% /
tmpfs 1931340 0 1931340 0% /dev/shm
tmpfs 5120 4 5116 1% /run/lock
tmpfs 1931340 0 1931340 0% /sys/fs/cgroup
/dev/loop0 3840 3840 0 100% /snap/gnome-system-monitor/57
/dev/loop1 91648 91648 0 100% /snap/core/6130
/dev/loop2 35456 35456 0 100% /snap/gtk-common-themes/818
/dev/loop3 13312 13312 0 100% /snap/gnome-characters/103
/dev/loop4 2432 2432 0 100% /snap/gnome-calculator/180
/dev/loop5 3840 3840 0 100% /snap/gnome-system-monitor/51
/dev/loop6 2304 2304 0 100% /snap/gnome-calculator/260
/dev/loop7 150912 150912 0 100% /snap/skype/66
/dev/loop9 13312 13312 0 100% /snap/gnome-characters/139
/dev/loop8 14976 14976 0 100% /snap/gnome-logs/45
/dev/loop10 133760 133760 0 100% /snap/postman/80
/dev/loop11 35584 35584 0 100% /snap/gtk-common-themes/319
/dev/loop12 89088 89088 0 100% /snap/core/4917
/dev/loop13 14848 14848 0 100% /snap/gnome-logs/37
/dev/loop14 144128 144128 0 100% /snap/gnome-3-26-1604/74
/dev/loop15 144384 144384 0 100% /snap/gnome-3-26-1604/70
/dev/sda2 524272 6228 518044 2% /boot/efi
tmpfs 386268 20 386248 1% /run/user/121
tmpfs 386268 96 386172 1% /run/user/1000
/dev/mnnlk1p4 60439548 20301204 40138344 34% /media/mark/98F46CVFG76D9D6E


Edit 3:



$ less etc/fstab

# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point> <type> <options> <dump> <pass>
# / was on /dev/sda5 during installation
UUID=ad139b04-0cf2-5183-ccf2-fb90cc1ac2b1 / ext4 errors=remount-ro 0 1
# /boot/efi was on /dev/sda2 during installation
UUID=6E9C-A4F3 /boot/efi vfat umask=0077 0 1
/swapfile none swap sw 0 0
~
~
~
~
(END)









share|improve this question

























  • It doesn't look like your 90GB partition is mounted at /home from your gparted screenshot. If you boot into Ubuntu and run df /home from a terminal, what is the output?

    – Arronical
    Jan 8 at 12:09








  • 1





    Please see the above edit

    – Philipp M
    Jan 8 at 12:22











  • I think something has gone awry with the home partition creation. I'll put together an answer which will hopefully help.

    – Arronical
    Jan 8 at 12:39











  • What's the full mount point for /dev/sda4?

    – Arronical
    Jan 8 at 12:41











  • Please see Edit 2. That's the whole output of df. /dev/sda4 is not on the list ... and mnnlk1p4 is the other (orignal) drive with windows installed.

    – Philipp M
    Jan 8 at 12:54
















1












1








1








I have a dual boot setup. On the original disk I have Windows installed (on a uefi setup) ... and on a second drive ubuntu. It all works fine.



Yet, when I installed ubuntu on the second drive ... I manually defined the partitions. Basically I defined a swap partition, a / root partition (5GB) and a /home partition as explained in various tutorials. I allocated most of the space to the /home (90GB) partition though.



When working (me as a user with sudo priviliges) now ... it seems like all my stuff (Downloads, Projects, ...) is stored on the / root partition ... in the home folder. Which is fine with me if it is supposed to be like that. (Or like the web projects in the var folder.). But slowly I'm running out of space and I'm not even using the rest of the 90GB.



For what is the originally defined /home partition even for? And how can I savely redefine the partition size? My first thought now is to move more space to the / root partition.



When I run gparted ... the partitions are looked and I can't resize/remove them. See here:



enter image description here



Edit:



$ df /home

Filesystem 1k-blocks Used Available Use% Mounted on
/dev/sda5 1876072 8552072 9057344 49% /


Edit 2:



$ df

Filesystem 1K-blocks Used Available Use% Mounted on
udev 1901092 0 1901092 0% /dev
tmpfs 386268 2100 384168 1% /run
/dev/sda5 18576072 8552616 9056800 49% /
tmpfs 1931340 0 1931340 0% /dev/shm
tmpfs 5120 4 5116 1% /run/lock
tmpfs 1931340 0 1931340 0% /sys/fs/cgroup
/dev/loop0 3840 3840 0 100% /snap/gnome-system-monitor/57
/dev/loop1 91648 91648 0 100% /snap/core/6130
/dev/loop2 35456 35456 0 100% /snap/gtk-common-themes/818
/dev/loop3 13312 13312 0 100% /snap/gnome-characters/103
/dev/loop4 2432 2432 0 100% /snap/gnome-calculator/180
/dev/loop5 3840 3840 0 100% /snap/gnome-system-monitor/51
/dev/loop6 2304 2304 0 100% /snap/gnome-calculator/260
/dev/loop7 150912 150912 0 100% /snap/skype/66
/dev/loop9 13312 13312 0 100% /snap/gnome-characters/139
/dev/loop8 14976 14976 0 100% /snap/gnome-logs/45
/dev/loop10 133760 133760 0 100% /snap/postman/80
/dev/loop11 35584 35584 0 100% /snap/gtk-common-themes/319
/dev/loop12 89088 89088 0 100% /snap/core/4917
/dev/loop13 14848 14848 0 100% /snap/gnome-logs/37
/dev/loop14 144128 144128 0 100% /snap/gnome-3-26-1604/74
/dev/loop15 144384 144384 0 100% /snap/gnome-3-26-1604/70
/dev/sda2 524272 6228 518044 2% /boot/efi
tmpfs 386268 20 386248 1% /run/user/121
tmpfs 386268 96 386172 1% /run/user/1000
/dev/mnnlk1p4 60439548 20301204 40138344 34% /media/mark/98F46CVFG76D9D6E


Edit 3:



$ less etc/fstab

# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point> <type> <options> <dump> <pass>
# / was on /dev/sda5 during installation
UUID=ad139b04-0cf2-5183-ccf2-fb90cc1ac2b1 / ext4 errors=remount-ro 0 1
# /boot/efi was on /dev/sda2 during installation
UUID=6E9C-A4F3 /boot/efi vfat umask=0077 0 1
/swapfile none swap sw 0 0
~
~
~
~
(END)









share|improve this question
















I have a dual boot setup. On the original disk I have Windows installed (on a uefi setup) ... and on a second drive ubuntu. It all works fine.



Yet, when I installed ubuntu on the second drive ... I manually defined the partitions. Basically I defined a swap partition, a / root partition (5GB) and a /home partition as explained in various tutorials. I allocated most of the space to the /home (90GB) partition though.



When working (me as a user with sudo priviliges) now ... it seems like all my stuff (Downloads, Projects, ...) is stored on the / root partition ... in the home folder. Which is fine with me if it is supposed to be like that. (Or like the web projects in the var folder.). But slowly I'm running out of space and I'm not even using the rest of the 90GB.



For what is the originally defined /home partition even for? And how can I savely redefine the partition size? My first thought now is to move more space to the / root partition.



When I run gparted ... the partitions are looked and I can't resize/remove them. See here:



enter image description here



Edit:



$ df /home

Filesystem 1k-blocks Used Available Use% Mounted on
/dev/sda5 1876072 8552072 9057344 49% /


Edit 2:



$ df

Filesystem 1K-blocks Used Available Use% Mounted on
udev 1901092 0 1901092 0% /dev
tmpfs 386268 2100 384168 1% /run
/dev/sda5 18576072 8552616 9056800 49% /
tmpfs 1931340 0 1931340 0% /dev/shm
tmpfs 5120 4 5116 1% /run/lock
tmpfs 1931340 0 1931340 0% /sys/fs/cgroup
/dev/loop0 3840 3840 0 100% /snap/gnome-system-monitor/57
/dev/loop1 91648 91648 0 100% /snap/core/6130
/dev/loop2 35456 35456 0 100% /snap/gtk-common-themes/818
/dev/loop3 13312 13312 0 100% /snap/gnome-characters/103
/dev/loop4 2432 2432 0 100% /snap/gnome-calculator/180
/dev/loop5 3840 3840 0 100% /snap/gnome-system-monitor/51
/dev/loop6 2304 2304 0 100% /snap/gnome-calculator/260
/dev/loop7 150912 150912 0 100% /snap/skype/66
/dev/loop9 13312 13312 0 100% /snap/gnome-characters/139
/dev/loop8 14976 14976 0 100% /snap/gnome-logs/45
/dev/loop10 133760 133760 0 100% /snap/postman/80
/dev/loop11 35584 35584 0 100% /snap/gtk-common-themes/319
/dev/loop12 89088 89088 0 100% /snap/core/4917
/dev/loop13 14848 14848 0 100% /snap/gnome-logs/37
/dev/loop14 144128 144128 0 100% /snap/gnome-3-26-1604/74
/dev/loop15 144384 144384 0 100% /snap/gnome-3-26-1604/70
/dev/sda2 524272 6228 518044 2% /boot/efi
tmpfs 386268 20 386248 1% /run/user/121
tmpfs 386268 96 386172 1% /run/user/1000
/dev/mnnlk1p4 60439548 20301204 40138344 34% /media/mark/98F46CVFG76D9D6E


Edit 3:



$ less etc/fstab

# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point> <type> <options> <dump> <pass>
# / was on /dev/sda5 during installation
UUID=ad139b04-0cf2-5183-ccf2-fb90cc1ac2b1 / ext4 errors=remount-ro 0 1
# /boot/efi was on /dev/sda2 during installation
UUID=6E9C-A4F3 /boot/efi vfat umask=0077 0 1
/swapfile none swap sw 0 0
~
~
~
~
(END)






dual-boot partitioning 18.04 gparted






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited 2 days ago









Arronical

13.2k84790




13.2k84790










asked Jan 8 at 11:50









Philipp MPhilipp M

1306




1306













  • It doesn't look like your 90GB partition is mounted at /home from your gparted screenshot. If you boot into Ubuntu and run df /home from a terminal, what is the output?

    – Arronical
    Jan 8 at 12:09








  • 1





    Please see the above edit

    – Philipp M
    Jan 8 at 12:22











  • I think something has gone awry with the home partition creation. I'll put together an answer which will hopefully help.

    – Arronical
    Jan 8 at 12:39











  • What's the full mount point for /dev/sda4?

    – Arronical
    Jan 8 at 12:41











  • Please see Edit 2. That's the whole output of df. /dev/sda4 is not on the list ... and mnnlk1p4 is the other (orignal) drive with windows installed.

    – Philipp M
    Jan 8 at 12:54





















  • It doesn't look like your 90GB partition is mounted at /home from your gparted screenshot. If you boot into Ubuntu and run df /home from a terminal, what is the output?

    – Arronical
    Jan 8 at 12:09








  • 1





    Please see the above edit

    – Philipp M
    Jan 8 at 12:22











  • I think something has gone awry with the home partition creation. I'll put together an answer which will hopefully help.

    – Arronical
    Jan 8 at 12:39











  • What's the full mount point for /dev/sda4?

    – Arronical
    Jan 8 at 12:41











  • Please see Edit 2. That's the whole output of df. /dev/sda4 is not on the list ... and mnnlk1p4 is the other (orignal) drive with windows installed.

    – Philipp M
    Jan 8 at 12:54



















It doesn't look like your 90GB partition is mounted at /home from your gparted screenshot. If you boot into Ubuntu and run df /home from a terminal, what is the output?

– Arronical
Jan 8 at 12:09







It doesn't look like your 90GB partition is mounted at /home from your gparted screenshot. If you boot into Ubuntu and run df /home from a terminal, what is the output?

– Arronical
Jan 8 at 12:09






1




1





Please see the above edit

– Philipp M
Jan 8 at 12:22





Please see the above edit

– Philipp M
Jan 8 at 12:22













I think something has gone awry with the home partition creation. I'll put together an answer which will hopefully help.

– Arronical
Jan 8 at 12:39





I think something has gone awry with the home partition creation. I'll put together an answer which will hopefully help.

– Arronical
Jan 8 at 12:39













What's the full mount point for /dev/sda4?

– Arronical
Jan 8 at 12:41





What's the full mount point for /dev/sda4?

– Arronical
Jan 8 at 12:41













Please see Edit 2. That's the whole output of df. /dev/sda4 is not on the list ... and mnnlk1p4 is the other (orignal) drive with windows installed.

– Philipp M
Jan 8 at 12:54







Please see Edit 2. That's the whole output of df. /dev/sda4 is not on the list ... and mnnlk1p4 is the other (orignal) drive with windows installed.

– Philipp M
Jan 8 at 12:54












2 Answers
2






active

oldest

votes


















2














The home partition you've created does not appear to be mounted in the filesystem. Ubuntu will use the /home directory for all users' homes, so the 90G /dev/sda4 partition needs to be mounted there. Unfortunately the stuff that's already in /home needs to be copied over, and your system reconfigured to mount the /dev/sda4/ partition in the correct place.



First, create somewhere to mount your /dev/sda4 partition:



sudo mkdir /media/newhome/


Then mount the partition there:



sudo mount /dev/sda4 /media/newhome


Now copy all current homes to the current /dev/sda4 mountpoint:



sudo cp -aR /home/* /media/newhome


Now you need to edit the /etc/fstab file, which is responsible for mounting your partitions on system boot. Beware, this is a seriously important system file and ruining or deleting would be very bad!



Make a backup of /etc/fstab



sudo cp /etc/fstab /etc/fstab.bak


Get the UUID of your partition, note this down for use in your next step:



blkid /dev/sda4


Now add a new entry into your /etc/fstab file with your preferred text editor using the UUID from the last command, make sure you're accurate with the UUID:



# Mount /dev/sda at /home
UUID=(put your UUID here) /home ext4 defaults 0 2


Unmount your /dev/sda4 partition:



sudo umount /dev/sda4


Now check that the new /home mounts correctly:



sudo mount -a


If you issue df /home now the output should show that /dev/sda4 is the partition mounted there. After this, you should check that you have nothing missing from your relocated /home directory.



All that is left is to make sure it operates as you expect after a reboot. One thing to note is that you still have the same data stored in original /home on the root filesystem /, but you've now mounted /dev/sda4 over it, so cannot access it. In order to reclaim the space from / you would need to unmount /dev/sda4, delete the old /home and remount /dev/sda4. I would only do this once I'm entirely sure everything is as it should be and no files or functionality is missing.



To remove the old home directory, unmount the newly configured home partition:



sudo umount /dev/sda4


Delete the contents of the old home directory:



sudo rm -r /home/*


Remount /dev/sda4



sudo mount -a





share|improve this answer


























  • Excellent. Everything is working as described. I very much appreciate your help.

    – Philipp M
    Jan 8 at 16:02











  • Regarding you last point ... the data stored in the original /home is very limited. Just some desktop icons and a couple of files that can be deleted. Would you recommend to 'reclaim the space from /'? Or would you leave the structure as it is right now? Do I have any disadvantages in the future if I leave as it is like now?

    – Philipp M
    Jan 8 at 16:13













  • @PhilippM No problem. I can't see any major issues with leaving it there if it is as small as you think. I'd thought you might have a lot more in there which was using up the space on /. I wonder if it's the stuff in /snap that's using up the space? The only minor issue I can think of would be that if ever /dev/sda4 failed to mount, you might not notice as there'd still be a /home directory with stuff in it, if you saved anything there and the partition mounted properly at a later attempt it might seem like files have disappeared.

    – Arronical
    Jan 8 at 16:22











  • What would be the exact steps to finalize this last step? Could you provide it as optional step in your comment above?

    – Philipp M
    Jan 8 at 20:03











  • I've edited to add those details @PhilippM

    – Arronical
    2 days ago



















-1














Use your live USB, run Gparted from there, then resize your partitions.
First take some space from /home, then 'Apply All Operations', then add free space to your / root.






share|improve this answer








New contributor




G.H. is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.




















    Your Answer








    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "89"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1107958%2fubuntu-18-04-safely-remove-change-a-specific-partition-and-allocate-free-space%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    2 Answers
    2






    active

    oldest

    votes








    2 Answers
    2






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    2














    The home partition you've created does not appear to be mounted in the filesystem. Ubuntu will use the /home directory for all users' homes, so the 90G /dev/sda4 partition needs to be mounted there. Unfortunately the stuff that's already in /home needs to be copied over, and your system reconfigured to mount the /dev/sda4/ partition in the correct place.



    First, create somewhere to mount your /dev/sda4 partition:



    sudo mkdir /media/newhome/


    Then mount the partition there:



    sudo mount /dev/sda4 /media/newhome


    Now copy all current homes to the current /dev/sda4 mountpoint:



    sudo cp -aR /home/* /media/newhome


    Now you need to edit the /etc/fstab file, which is responsible for mounting your partitions on system boot. Beware, this is a seriously important system file and ruining or deleting would be very bad!



    Make a backup of /etc/fstab



    sudo cp /etc/fstab /etc/fstab.bak


    Get the UUID of your partition, note this down for use in your next step:



    blkid /dev/sda4


    Now add a new entry into your /etc/fstab file with your preferred text editor using the UUID from the last command, make sure you're accurate with the UUID:



    # Mount /dev/sda at /home
    UUID=(put your UUID here) /home ext4 defaults 0 2


    Unmount your /dev/sda4 partition:



    sudo umount /dev/sda4


    Now check that the new /home mounts correctly:



    sudo mount -a


    If you issue df /home now the output should show that /dev/sda4 is the partition mounted there. After this, you should check that you have nothing missing from your relocated /home directory.



    All that is left is to make sure it operates as you expect after a reboot. One thing to note is that you still have the same data stored in original /home on the root filesystem /, but you've now mounted /dev/sda4 over it, so cannot access it. In order to reclaim the space from / you would need to unmount /dev/sda4, delete the old /home and remount /dev/sda4. I would only do this once I'm entirely sure everything is as it should be and no files or functionality is missing.



    To remove the old home directory, unmount the newly configured home partition:



    sudo umount /dev/sda4


    Delete the contents of the old home directory:



    sudo rm -r /home/*


    Remount /dev/sda4



    sudo mount -a





    share|improve this answer


























    • Excellent. Everything is working as described. I very much appreciate your help.

      – Philipp M
      Jan 8 at 16:02











    • Regarding you last point ... the data stored in the original /home is very limited. Just some desktop icons and a couple of files that can be deleted. Would you recommend to 'reclaim the space from /'? Or would you leave the structure as it is right now? Do I have any disadvantages in the future if I leave as it is like now?

      – Philipp M
      Jan 8 at 16:13













    • @PhilippM No problem. I can't see any major issues with leaving it there if it is as small as you think. I'd thought you might have a lot more in there which was using up the space on /. I wonder if it's the stuff in /snap that's using up the space? The only minor issue I can think of would be that if ever /dev/sda4 failed to mount, you might not notice as there'd still be a /home directory with stuff in it, if you saved anything there and the partition mounted properly at a later attempt it might seem like files have disappeared.

      – Arronical
      Jan 8 at 16:22











    • What would be the exact steps to finalize this last step? Could you provide it as optional step in your comment above?

      – Philipp M
      Jan 8 at 20:03











    • I've edited to add those details @PhilippM

      – Arronical
      2 days ago
















    2














    The home partition you've created does not appear to be mounted in the filesystem. Ubuntu will use the /home directory for all users' homes, so the 90G /dev/sda4 partition needs to be mounted there. Unfortunately the stuff that's already in /home needs to be copied over, and your system reconfigured to mount the /dev/sda4/ partition in the correct place.



    First, create somewhere to mount your /dev/sda4 partition:



    sudo mkdir /media/newhome/


    Then mount the partition there:



    sudo mount /dev/sda4 /media/newhome


    Now copy all current homes to the current /dev/sda4 mountpoint:



    sudo cp -aR /home/* /media/newhome


    Now you need to edit the /etc/fstab file, which is responsible for mounting your partitions on system boot. Beware, this is a seriously important system file and ruining or deleting would be very bad!



    Make a backup of /etc/fstab



    sudo cp /etc/fstab /etc/fstab.bak


    Get the UUID of your partition, note this down for use in your next step:



    blkid /dev/sda4


    Now add a new entry into your /etc/fstab file with your preferred text editor using the UUID from the last command, make sure you're accurate with the UUID:



    # Mount /dev/sda at /home
    UUID=(put your UUID here) /home ext4 defaults 0 2


    Unmount your /dev/sda4 partition:



    sudo umount /dev/sda4


    Now check that the new /home mounts correctly:



    sudo mount -a


    If you issue df /home now the output should show that /dev/sda4 is the partition mounted there. After this, you should check that you have nothing missing from your relocated /home directory.



    All that is left is to make sure it operates as you expect after a reboot. One thing to note is that you still have the same data stored in original /home on the root filesystem /, but you've now mounted /dev/sda4 over it, so cannot access it. In order to reclaim the space from / you would need to unmount /dev/sda4, delete the old /home and remount /dev/sda4. I would only do this once I'm entirely sure everything is as it should be and no files or functionality is missing.



    To remove the old home directory, unmount the newly configured home partition:



    sudo umount /dev/sda4


    Delete the contents of the old home directory:



    sudo rm -r /home/*


    Remount /dev/sda4



    sudo mount -a





    share|improve this answer


























    • Excellent. Everything is working as described. I very much appreciate your help.

      – Philipp M
      Jan 8 at 16:02











    • Regarding you last point ... the data stored in the original /home is very limited. Just some desktop icons and a couple of files that can be deleted. Would you recommend to 'reclaim the space from /'? Or would you leave the structure as it is right now? Do I have any disadvantages in the future if I leave as it is like now?

      – Philipp M
      Jan 8 at 16:13













    • @PhilippM No problem. I can't see any major issues with leaving it there if it is as small as you think. I'd thought you might have a lot more in there which was using up the space on /. I wonder if it's the stuff in /snap that's using up the space? The only minor issue I can think of would be that if ever /dev/sda4 failed to mount, you might not notice as there'd still be a /home directory with stuff in it, if you saved anything there and the partition mounted properly at a later attempt it might seem like files have disappeared.

      – Arronical
      Jan 8 at 16:22











    • What would be the exact steps to finalize this last step? Could you provide it as optional step in your comment above?

      – Philipp M
      Jan 8 at 20:03











    • I've edited to add those details @PhilippM

      – Arronical
      2 days ago














    2












    2








    2







    The home partition you've created does not appear to be mounted in the filesystem. Ubuntu will use the /home directory for all users' homes, so the 90G /dev/sda4 partition needs to be mounted there. Unfortunately the stuff that's already in /home needs to be copied over, and your system reconfigured to mount the /dev/sda4/ partition in the correct place.



    First, create somewhere to mount your /dev/sda4 partition:



    sudo mkdir /media/newhome/


    Then mount the partition there:



    sudo mount /dev/sda4 /media/newhome


    Now copy all current homes to the current /dev/sda4 mountpoint:



    sudo cp -aR /home/* /media/newhome


    Now you need to edit the /etc/fstab file, which is responsible for mounting your partitions on system boot. Beware, this is a seriously important system file and ruining or deleting would be very bad!



    Make a backup of /etc/fstab



    sudo cp /etc/fstab /etc/fstab.bak


    Get the UUID of your partition, note this down for use in your next step:



    blkid /dev/sda4


    Now add a new entry into your /etc/fstab file with your preferred text editor using the UUID from the last command, make sure you're accurate with the UUID:



    # Mount /dev/sda at /home
    UUID=(put your UUID here) /home ext4 defaults 0 2


    Unmount your /dev/sda4 partition:



    sudo umount /dev/sda4


    Now check that the new /home mounts correctly:



    sudo mount -a


    If you issue df /home now the output should show that /dev/sda4 is the partition mounted there. After this, you should check that you have nothing missing from your relocated /home directory.



    All that is left is to make sure it operates as you expect after a reboot. One thing to note is that you still have the same data stored in original /home on the root filesystem /, but you've now mounted /dev/sda4 over it, so cannot access it. In order to reclaim the space from / you would need to unmount /dev/sda4, delete the old /home and remount /dev/sda4. I would only do this once I'm entirely sure everything is as it should be and no files or functionality is missing.



    To remove the old home directory, unmount the newly configured home partition:



    sudo umount /dev/sda4


    Delete the contents of the old home directory:



    sudo rm -r /home/*


    Remount /dev/sda4



    sudo mount -a





    share|improve this answer















    The home partition you've created does not appear to be mounted in the filesystem. Ubuntu will use the /home directory for all users' homes, so the 90G /dev/sda4 partition needs to be mounted there. Unfortunately the stuff that's already in /home needs to be copied over, and your system reconfigured to mount the /dev/sda4/ partition in the correct place.



    First, create somewhere to mount your /dev/sda4 partition:



    sudo mkdir /media/newhome/


    Then mount the partition there:



    sudo mount /dev/sda4 /media/newhome


    Now copy all current homes to the current /dev/sda4 mountpoint:



    sudo cp -aR /home/* /media/newhome


    Now you need to edit the /etc/fstab file, which is responsible for mounting your partitions on system boot. Beware, this is a seriously important system file and ruining or deleting would be very bad!



    Make a backup of /etc/fstab



    sudo cp /etc/fstab /etc/fstab.bak


    Get the UUID of your partition, note this down for use in your next step:



    blkid /dev/sda4


    Now add a new entry into your /etc/fstab file with your preferred text editor using the UUID from the last command, make sure you're accurate with the UUID:



    # Mount /dev/sda at /home
    UUID=(put your UUID here) /home ext4 defaults 0 2


    Unmount your /dev/sda4 partition:



    sudo umount /dev/sda4


    Now check that the new /home mounts correctly:



    sudo mount -a


    If you issue df /home now the output should show that /dev/sda4 is the partition mounted there. After this, you should check that you have nothing missing from your relocated /home directory.



    All that is left is to make sure it operates as you expect after a reboot. One thing to note is that you still have the same data stored in original /home on the root filesystem /, but you've now mounted /dev/sda4 over it, so cannot access it. In order to reclaim the space from / you would need to unmount /dev/sda4, delete the old /home and remount /dev/sda4. I would only do this once I'm entirely sure everything is as it should be and no files or functionality is missing.



    To remove the old home directory, unmount the newly configured home partition:



    sudo umount /dev/sda4


    Delete the contents of the old home directory:



    sudo rm -r /home/*


    Remount /dev/sda4



    sudo mount -a






    share|improve this answer














    share|improve this answer



    share|improve this answer








    edited 2 days ago

























    answered Jan 8 at 14:01









    ArronicalArronical

    13.2k84790




    13.2k84790













    • Excellent. Everything is working as described. I very much appreciate your help.

      – Philipp M
      Jan 8 at 16:02











    • Regarding you last point ... the data stored in the original /home is very limited. Just some desktop icons and a couple of files that can be deleted. Would you recommend to 'reclaim the space from /'? Or would you leave the structure as it is right now? Do I have any disadvantages in the future if I leave as it is like now?

      – Philipp M
      Jan 8 at 16:13













    • @PhilippM No problem. I can't see any major issues with leaving it there if it is as small as you think. I'd thought you might have a lot more in there which was using up the space on /. I wonder if it's the stuff in /snap that's using up the space? The only minor issue I can think of would be that if ever /dev/sda4 failed to mount, you might not notice as there'd still be a /home directory with stuff in it, if you saved anything there and the partition mounted properly at a later attempt it might seem like files have disappeared.

      – Arronical
      Jan 8 at 16:22











    • What would be the exact steps to finalize this last step? Could you provide it as optional step in your comment above?

      – Philipp M
      Jan 8 at 20:03











    • I've edited to add those details @PhilippM

      – Arronical
      2 days ago



















    • Excellent. Everything is working as described. I very much appreciate your help.

      – Philipp M
      Jan 8 at 16:02











    • Regarding you last point ... the data stored in the original /home is very limited. Just some desktop icons and a couple of files that can be deleted. Would you recommend to 'reclaim the space from /'? Or would you leave the structure as it is right now? Do I have any disadvantages in the future if I leave as it is like now?

      – Philipp M
      Jan 8 at 16:13













    • @PhilippM No problem. I can't see any major issues with leaving it there if it is as small as you think. I'd thought you might have a lot more in there which was using up the space on /. I wonder if it's the stuff in /snap that's using up the space? The only minor issue I can think of would be that if ever /dev/sda4 failed to mount, you might not notice as there'd still be a /home directory with stuff in it, if you saved anything there and the partition mounted properly at a later attempt it might seem like files have disappeared.

      – Arronical
      Jan 8 at 16:22











    • What would be the exact steps to finalize this last step? Could you provide it as optional step in your comment above?

      – Philipp M
      Jan 8 at 20:03











    • I've edited to add those details @PhilippM

      – Arronical
      2 days ago

















    Excellent. Everything is working as described. I very much appreciate your help.

    – Philipp M
    Jan 8 at 16:02





    Excellent. Everything is working as described. I very much appreciate your help.

    – Philipp M
    Jan 8 at 16:02













    Regarding you last point ... the data stored in the original /home is very limited. Just some desktop icons and a couple of files that can be deleted. Would you recommend to 'reclaim the space from /'? Or would you leave the structure as it is right now? Do I have any disadvantages in the future if I leave as it is like now?

    – Philipp M
    Jan 8 at 16:13







    Regarding you last point ... the data stored in the original /home is very limited. Just some desktop icons and a couple of files that can be deleted. Would you recommend to 'reclaim the space from /'? Or would you leave the structure as it is right now? Do I have any disadvantages in the future if I leave as it is like now?

    – Philipp M
    Jan 8 at 16:13















    @PhilippM No problem. I can't see any major issues with leaving it there if it is as small as you think. I'd thought you might have a lot more in there which was using up the space on /. I wonder if it's the stuff in /snap that's using up the space? The only minor issue I can think of would be that if ever /dev/sda4 failed to mount, you might not notice as there'd still be a /home directory with stuff in it, if you saved anything there and the partition mounted properly at a later attempt it might seem like files have disappeared.

    – Arronical
    Jan 8 at 16:22





    @PhilippM No problem. I can't see any major issues with leaving it there if it is as small as you think. I'd thought you might have a lot more in there which was using up the space on /. I wonder if it's the stuff in /snap that's using up the space? The only minor issue I can think of would be that if ever /dev/sda4 failed to mount, you might not notice as there'd still be a /home directory with stuff in it, if you saved anything there and the partition mounted properly at a later attempt it might seem like files have disappeared.

    – Arronical
    Jan 8 at 16:22













    What would be the exact steps to finalize this last step? Could you provide it as optional step in your comment above?

    – Philipp M
    Jan 8 at 20:03





    What would be the exact steps to finalize this last step? Could you provide it as optional step in your comment above?

    – Philipp M
    Jan 8 at 20:03













    I've edited to add those details @PhilippM

    – Arronical
    2 days ago





    I've edited to add those details @PhilippM

    – Arronical
    2 days ago













    -1














    Use your live USB, run Gparted from there, then resize your partitions.
    First take some space from /home, then 'Apply All Operations', then add free space to your / root.






    share|improve this answer








    New contributor




    G.H. is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
    Check out our Code of Conduct.

























      -1














      Use your live USB, run Gparted from there, then resize your partitions.
      First take some space from /home, then 'Apply All Operations', then add free space to your / root.






      share|improve this answer








      New contributor




      G.H. is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.























        -1












        -1








        -1







        Use your live USB, run Gparted from there, then resize your partitions.
        First take some space from /home, then 'Apply All Operations', then add free space to your / root.






        share|improve this answer








        New contributor




        G.H. is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
        Check out our Code of Conduct.










        Use your live USB, run Gparted from there, then resize your partitions.
        First take some space from /home, then 'Apply All Operations', then add free space to your / root.







        share|improve this answer








        New contributor




        G.H. is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
        Check out our Code of Conduct.









        share|improve this answer



        share|improve this answer






        New contributor




        G.H. is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
        Check out our Code of Conduct.









        answered Jan 8 at 12:03









        G.H.G.H.

        11




        11




        New contributor




        G.H. is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
        Check out our Code of Conduct.





        New contributor





        G.H. is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
        Check out our Code of Conduct.






        G.H. is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
        Check out our Code of Conduct.






























            draft saved

            draft discarded




















































            Thanks for contributing an answer to Ask Ubuntu!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1107958%2fubuntu-18-04-safely-remove-change-a-specific-partition-and-allocate-free-space%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            數位音樂下載

            When can things happen in Etherscan, such as the picture below?

            格利澤436b