Extending a disk partition

I use OpenSUSE Tumbleweed on my computer. I also have Windows installed in a dual-boot configuration. Lately, I’ve been running out of free space on the partition where OpenSUSE is installed.

Here’s what I want to do:

  1. Delete the partition where Windows is installed;

  2. Move the NTFS partition /dev/sda5;

  3. Move and expand the /dev/sda6 partition, where OpenSUSE is installed.

Is this a good idea? Or would it be better to repartition the drive from scratch and do a fresh installation of OpenSUSE?

Which one is that?

To where?

Again, to where?

And it is always nicer to show with commands. Then we can freely browse through it while still having your story readable. Like fdisk -l and lsblk -f

I would do that from Windows since current Linux NTFS tools may leave inconsistencies behind.

AFAIK you cannot move the beginning of a linux partition, you may just resize it.

All in all I think that a safer option is:

  • backup the content of sda5
  • delete sda4, sda5, sda6
  • re-partition as needed
  • copy back the backup content to the new NTFS partition
  • re-install Tumbleweed.

But that is just what I would do; it’s your system and so is your choice.

But why a new NTFS file system? There is no Windows anymore on the hardware. Thus take the opportunity and create a Linux file system and restore the files on it. Then you can set ownership and permissions to what they should be.

This is the output of fdisk -l:

Диск /dev/sda: 238,47 GiB, 256060514304 байтів, 500118192 секторів
Модель диска: Micron 1100 SATA
Одиниці: секторів з 1 * 512 = 512 байтів
Розмір сектора (логічного/фізичного): 512 байтів / 4096 байтів
Розмір введення-виведення (мінімальний/оптимальний): 4096 байтів / 4096 байтів
Тип мітки диска: gpt
Ідентифікатор диска: *******-*********

Пристрій     Початок    Кінець   Сектори Розмір Тип
/dev/sda1       2048    923647    921600   450M Середовище відновлення Windows
/dev/sda2     923648   1128447    204800   100M Система EFI
/dev/sda3    1128448   1161215     32768    16M Microsoft, зарезервований
/dev/sda4    1161216 251803647 250642432 119,5G Microsoft, основні дані
/dev/sda5  251803648 391065599 139261952  66,4G Microsoft, основні дані
/dev/sda6  391065600 495923199 104857600    50G Файлова система Linux
/dev/sda7  495923200 500118158   4194959     2G Linux swap

This is the output of lsblk -f:

NAME   FSTYPE FSVER LABEL UUID                                 FSAVAIL FSUSE% MOUNTPOINTS
sda                                                                           
├─sda1                                                                        
├─sda2                                                           28,2M    71% /boot/efi
├─sda3                                                                        
├─sda4                                                           21,4G    82% /windows/C
├─sda5                                                            4,4G    93% /windows/D
├─sda6                                                            5,8G    86% /var
│                                                                             /usr/local
│                                                                             /srv
│                                                                             /home
│                                                                             /root
│                                                                             /opt
│                                                                             /boot/grub2/x86_64-efi
│                                                                             /boot/grub2/i386-pc
│                                                                             /.snapshots
│                                                                             /
└─sda7                                                                        [SWAP]

So, I want to delete /dev/sda4, 119.5 GB (NTFS), and then I want to move /dev/sda5, 66.4 GB (NTFS), to the space previously occupied by /dev/sda4. Then I want to move /dev/sda6, 50 GB (Btrfs), to the space previously occupied by /dev/sda5 and expand it to approximately 169 GB.

Thank you for your reply. I’ll keep that in mind.

Two things about this way of posting.

  1. One does not say “This is the output of …”, but one simply includes the prompt/command line within the copy/paste (it is only one line more and no additional typing needed)
  2. When you system is not in English and you want to post in the English section of the forums, then please precede your command with LANG=C. E.g. LANG=C fdisk -l.

For the rest: thanks for showing, it helps in the understanding.

I am not 100% sure I understand your goal,but when it is to get rid of Windows, then I think I am a fan of @OrsoBruno 's approach. After all, you did not talk about sda1 and sda3, but you may not need them anymore. so a new installation and restoring of the data to (a) new, Linux file system(s) might be the way to go.

Thank you for your quick reply.

I guess I’ll have to do a clean install after all. Although I’d prefer to avoid it, since it’s a more time-consuming process. But in the end, it’s the right and most reliable approach.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.