How do I enlarge /home and /swap partitions on GNU/Linux?

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
1
down vote

favorite












Well, I've gotten myself into a sticky situation. I've just upgraded my laptop's RAM from 8 GB to 16 GB. Now, I know that Linux swap partition serves as a "home" for RAM on most Linux distros, including mine. Also, I have my Linux on a 1 TB HDD. However, when first installing, I've only used 700 GB out of 1 TB and naively thought that I could enlarge later if it were needed. So, 300 GB is basically just laying around doing nothing.



Well, now I need a bigger home and swap partition. However, even after running gparted, I only had the option to shrink these partitions, despite of 300 GB of space marked as 'Unallocated'. Please help me figure out how to enlarge both, so my RAM and storage capacity won't go to waste. Thank you in advance.



Addendum: the output of sudo parted -l:



root@smerdjakov:~# sudo parted -l
Model: ATA TOSHIBA MK1059GS (scsi)
Disk /dev/sda: 1000GB
Sector size (logical/physical): 512B/4096B
Partition Table: msdos
Disk Flags:

Number Start End Size Type File system Flags
1 1048kB 610GB 610GB extended boot
5 1049kB 2000MB 1999MB logical ext4
6 2001MB 102GB 100GB logical ext4
7 102GB 602GB 500GB logical ext4
8 602GB 610GB 7999MB logical linux-swap(v1)






share|improve this question


















  • 3




    What do you mean by "swap partition serves as a home" for RAM? That doesn't make much sense. There's no reason to increase your swap just because you got more RAM, unless you often use all of your RAM and then hibernate your machine. Anyway, please edit your question and show us the output of sudo parted -l. Also, why don't you just create a new partition in the empty space and mount that in a directory under your home? Why do you need to enlarge?
    – terdon♦
    Mar 25 at 12:50










  • I don't know, it just seems more convenient to keep my setup as it is. I'll edit my question in no time. "Swap serves as home to RAM" means that the swap acts as RAM storage for my system (sorry, I'm not a native English speaker, so I'm not very keen on this technical terminology; hence the misunderstanding).
    – Gregor Perčič
    Mar 25 at 12:59










  • Possible duplicate of Why is Kali Linux so hard to set up? Why won't people help me?
    – Hauke Laging
    Mar 25 at 12:59






  • 2




    When you increase RAM, you need less swap, not the opposite. That's just cargo cult from the past (and from a few old versions of Linux where it was required to have at least as much). What you should do is remove the swap entirely because it's in the way of the free 300GB and it's easy to do (but see Why is Kali so hard...). Had you used LVM, you'd have more options
    – A.B
    Mar 25 at 13:18











  • @HaukeLaging come on. Please stop using that post as a dupe for anything mentioning Kali. The basic problem here is about MBR extended partitions and has absolutely nothing to do with the OS being used.
    – terdon♦
    Mar 25 at 14:00














up vote
1
down vote

favorite












Well, I've gotten myself into a sticky situation. I've just upgraded my laptop's RAM from 8 GB to 16 GB. Now, I know that Linux swap partition serves as a "home" for RAM on most Linux distros, including mine. Also, I have my Linux on a 1 TB HDD. However, when first installing, I've only used 700 GB out of 1 TB and naively thought that I could enlarge later if it were needed. So, 300 GB is basically just laying around doing nothing.



Well, now I need a bigger home and swap partition. However, even after running gparted, I only had the option to shrink these partitions, despite of 300 GB of space marked as 'Unallocated'. Please help me figure out how to enlarge both, so my RAM and storage capacity won't go to waste. Thank you in advance.



Addendum: the output of sudo parted -l:



root@smerdjakov:~# sudo parted -l
Model: ATA TOSHIBA MK1059GS (scsi)
Disk /dev/sda: 1000GB
Sector size (logical/physical): 512B/4096B
Partition Table: msdos
Disk Flags:

Number Start End Size Type File system Flags
1 1048kB 610GB 610GB extended boot
5 1049kB 2000MB 1999MB logical ext4
6 2001MB 102GB 100GB logical ext4
7 102GB 602GB 500GB logical ext4
8 602GB 610GB 7999MB logical linux-swap(v1)






share|improve this question


















  • 3




    What do you mean by "swap partition serves as a home" for RAM? That doesn't make much sense. There's no reason to increase your swap just because you got more RAM, unless you often use all of your RAM and then hibernate your machine. Anyway, please edit your question and show us the output of sudo parted -l. Also, why don't you just create a new partition in the empty space and mount that in a directory under your home? Why do you need to enlarge?
    – terdon♦
    Mar 25 at 12:50










  • I don't know, it just seems more convenient to keep my setup as it is. I'll edit my question in no time. "Swap serves as home to RAM" means that the swap acts as RAM storage for my system (sorry, I'm not a native English speaker, so I'm not very keen on this technical terminology; hence the misunderstanding).
    – Gregor Perčič
    Mar 25 at 12:59










  • Possible duplicate of Why is Kali Linux so hard to set up? Why won't people help me?
    – Hauke Laging
    Mar 25 at 12:59






  • 2




    When you increase RAM, you need less swap, not the opposite. That's just cargo cult from the past (and from a few old versions of Linux where it was required to have at least as much). What you should do is remove the swap entirely because it's in the way of the free 300GB and it's easy to do (but see Why is Kali so hard...). Had you used LVM, you'd have more options
    – A.B
    Mar 25 at 13:18











  • @HaukeLaging come on. Please stop using that post as a dupe for anything mentioning Kali. The basic problem here is about MBR extended partitions and has absolutely nothing to do with the OS being used.
    – terdon♦
    Mar 25 at 14:00












up vote
1
down vote

favorite









up vote
1
down vote

favorite











Well, I've gotten myself into a sticky situation. I've just upgraded my laptop's RAM from 8 GB to 16 GB. Now, I know that Linux swap partition serves as a "home" for RAM on most Linux distros, including mine. Also, I have my Linux on a 1 TB HDD. However, when first installing, I've only used 700 GB out of 1 TB and naively thought that I could enlarge later if it were needed. So, 300 GB is basically just laying around doing nothing.



Well, now I need a bigger home and swap partition. However, even after running gparted, I only had the option to shrink these partitions, despite of 300 GB of space marked as 'Unallocated'. Please help me figure out how to enlarge both, so my RAM and storage capacity won't go to waste. Thank you in advance.



Addendum: the output of sudo parted -l:



root@smerdjakov:~# sudo parted -l
Model: ATA TOSHIBA MK1059GS (scsi)
Disk /dev/sda: 1000GB
Sector size (logical/physical): 512B/4096B
Partition Table: msdos
Disk Flags:

Number Start End Size Type File system Flags
1 1048kB 610GB 610GB extended boot
5 1049kB 2000MB 1999MB logical ext4
6 2001MB 102GB 100GB logical ext4
7 102GB 602GB 500GB logical ext4
8 602GB 610GB 7999MB logical linux-swap(v1)






share|improve this question














Well, I've gotten myself into a sticky situation. I've just upgraded my laptop's RAM from 8 GB to 16 GB. Now, I know that Linux swap partition serves as a "home" for RAM on most Linux distros, including mine. Also, I have my Linux on a 1 TB HDD. However, when first installing, I've only used 700 GB out of 1 TB and naively thought that I could enlarge later if it were needed. So, 300 GB is basically just laying around doing nothing.



Well, now I need a bigger home and swap partition. However, even after running gparted, I only had the option to shrink these partitions, despite of 300 GB of space marked as 'Unallocated'. Please help me figure out how to enlarge both, so my RAM and storage capacity won't go to waste. Thank you in advance.



Addendum: the output of sudo parted -l:



root@smerdjakov:~# sudo parted -l
Model: ATA TOSHIBA MK1059GS (scsi)
Disk /dev/sda: 1000GB
Sector size (logical/physical): 512B/4096B
Partition Table: msdos
Disk Flags:

Number Start End Size Type File system Flags
1 1048kB 610GB 610GB extended boot
5 1049kB 2000MB 1999MB logical ext4
6 2001MB 102GB 100GB logical ext4
7 102GB 602GB 500GB logical ext4
8 602GB 610GB 7999MB logical linux-swap(v1)








share|improve this question













share|improve this question




share|improve this question








edited Mar 29 at 22:35









peterh

3,92092755




3,92092755










asked Mar 25 at 12:39









Gregor Perčič

11817




11817







  • 3




    What do you mean by "swap partition serves as a home" for RAM? That doesn't make much sense. There's no reason to increase your swap just because you got more RAM, unless you often use all of your RAM and then hibernate your machine. Anyway, please edit your question and show us the output of sudo parted -l. Also, why don't you just create a new partition in the empty space and mount that in a directory under your home? Why do you need to enlarge?
    – terdon♦
    Mar 25 at 12:50










  • I don't know, it just seems more convenient to keep my setup as it is. I'll edit my question in no time. "Swap serves as home to RAM" means that the swap acts as RAM storage for my system (sorry, I'm not a native English speaker, so I'm not very keen on this technical terminology; hence the misunderstanding).
    – Gregor Perčič
    Mar 25 at 12:59










  • Possible duplicate of Why is Kali Linux so hard to set up? Why won't people help me?
    – Hauke Laging
    Mar 25 at 12:59






  • 2




    When you increase RAM, you need less swap, not the opposite. That's just cargo cult from the past (and from a few old versions of Linux where it was required to have at least as much). What you should do is remove the swap entirely because it's in the way of the free 300GB and it's easy to do (but see Why is Kali so hard...). Had you used LVM, you'd have more options
    – A.B
    Mar 25 at 13:18











  • @HaukeLaging come on. Please stop using that post as a dupe for anything mentioning Kali. The basic problem here is about MBR extended partitions and has absolutely nothing to do with the OS being used.
    – terdon♦
    Mar 25 at 14:00












  • 3




    What do you mean by "swap partition serves as a home" for RAM? That doesn't make much sense. There's no reason to increase your swap just because you got more RAM, unless you often use all of your RAM and then hibernate your machine. Anyway, please edit your question and show us the output of sudo parted -l. Also, why don't you just create a new partition in the empty space and mount that in a directory under your home? Why do you need to enlarge?
    – terdon♦
    Mar 25 at 12:50










  • I don't know, it just seems more convenient to keep my setup as it is. I'll edit my question in no time. "Swap serves as home to RAM" means that the swap acts as RAM storage for my system (sorry, I'm not a native English speaker, so I'm not very keen on this technical terminology; hence the misunderstanding).
    – Gregor Perčič
    Mar 25 at 12:59










  • Possible duplicate of Why is Kali Linux so hard to set up? Why won't people help me?
    – Hauke Laging
    Mar 25 at 12:59






  • 2




    When you increase RAM, you need less swap, not the opposite. That's just cargo cult from the past (and from a few old versions of Linux where it was required to have at least as much). What you should do is remove the swap entirely because it's in the way of the free 300GB and it's easy to do (but see Why is Kali so hard...). Had you used LVM, you'd have more options
    – A.B
    Mar 25 at 13:18











  • @HaukeLaging come on. Please stop using that post as a dupe for anything mentioning Kali. The basic problem here is about MBR extended partitions and has absolutely nothing to do with the OS being used.
    – terdon♦
    Mar 25 at 14:00







3




3




What do you mean by "swap partition serves as a home" for RAM? That doesn't make much sense. There's no reason to increase your swap just because you got more RAM, unless you often use all of your RAM and then hibernate your machine. Anyway, please edit your question and show us the output of sudo parted -l. Also, why don't you just create a new partition in the empty space and mount that in a directory under your home? Why do you need to enlarge?
– terdon♦
Mar 25 at 12:50




What do you mean by "swap partition serves as a home" for RAM? That doesn't make much sense. There's no reason to increase your swap just because you got more RAM, unless you often use all of your RAM and then hibernate your machine. Anyway, please edit your question and show us the output of sudo parted -l. Also, why don't you just create a new partition in the empty space and mount that in a directory under your home? Why do you need to enlarge?
– terdon♦
Mar 25 at 12:50












I don't know, it just seems more convenient to keep my setup as it is. I'll edit my question in no time. "Swap serves as home to RAM" means that the swap acts as RAM storage for my system (sorry, I'm not a native English speaker, so I'm not very keen on this technical terminology; hence the misunderstanding).
– Gregor Perčič
Mar 25 at 12:59




I don't know, it just seems more convenient to keep my setup as it is. I'll edit my question in no time. "Swap serves as home to RAM" means that the swap acts as RAM storage for my system (sorry, I'm not a native English speaker, so I'm not very keen on this technical terminology; hence the misunderstanding).
– Gregor Perčič
Mar 25 at 12:59












Possible duplicate of Why is Kali Linux so hard to set up? Why won't people help me?
– Hauke Laging
Mar 25 at 12:59




Possible duplicate of Why is Kali Linux so hard to set up? Why won't people help me?
– Hauke Laging
Mar 25 at 12:59




2




2




When you increase RAM, you need less swap, not the opposite. That's just cargo cult from the past (and from a few old versions of Linux where it was required to have at least as much). What you should do is remove the swap entirely because it's in the way of the free 300GB and it's easy to do (but see Why is Kali so hard...). Had you used LVM, you'd have more options
– A.B
Mar 25 at 13:18





When you increase RAM, you need less swap, not the opposite. That's just cargo cult from the past (and from a few old versions of Linux where it was required to have at least as much). What you should do is remove the swap entirely because it's in the way of the free 300GB and it's easy to do (but see Why is Kali so hard...). Had you used LVM, you'd have more options
– A.B
Mar 25 at 13:18













@HaukeLaging come on. Please stop using that post as a dupe for anything mentioning Kali. The basic problem here is about MBR extended partitions and has absolutely nothing to do with the OS being used.
– terdon♦
Mar 25 at 14:00




@HaukeLaging come on. Please stop using that post as a dupe for anything mentioning Kali. The basic problem here is about MBR extended partitions and has absolutely nothing to do with the OS being used.
– terdon♦
Mar 25 at 14:00










1 Answer
1






active

oldest

votes

















up vote
1
down vote













You probably don't need that much swap. Unless hibernating when all RAM is in use, you will need less swap.



You can not resize through a partition that is in use. So you need to disable the swap use swapoff to disable it. Then you can move the swap (if still needed). Then resize it (if needed), then resize the other partitions.



Alternatively add additional partition(s), and mount them somewhere. This would be less flexible. As you have to manage what is on each partition.



Alternatively consider LVM, I have no idea if this can be done retrospectively. Hopefully some one else can give an answer to that.




From comment: you seem to have remove the swap. but not told the OS not to use it. Look in fstab, and remove the line related to swap, to disable swap.






share|improve this answer




















  • I've already fixed the "Gave up..." error, but it required more than just editing the fstab file (I had to recompile some .config files for some reason). I'm considering making a Kali GNU/Linux bootable USB drive. Through the process of installation, there is also a disk/partition manager. Maybe this particular one will have no problem resizing my home partition. Also, what is the difference between logical and primary partitions?
    – Gregor Perčič
    Mar 31 at 9:31










  • Logical/physical are a sort of kludge of the way partitions are/were done on PC. The partition table has only 4 entries, so someone came up with an extension, where you add and extended partition, this has another partition table, and a set of (logical) partitions. Thus allowing more than 4.
    – ctrl-alt-delor
    Apr 1 at 21:54










Your Answer







StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "106"
;
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',
convertImagesToLinks: false,
noModals: false,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);








 

draft saved


draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f433416%2fhow-do-i-enlarge-home-and-swap-partitions-on-gnu-linux%23new-answer', 'question_page');

);

Post as a guest






























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes








up vote
1
down vote













You probably don't need that much swap. Unless hibernating when all RAM is in use, you will need less swap.



You can not resize through a partition that is in use. So you need to disable the swap use swapoff to disable it. Then you can move the swap (if still needed). Then resize it (if needed), then resize the other partitions.



Alternatively add additional partition(s), and mount them somewhere. This would be less flexible. As you have to manage what is on each partition.



Alternatively consider LVM, I have no idea if this can be done retrospectively. Hopefully some one else can give an answer to that.




From comment: you seem to have remove the swap. but not told the OS not to use it. Look in fstab, and remove the line related to swap, to disable swap.






share|improve this answer




















  • I've already fixed the "Gave up..." error, but it required more than just editing the fstab file (I had to recompile some .config files for some reason). I'm considering making a Kali GNU/Linux bootable USB drive. Through the process of installation, there is also a disk/partition manager. Maybe this particular one will have no problem resizing my home partition. Also, what is the difference between logical and primary partitions?
    – Gregor Perčič
    Mar 31 at 9:31










  • Logical/physical are a sort of kludge of the way partitions are/were done on PC. The partition table has only 4 entries, so someone came up with an extension, where you add and extended partition, this has another partition table, and a set of (logical) partitions. Thus allowing more than 4.
    – ctrl-alt-delor
    Apr 1 at 21:54














up vote
1
down vote













You probably don't need that much swap. Unless hibernating when all RAM is in use, you will need less swap.



You can not resize through a partition that is in use. So you need to disable the swap use swapoff to disable it. Then you can move the swap (if still needed). Then resize it (if needed), then resize the other partitions.



Alternatively add additional partition(s), and mount them somewhere. This would be less flexible. As you have to manage what is on each partition.



Alternatively consider LVM, I have no idea if this can be done retrospectively. Hopefully some one else can give an answer to that.




From comment: you seem to have remove the swap. but not told the OS not to use it. Look in fstab, and remove the line related to swap, to disable swap.






share|improve this answer




















  • I've already fixed the "Gave up..." error, but it required more than just editing the fstab file (I had to recompile some .config files for some reason). I'm considering making a Kali GNU/Linux bootable USB drive. Through the process of installation, there is also a disk/partition manager. Maybe this particular one will have no problem resizing my home partition. Also, what is the difference between logical and primary partitions?
    – Gregor Perčič
    Mar 31 at 9:31










  • Logical/physical are a sort of kludge of the way partitions are/were done on PC. The partition table has only 4 entries, so someone came up with an extension, where you add and extended partition, this has another partition table, and a set of (logical) partitions. Thus allowing more than 4.
    – ctrl-alt-delor
    Apr 1 at 21:54












up vote
1
down vote










up vote
1
down vote









You probably don't need that much swap. Unless hibernating when all RAM is in use, you will need less swap.



You can not resize through a partition that is in use. So you need to disable the swap use swapoff to disable it. Then you can move the swap (if still needed). Then resize it (if needed), then resize the other partitions.



Alternatively add additional partition(s), and mount them somewhere. This would be less flexible. As you have to manage what is on each partition.



Alternatively consider LVM, I have no idea if this can be done retrospectively. Hopefully some one else can give an answer to that.




From comment: you seem to have remove the swap. but not told the OS not to use it. Look in fstab, and remove the line related to swap, to disable swap.






share|improve this answer












You probably don't need that much swap. Unless hibernating when all RAM is in use, you will need less swap.



You can not resize through a partition that is in use. So you need to disable the swap use swapoff to disable it. Then you can move the swap (if still needed). Then resize it (if needed), then resize the other partitions.



Alternatively add additional partition(s), and mount them somewhere. This would be less flexible. As you have to manage what is on each partition.



Alternatively consider LVM, I have no idea if this can be done retrospectively. Hopefully some one else can give an answer to that.




From comment: you seem to have remove the swap. but not told the OS not to use it. Look in fstab, and remove the line related to swap, to disable swap.







share|improve this answer












share|improve this answer



share|improve this answer










answered Mar 29 at 22:56









ctrl-alt-delor

8,76031947




8,76031947











  • I've already fixed the "Gave up..." error, but it required more than just editing the fstab file (I had to recompile some .config files for some reason). I'm considering making a Kali GNU/Linux bootable USB drive. Through the process of installation, there is also a disk/partition manager. Maybe this particular one will have no problem resizing my home partition. Also, what is the difference between logical and primary partitions?
    – Gregor Perčič
    Mar 31 at 9:31










  • Logical/physical are a sort of kludge of the way partitions are/were done on PC. The partition table has only 4 entries, so someone came up with an extension, where you add and extended partition, this has another partition table, and a set of (logical) partitions. Thus allowing more than 4.
    – ctrl-alt-delor
    Apr 1 at 21:54
















  • I've already fixed the "Gave up..." error, but it required more than just editing the fstab file (I had to recompile some .config files for some reason). I'm considering making a Kali GNU/Linux bootable USB drive. Through the process of installation, there is also a disk/partition manager. Maybe this particular one will have no problem resizing my home partition. Also, what is the difference between logical and primary partitions?
    – Gregor Perčič
    Mar 31 at 9:31










  • Logical/physical are a sort of kludge of the way partitions are/were done on PC. The partition table has only 4 entries, so someone came up with an extension, where you add and extended partition, this has another partition table, and a set of (logical) partitions. Thus allowing more than 4.
    – ctrl-alt-delor
    Apr 1 at 21:54















I've already fixed the "Gave up..." error, but it required more than just editing the fstab file (I had to recompile some .config files for some reason). I'm considering making a Kali GNU/Linux bootable USB drive. Through the process of installation, there is also a disk/partition manager. Maybe this particular one will have no problem resizing my home partition. Also, what is the difference between logical and primary partitions?
– Gregor Perčič
Mar 31 at 9:31




I've already fixed the "Gave up..." error, but it required more than just editing the fstab file (I had to recompile some .config files for some reason). I'm considering making a Kali GNU/Linux bootable USB drive. Through the process of installation, there is also a disk/partition manager. Maybe this particular one will have no problem resizing my home partition. Also, what is the difference between logical and primary partitions?
– Gregor Perčič
Mar 31 at 9:31












Logical/physical are a sort of kludge of the way partitions are/were done on PC. The partition table has only 4 entries, so someone came up with an extension, where you add and extended partition, this has another partition table, and a set of (logical) partitions. Thus allowing more than 4.
– ctrl-alt-delor
Apr 1 at 21:54




Logical/physical are a sort of kludge of the way partitions are/were done on PC. The partition table has only 4 entries, so someone came up with an extension, where you add and extended partition, this has another partition table, and a set of (logical) partitions. Thus allowing more than 4.
– ctrl-alt-delor
Apr 1 at 21:54












 

draft saved


draft discarded


























 


draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f433416%2fhow-do-i-enlarge-home-and-swap-partitions-on-gnu-linux%23new-answer', 'question_page');

);

Post as a guest













































































Popular posts from this blog

Peggy Mitchell

Palaiologos

The Forum (Inglewood, California)