12.1 Gnome 3 & gparted swapon command not found, how to enable swap

openSUSE 12.1 Gnome 3 x64
GParted 0.9.1
this is what happens when I try to do a swapon using the gui:

http://i.imgur.com/ROdzd.png

so i thought maybe something wasn’t installed but after running cnf swapon I get

~> cnf swapon

Program ‘swapon’ is present in package ‘util-linux’, which is installed on your system.

Absolute path to ‘swapon’ is ‘/sbin/swapon’, so running it may require superuser privileges (eg. root).

I’m guessing theres a problem with gparted?

I mostly just wanted to test swapon in gparted and I know it doesnt really matter so I’ll probably just find a real way to enable swap, and maybe open a bug report.

The reason swap isn’t already enabled is because I deleted it when I did a new install, and I’ve been running without it for a couple months now, I don’t particularly need it but I want to compare the results of hibernating vs suspend, which is faster etc.

/sbin in not in you user PATH. That might be an explanation. You should run gparted from a root login shell (su -l) or add /sbin to your PATH … or symlink /sbin/swapon in /usr/bin.

Should the menu entry for gparted be defaulted to run as pkexec or gnomesu then, perhaps? Thus indicating that the problem is with the gparted install script or just the part where the menu entry is created, or is it supposed to be this way, sort of like unetbootin is? Maybe it should create 2 entries like Catalyst does?

It does already run as xdg-su, but it doesn’t inherit root’s environment (including PATH). That’s how “su -l” is different from “su” or “sudo”.

With that said my next question is, it seems when the swap was deleted fstab and the ‘kernel command’ still have the old swap set at boot time. So I changed it in fstab but how do I update it everywhere else? I found out to edit the kernel command line I can use Yast>Boot Loader, the question is

For example in dmesg I would have seen something like this pointing to the old swap: 0.000000] Kernel command line: root=/dev/disk/by-id/ata-ST95005620AS_5YX0A613-part1 resume=/dev/disk/by-id/ata-ST95005620AS_5YX0A613-part5 splash=silent quiet vga=0x3f0

Is there anywhere else I need to change ‘part5’ besides the kernel command and fstab?

The DEFAULT_APPEND and XEN_KERNEL_APPEND keys in /etc/sysconfig/bootloader. If you use UUIDs instead of disk/by-id symlinks, you don’t have this problem. openSUSE’s default is not optimal. If you partitionate in expert mode, you can change this default during setup by clicking on fstab options for each partition and selecting “mount by UUID”. It is better IMO.

It would seem as though it has updated /etc/sysconfig/bootloader automatically, as the entries there are correct. So that part was simple, but it was nice looking over it. I’ll look over the boot logs again after this.

Can’t the UUID’s change somehow or am I mistaken and it’s the ‘part ids’ that can change? Is there no way to switch over to the uuid method after already having chose the default. I did probably use expert mode, but I saw no reason to choose uuid instead. Thanks

On 2012-02-07 19:56, l300lvl wrote:
> Is there anywhere else I need to change ‘part5’ besides the kernel
> command and fstab?

kernel line in grub menu.lst file. And perhaps mkinitrd.


Cheers / Saludos,

Carlos E. R.
(from 11.4 x86_64 “Celadon” at Telcontar)

The UUID is written in the filesystem superblock. It won’t change unless you reformat the partition. You can change the UUID with tune2fs but it is only needed if you clone a hard disk and want to mount both on the same machine.

You can edit /etc/fstab. Be careful though. Make a copy first. Here’s an example:

# /etc/fstab: static file system information.
# generated by niginstall -  Sun Dec 11 07:18:25 PST 2011
# <fs>                                    <mount point>   <type>     <options>            <dump> <pass>
# /dev/sda5
UUID=205124c1-ee94-4d5d-998e-a507351731ba    swap           swap      defaults               0   0
# /dev/sdb5
UUID=c224505c-6233-404f-a706-308138573fce    swap           swap      defaults               0   0
#
# /dev/sda9
UUID=08a61a8a-b03d-4e27-b5aa-3780b3830e5c    /              ext4      acl,user_xattr         1   1
# /dev/sda10
UUID=d31f9c29-6169-4ea3-b69e-8aa0bda056ae    /local         ext4      acl,user_xattr         1   2
# /dev/sda8
UUID=677d9a84-4382-4192-aca1-691e3b41d83c    /home          ext3      defaults               0   2
# /dev/sda11
UUID=b5bd3c31-cc83-4058-a485-41850c1c5bf9    /tmp           ext4      defaults               0   2
# /dev/sda15
UUID=1faaff22-d9ab-4a29-b04c-c7bce19e300e    /srv           ext4      defaults               0   2
# /dev/sdb12
UUID=a556486d-f7fe-4161-8a97-6daff6b03a87    /misc          ext3      defaults               0   2

To view the UUIDs, use the command blkid.

If you want to see more, use this script: http://forums.opensuse.org/english/other-forums/development/programming-scripting/461462-partinfo-displaying-partition-infos.html#post2353213

These two syntaxes are possible in menu.lst

###Don't change this comment - YaST2 identifier: Original name: linux###
title openSUSE 12.1 (Asparagus) - kernel 3.1.9-1.4 (Desktop)
    root (hd0,8)
    kernel /boot/vmlinuz-3.1.9-1.4-desktop root=/dev/disk/by-uuid/08a61a8a-b03d-4e27-b5aa-3780b3830e5c nomodeset resume=/dev/disk/by-uuid/205124c1-ee94-4d5d-998e-a507351731ba splash=silent quiet showopts vga=0x31a
    initrd /boot/initrd-3.1.9-1.4-desktop

###Don't change this comment - YaST2 identifier: Original name: ubuntu###
title Ubuntu 10.10 (Oneiric) - kernel 3.0.0-15
    root (hd0,5)
    kernel /boot/vmlinuz-3.0.0-15-generic root=UUID=4c0b16ab-6184-4d5c-8546-0b05ff3e5dcb ro vga=791
    initrd /boot/initrd.img-3.0.0-15-generic

Is it at all possible to comment something out in menu.lst that way I can always re-edit it later. If not, I can always make a copy, I was just wondering if the whole menu.lst get overwritten when running mkinitrd?

Not at all. It is overwritten by the Perl BootLoader after a kernel update.

Excellent. Than you for being oh, so, very informative. The only remaining question I can think of is: Just for clarifications sakes, Perl BootLoader=Yast>Bootloader? Meaning, that is probably what did the ‘automagical’ updates earlier when I used it to change the kernel command line initially?

Now I can start switching over to uuids, Thanks again!

Yes and no. Both packages perl-Bootloader and yast2-bootloader-2 are used. When you change bootloader options in Yast, YaST calls the Perl Bootloader scripts. You can read more details in this thread: http://forums.opensuse.org/english/get-technical-help-here/install-boot-login/471406-how-does-yast-use-grub-4.html#post2434151

On 2012-02-07 23:26, l300lvl wrote:
> Is it at all possible to comment something out in menu.lst that way I
> can always re-edit it later.

Yes, you can. Lots of comments if you like.

> I was
> just wondering if the whole menu.lst get overwritten when running
> mkinitrd?

No, mkinitrd doesn’t do that. When you add or update or remove a kernel
entries get added or removed, by other tools. It is also not a bad idea of
having a copy of the file, just in case.


Cheers / Saludos,

Carlos E. R.
(from 11.4 x86_64 “Celadon” at Telcontar)