# Disk swap issues in Rocky

**URL:** <https://forums.rockylinux.org/t/disk-swap-issues-in-rocky/14846>\
**Category:** Rocky Linux Help & Support\
**Tags:** rocky-linux-9\
**Created:** [June 28, 2024, 9:10am UTC](https://forums.rockylinux.org/t/disk-swap-issues-in-rocky/14846 "2024-06-28T09:10:29Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![jeevanal](https://avatars.discourse-cdn.com/v4/letter/j/258eb7/32.png) [@jeevanal](https://forums.rockylinux.org/u/jeevanal)\
**Post date:** [June 28, 2024, 9:10am UTC](https://forums.rockylinux.org/t/disk-swap-issues-in-rocky/14846/1 "2024-06-28T09:10:29Z")

</div>

We are seeing disk swapping when adding disks in Rocky. We have not faced this issue in Centos. We have provisioned lot of VMs out of ISO Rocky and made a template out of it. Whenever we add a new additional disk from vcenter to the VM out of template, swap is happening and sometimes not. Swap also happens when the servers are rebooted. How to avoid disk swapping which impacts application.

Example: sda becomes sdb and sdb becomes sdd

---

<div class="post-metadata">

**Author:** ![iwalker](https://sea2.discourse-cdn.com/flex020/user_avatar/forums.rockylinux.org/iwalker/32/2599_2.png) [@iwalker](https://forums.rockylinux.org/u/iwalker)\
**Post date:** [June 28, 2024, 9:25am UTC](https://forums.rockylinux.org/t/disk-swap-issues-in-rocky/14846/2 "2024-06-28T09:25:05Z")

</div>

You should be mounting and using disk partitions via their UUID. Use `blkid` from the console. This is how it works nowawdays, not just on Rocky.

For example on mine:

```auto
[root@rocky9 ~]# blkid
/dev/sda2: UUID="38479e8a-9cfd-4445-a8a4-ee04ae9448da" TYPE="xfs" PARTUUID="60e9665a-4f69-4420-8c11-e208498d1475"
/dev/sda1: UUID="94DB-E59E" TYPE="vfat" PARTLABEL="EFI System Partition" PARTUUID="75cf07c3-00f4-43f8-9b69-84d3452a1983"

```

and fstab:

```auto
UUID=38479e8a-9cfd-4445-a8a4-ee04ae9448da / xfs noatime,defaults 0 0
UUID=94DB-E59E /boot/efi vfat umask=0077,shortname=winnt 0 2

```

you do not mount using ```/dev/sdX`` now, since mounting via UUID means that even if disk ordering changes, the system will always boot.

---

<div class="post-metadata">

**Author:** ![jeevanal](https://avatars.discourse-cdn.com/v4/letter/j/258eb7/32.png) [@jeevanal](https://forums.rockylinux.org/u/jeevanal)\
**Post date:** [June 28, 2024, 9:49am UTC](https://forums.rockylinux.org/t/disk-swap-issues-in-rocky/14846/3 "2024-06-28T09:49:59Z")

</div>

We are already using UUID to mount the file systems and seeing these issues.

Disk udev rules seems not setting properly by default.

---

<div class="post-metadata">

**Author:** ![iwalker](https://sea2.discourse-cdn.com/flex020/user_avatar/forums.rockylinux.org/iwalker/32/2599_2.png) [@iwalker](https://forums.rockylinux.org/u/iwalker)\
**Post date:** [June 28, 2024, 10:33am UTC](https://forums.rockylinux.org/t/disk-swap-issues-in-rocky/14846/4 "2024-06-28T10:33:08Z")

</div>

> [@jeevanal](#):
>
> We are already using UUID to mount the file systems and seeing these issues.

Not possible, you must be using references to sda or sdb somewhere if something is not mounting, or eg if swap is not available because of it. UUID’s do not cause problems, I have taken a disk out of one laptop and placed it in another and the disks sda/sdb changed places and the system still booted because it wasn’t using references to sda or sdb to mount something.

The problem you are experiencing can only happen when using /dev/sda or /dev/sdb or whatever.

If the systems mount everything successfully, and the disk changes position and you are seeing this, at this point it’s purely cosmetic since everything mounted. You won’t be able to do anything about that you will not be able to control what is sda and what is sdb. Better concentrate on mounting partitions.

Post your `/etc/fstab` so we can see the full content, and also post the content of `/boot/grub2/grub.cfg` since either of these are most likely referencing sda or sdb or whatever. Also post the content of `/etc/default/grub`.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex020/uploads/rockylinux/original/1X/91b7219eec10e30013422e4df76c1d898711a5d5.svg) [@system](https://forums.rockylinux.org/u/system)\
**Post date:** [August 27, 2024, 10:33am UTC](https://forums.rockylinux.org/t/disk-swap-issues-in-rocky/14846/5 "2024-08-27T10:33:52Z")

</div>

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