Page 1 of 2 12 LastLast
Results 1 to 10 of 19

Thread: howto remove swap (/dev/sdb2 ) from system boot

  1. #1

    Default howto remove swap (/dev/sdb2 ) from system boot

    Hi, everyone:
    I install a opensuse leap 42.1 as a little server. with two disk on raid1 (/dev/sda and /dev/sdb).

    Both disk have exactly the same parition tables,
    /dev/sdx1 EFI
    /dev/sdx2 swap
    /dev/sdx3 md0 / (root fs)
    /dev/sdx4 md1 /srv (server data as network folders, emails, etc)

    Due a mistake at install, the installer has formated and use both swaps (/dev/sda2 & /dev/sdb2). At this moment and for other reasons i need remove /dev/sdb disk (and replace for other more greater).
    So i do as allways do, comment out the line that mount swap on FSTAB file.

    Code:
    #UUID=fc78ffcc-da23-4e39-aa40-0039f5d4acfe swap swap defaults 0 0
    #UUID=6500c333-fadb-4ac6-a629-86641f11cfbf swap swap defaults 0 0
    
    /dev/sda2        swap swap defaults 0 0
    
    UUID=739e0500-ba15-4679-bee4-22817aeae2f6 / btrfs defaults 0 0
    UUID=739e0500-ba15-4679-bee4-22817aeae2f6 /boot/grub2/i386-pc btrfs subvol=@/boot/grub2/i386-pc 0 0
    UUID=739e0500-ba15-4679-bee4-22817aeae2f6 /boot/grub2/x86_64-efi btrfs subvol=@/boot/grub2/x86_64-efi 0 0
    UUID=739e0500-ba15-4679-bee4-22817aeae2f6 /home btrfs subvol=@/home 0 0
    UUID=739e0500-ba15-4679-bee4-22817aeae2f6 /opt btrfs subvol=@/opt 0 0
    #UUID=739e0500-ba15-4679-bee4-22817aeae2f6 /srv btrfs subvol=@/srv 0 0
    UUID=739e0500-ba15-4679-bee4-22817aeae2f6 /tmp btrfs subvol=@/tmp 0 0
    UUID=739e0500-ba15-4679-bee4-22817aeae2f6 /usr/local btrfs subvol=@/usr/local 0 0
    UUID=739e0500-ba15-4679-bee4-22817aeae2f6 /var/crash btrfs subvol=@/var/crash 0 0
    UUID=739e0500-ba15-4679-bee4-22817aeae2f6 /var/lib/libvirt/images btrfs subvol=@/var/lib/libvirt/images 0 0
    UUID=739e0500-ba15-4679-bee4-22817aeae2f6 /var/lib/mailman btrfs subvol=@/var/lib/mailman 0 0
    UUID=739e0500-ba15-4679-bee4-22817aeae2f6 /var/lib/mariadb btrfs subvol=@/var/lib/mariadb 0 0
    UUID=739e0500-ba15-4679-bee4-22817aeae2f6 /var/lib/mysql btrfs subvol=@/var/lib/mysql 0 0
    UUID=739e0500-ba15-4679-bee4-22817aeae2f6 /var/lib/named btrfs subvol=@/var/lib/named 0 0
    UUID=739e0500-ba15-4679-bee4-22817aeae2f6 /var/lib/pgsql btrfs subvol=@/var/lib/pgsql 0 0
    UUID=739e0500-ba15-4679-bee4-22817aeae2f6 /var/log btrfs subvol=@/var/log 0 0
    UUID=739e0500-ba15-4679-bee4-22817aeae2f6 /var/opt btrfs subvol=@/var/opt 0 0
    UUID=739e0500-ba15-4679-bee4-22817aeae2f6 /var/spool btrfs subvol=@/var/spool 0 0
    UUID=739e0500-ba15-4679-bee4-22817aeae2f6 /var/tmp btrfs subvol=@/var/tmp 0 0
    UUID=739e0500-ba15-4679-bee4-22817aeae2f6 /.snapshots btrfs subvol=@/.snapshots 0 0
    UUID=EC2F-39DA       /boot/efi            vfat       umask=0002,utf8=true  0 0
    /dev/md1        /srv    ext4    defaults 0 0
    But this does not work, the system never boot and freeze saying the following:
    Code:
    Starting Dracut Emergency shell.
    warning: /dev/disk/by-uuid/6500c333-fadb-4ac6-a629-86641f11cfbf does not exits 
    warning: boot has failed. to debug this issue add "rd.shell rd.debug" to the kernel.......
    FAILED failed to start dracut emergency shell
    see systemctl status dracut-emergency.service
    The curious is after boot the system only mount and work with /dev/sda2 swap.

    How i can remove /dev/sdb disk safely and fix the dracut?

  2. #2
    Join Date
    Jun 2008
    Location
    San Diego, Ca, USA
    Posts
    11,484
    Blog Entries
    2

    Default Re: howto remove swap (/dev/sdb2 ) from system boot

    AFAIK
    If sda is your primary disk in your RAID 1 disk mirror,
    You should be able to break your mirror and safely run only sda which would mean automatically using only the swap partition on sda (you wouldn't want to disable or remove that).

    If the swap on sda is only a typo and you really meant the swap on sdb, IMO breaking the mirror should take care of that automatically.

    TSU
    Beginner Wiki Quickstart - https://en.opensuse.org/User:Tsu2/Quickstart_Wiki
    Solved a problem recently? Create a wiki page for future personal reference!
    Learn something new?
    Attended a computing event?
    Post and Share!

  3. #3
    Join Date
    Aug 2010
    Location
    Chicago suburbs
    Posts
    12,890
    Blog Entries
    3

    Default Re: howto remove swap (/dev/sdb2 ) from system boot

    I have not used RAID, so I cannot comment on that aspect.

    In general, to make changes to swap, you would need to:
    • Modify "/etc/fstab"
    • Modify "/etc/default/grub" (particularly the "resume" option
    • rebuild the "initrd" (with "mkinitrd")
    • rebuild grub.cfg with "grub2-mkconfig -o /boot/grub2/grub.cfg".
    • Reboot
    openSUSE Leap 15.1; KDE Plasma 5;
    testing Leap 15.2Alpha

  4. #4

    Default Re: howto remove swap (/dev/sdb2 ) from system boot

    Quote Originally Posted by nrickert View Post
    I have not used RAID, so I cannot comment on that aspect.

    In general, to make changes to swap, you would need to:
    • Modify "/etc/fstab"
    • Modify "/etc/default/grub" (particularly the "resume" option
    • rebuild the "initrd" (with "mkinitrd")
    • rebuild grub.cfg with "grub2-mkconfig -o /boot/grub2/grub.cfg".
    • Reboot
    Excelent !!! thanks you.

    because the server never suspend (or hibernate) i can simply remove the "resume" option on /etc/default/grub ?

  5. #5
    Join Date
    Aug 2010
    Location
    Chicago suburbs
    Posts
    12,890
    Blog Entries
    3

    Default Re: howto remove swap (/dev/sdb2 ) from system boot

    Quote Originally Posted by schlabs View Post
    because the server never suspend (or hibernate) i can simply remove the "resume" option on /etc/default/grub ?
    Yes. Or replace it with "noresume".
    openSUSE Leap 15.1; KDE Plasma 5;
    testing Leap 15.2Alpha

  6. #6

    Default Re: howto remove swap (/dev/sdb2 ) from system boot

    Quote Originally Posted by nrickert View Post
    Yes. Or replace it with "noresume".
    Thanks you, its done and everything is working

  7. #7
    Join Date
    Aug 2010
    Location
    Chicago suburbs
    Posts
    12,890
    Blog Entries
    3

    Default Re: howto remove swap (/dev/sdb2 ) from system boot

    Quote Originally Posted by schlabs View Post
    Thanks you, its done and everything is working
    I'm glad to hear that.
    openSUSE Leap 15.1; KDE Plasma 5;
    testing Leap 15.2Alpha

  8. #8
    Join Date
    Jun 2008
    Location
    San Diego, Ca, USA
    Posts
    11,484
    Blog Entries
    2

    Default Re: howto remove swap (/dev/sdb2 ) from system boot

    @OP,

    I'm not entirely clear how you made your mistake.

    If you created your mirror volume as the whole disk (typically starting on sda), then everything on that disk should be mirrored to the other disk, including the swap partition if it is on the original disk.

    If you defined your mirror differently (eg just your boot, root and /home partitions), then that might be a different case.

    If the entire disk was mirrored, I'd <expect> that it would be normal for the swap partition you're trying to remove would also exist and perform normally as part of the mirror.

    There are benefits and drawbacks to configuring a mirrored swap.

    So, although you asked how to not mount the swap on your second disk, I wonder if that is actually what you want to do.

    TSU
    Beginner Wiki Quickstart - https://en.opensuse.org/User:Tsu2/Quickstart_Wiki
    Solved a problem recently? Create a wiki page for future personal reference!
    Learn something new?
    Attended a computing event?
    Post and Share!

  9. #9

    Default Re: howto remove swap (/dev/sdb2 ) from system boot

    Quote Originally Posted by tsu2 View Post
    @OP,

    I'm not entirely clear how you made your mistake.

    If you created your mirror volume as the whole disk (typically starting on sda), then everything on that disk should be mirrored to the other disk, including the swap partition if it is on the original disk.

    If you defined your mirror differently (eg just your boot, root and /home partitions), then that might be a different case.

    If the entire disk was mirrored, I'd <expect> that it would be normal for the swap partition you're trying to remove would also exist and perform normally as part of the mirror.

    There are benefits and drawbacks to configuring a mirrored swap.

    So, although you asked how to not mount the swap on your second disk, I wonder if that is actually what you want to do.

    TSU
    Hi, sorry for the late, but i think that is valuable my answer.
    This happen because the installer have several bugs specially partitioning.
    First and big bug is that does not allow overwrite a old installed linux. For example if you try to install after have a incident (DVD scratch, power fail during install, etc). When you want overwrite an failed install, you know that the data are wrong but the partition table are good only need to be formated, but the only way to re-start a failed install is erase all partitions booting on another live linux dvd or pendrive.

    Second bug: When the disk are clean the openSuse Installer suggest use UEFI BOOT. But if the disk are NOT clean UEFI boot are not possible and only option is srink the last partition and install on them.

    I dislike of this, because many times i reinstall /sda1 /sda2 /sda3 and keep the data untouched on /sda4

    Now the direct answer to your question. When i use the installer i create two same partitions.
    For example is the installer suggest /dev/sda2 start cylinder 63 and end on cylinder 2480 ( example numbers)
    i create /dev/sdb2 start cylinder 63 and end on cylinder 2480

    Obviously i copy both complete partitions in this mode sdx1,sdx2,sdx3,sdx4,sdx5, this include the data partitions and swaps partitions. Sadly the installer take for use as regular swap the partition on /dev/sdb when only must be used when /dev/sda fail.

    I hope that this was helpful to you. And thanks for all help.

  10. #10
    Join Date
    Aug 2010
    Location
    Chicago suburbs
    Posts
    12,890
    Blog Entries
    3

    Default Re: howto remove swap (/dev/sdb2 ) from system boot

    Quote Originally Posted by schlabs View Post
    First and big bug is that does not allow overwrite a old installed linux. For example if you try to install after have a incident (DVD scratch, power fail during install, etc). When you want overwrite an failed install, you know that the data are wrong but the partition table are good only need to be formated, but the only way to re-start a failed install is erase all partitions booting on another live linux dvd or pendrive.
    When you get to the partitioning section, click "Create partitioning"
    On the next screen, select "custom partitioning".

    You should see a list of current partitions. You can right-click on any partition, and select "edit" to change how it will be used. You might need to tell it to not mount swap partitions if you don't want to use them. And you will need to have at least a partition for "/", which should be set to be formatted and mounted. On a UEFI box, you will also need the EFI partition to be mounted at "/boot/efi".
    openSUSE Leap 15.1; KDE Plasma 5;
    testing Leap 15.2Alpha

Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •