How to transfer swap partition to OS drive from external?

Consequently, does OpenSUSE support dynamically resizing the live system drive in order to transfer the SWAP partition to it? It seems like it would be a complex process, but I don’t know of any reason why it would be fundamentally impossible. If I should use a live image for this, that’s not problematic.

Thanks.

@rokejulianlockhart just create the swap partition on the device and size you want, add it to the mix, turn off swap, delete the old swap partition and turn swap on again. It’s dynamic, likewise with a swapfile or the likes of zram.

1 Like

@malcolmlewis,

Can OpenSUSE handle its primary drive resizing whilst booted?

What does this mean?

I’m guessing using the right-click > disable?

I ask about PartitionManager because YaST doesn’t appear to provide any such option.

@rokejulianlockhart
If the primary drive is btrfs, sure… just resize and reboot…

Swap is swap… if a partition or a file or say zram is there and partitions are mounted it will use it as swap…

You can also set priorities for swap, as in say you have two, you can designate one as primary the other as secondary etc…

Use swap off and swap on to activate, remove the partitions from /etc/fstab and turn off then on and will be gone…

Define “drive” and “primary”. The straightforward interpretation - hard disk drive (HDD) or solid state drive (SSD). How are you going to resize hardware when booted?

If you mean filesystem or partition - it depends on which filesystem exactly and on partition layout. And it has nothing to do with “OpenSUSE” (which is “openSUSE” by the way) because it is the same in any other distribution.

https://bugzilla.opensuse.org/show_bug.cgi?id=1215639#c0

@rokejulianlockhart then you the installer person, set it where you want it to be, by creating and setting it as swap… guided is best guess, use existing partitions or none and then create as required.

# inxi -S
System:
  Host: ab560 Kernel: 6.4.11-1-default arch: x86_64 bits: 64 Desktop: Trinity
    Distro: openSUSE Tumbleweed 20230904
# which swap
which: no swap in (/sbin:/usr/sbin:/usr/local/sbin:/root/bin:/usr/local/bin:/usr/bin:/bin)
# which swapoff
/sbin/swapoff
# which swapon
/sbin/swapon
#

Unfortunately, Guided is what I use. That’s why I posted 1215639 – Provide the user with a choice of where they want their SWAP partition to be. - I think I can reasonably assume that if I only selected one drive in Guided, none of the others should be modified, right?

Thanks though.


I’m not competent enough for that. I can use a commandline for script kiddy tasks, but I’m no software dev yet - I’m a GUI guy unless I know I’m doing.

@rokejulianlockhart Maybe it would, on my installs I usually just pre-partition what I want and tell it to use existing partitions and move on from that, especially if dual boot.

Maybe Tumbleweed is not for you then if not wanting to extend your command line skills?

I think it is, because it’s not like this makes sense - a drive shouldn’t ever be touched unless the user explicitly allows it. I’ve no issue with using the commandline, I just don’t want to be forced to do everything via it because the GUIs are broken, else I’d use Arch.

https://bugzilla.opensuse.org/show_bug.cgi?id=1215639#c2

@rokejulianlockhart It is correct, it will select an existing partition (nvmen1p3) that is already created as swap, it won’t try and create another (perhaps if encryption is used?).

Go change the type of that already existing swap partition(s) to type 8300 temporarily and will create on on the selected drive.

As explained in your bug report, guided tries it’s best, use the expert partitioner for multiple disks/partitions.

1 Like

The installer offers GUI-based “Expert Partitioner”. I use it since several years and only create what is needed:

erlangen:~ # fdisk -l -o device,size,type /dev/nvme1n1
...
Disk model: Samsung SSD 970 EVO Plus 2TB            
...
Device          Size Type
/dev/nvme1n1p1  512M EFI System
/dev/nvme1n1p2  1.8T Linux filesystem
erlangen:~ # 

Thus I avoid the hassle of dealing with swap.

Yeah, I’ll make sure to delete unwanted SWAPs on secondary internal drives during my next installation, and if I forget, I’ll see whether I can easily wipe a partition using Expert and combine it with Guided subsequently.

Thanks.

@rokejulianlockhart I wouldn’t delete, just change the type so it’s not detected and see if that makes a difference…

I’m only referring to when I inevitably have to reinstall. There’s no need to keep around SWAP partitions during that, right? However, I’m gonna play around with things like what you suggest in a VM since someone at Bugzilla sensibly suggested that.

Swap has advantages and is required for stuff like hibernation, suspend and so on. Most people don‘t follow Karls advice as he has some out of world setups that are not feasable for normal and power users. And his opinion that „ dealing with swap is a hassle“ is FUD and not backed by facts.

2 Likes

@hui on Tumbleweed and MicroOS that has/is changed… kernel lockdown and secure boot == no hibernate, suspend to RAM (probably), containers… Times they are a changing…

I’ve not run swap for a long time or secure-boot :wink:

I’m using Tumbleweed and easily enable Hibernation every time I install. What do you refer to, @MalcolmLewis?