1

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)
12
  • 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, 2018 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).
    – God bless
    Mar 25, 2018 at 12:59
  • Possible duplicate of Why is Kali Linux so hard to set up? Why won't people help me? Mar 25, 2018 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, 2018 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, 2018 at 14:00

1 Answer 1

1

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.

2
  • 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?
    – God bless
    Mar 31, 2018 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. Apr 1, 2018 at 21:54

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .