# Stop automounting second hard disk during boot before /etc/fstab is read

**URL:** <https://forums.rockylinux.org/t/stop-automounting-second-hard-disk-during-boot-before-etc-fstab-is-read/17400>\
**Category:** Rocky Linux Help & Support\
**Created:** [February 2, 2025, 8:11pm UTC](https://forums.rockylinux.org/t/stop-automounting-second-hard-disk-during-boot-before-etc-fstab-is-read/17400 "2025-02-02T20:11:23Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![lhouk](https://avatars.discourse-cdn.com/v4/letter/l/c89c15/32.png) [@lhouk](https://forums.rockylinux.org/u/lhouk)\
**Post date:** [February 2, 2025, 8:11pm UTC](https://forums.rockylinux.org/t/stop-automounting-second-hard-disk-during-boot-before-etc-fstab-is-read/17400/1 "2025-02-02T20:11:23Z")

</div>

I have a computer named nexus with two hard drives, /dev/sdb0 and /dev/sdb1. My /etc/fstab is:

```auto
#
# /etc/fstab
# Created by anaconda on Sat Sep 30 15:29:58 2023
#
# Accessible filesystems, by reference, are maintained under '/dev/disk/'.
# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info.
#
# After editing this file, run 'systemctl daemon-reload' to update systemd
# units generated from this file.
#
/dev/mapper/rl-root / xfs defaults 0 0
UUID=2db34dbb-e0ee-41dd-9e8f-06aacb27ea08 /boot xfs defaults 0 0
/dev/mapper/rl-home /home xfs defaults 0 0
/dev/mapper/rl-swap none swap defaults 0 0
/dev/sdb1 /disk2	ext4	defaults	1 2

```

The last line mounts my second disk as /disk2, and usually this works fine. However, every third or fourth time I boot, it fails because the system has already mounted /dev/sdb1 as /boot. The relevant /var/log/messages entries from the last time this happened are:

```auto
Feb 2 13:39:03 nexus systemd[1]: Reached target Preparation for Local File Systems.
Feb 2 13:39:03 nexus systemd[1]: Mounting /boot...
Feb 2 13:39:03 nexus systemd[1]: Mounting /home...
Feb 2 13:39:03 nexus systemd[1]: Starting File System Check on /dev/sdb1...
Feb 2 13:39:03 nexus kernel: XFS (dm-2): Mounting V5 Filesystem 3bededc8-ba90-4f2d-9458-80d4ca32fa9b
Feb 2 13:39:03 nexus kernel: XFS (sdb1): Mounting V5 Filesystem 2db34dbb-e0ee-41dd-9e8f-06aacb27ea08
Feb 2 13:39:04 nexus kernel: XFS (dm-2): Ending clean mount
Feb 2 13:39:04 nexus systemd[1]: Mounted /home.
Feb 2 13:39:04 nexus kernel: XFS (sdb1): Ending clean mount
Feb 2 13:39:04 nexus systemd[1]: Mounted /boot.
Feb 2 13:39:04 nexus systemd-fsck[833]: /dev/sdb1 is mounted.
Feb 2 13:39:04 nexus systemd-fsck[833]: e2fsck: Cannot continue, aborting.
Feb 2 13:39:04 nexus systemd-fsck[815]: fsck failed with exit status 8.
Feb 2 13:39:04 nexus systemd-fsck[815]: Ignoring error.
Feb 2 13:39:04 nexus systemd[1]: Finished File System Check on /dev/sdb1.
Feb 2 13:39:04 nexus systemd[1]: Mounting /disk2...
Feb 2 13:39:04 nexus kernel: /dev/sdb1: Can't open blockdev
Feb 2 13:39:04 nexus mount[834]: mount: /disk2: /dev/sdb1 already mounted on /boot.
Feb 2 13:39:04 nexus systemd[1]: disk2.mount: Mount process exited, code=exited, status=32/n/a
Feb 2 13:39:04 nexus systemd[1]: disk2.mount: Failed with result 'exit-code'.
Feb 2 13:39:04 nexus systemd[1]: Failed to mount /disk2.
Feb 2 13:39:04 nexus systemd[1]: Dependency failed for Local File Systems.
Feb 2 13:39:04 nexus systemd[1]: Dependency failed for Mark the need to relabel after reboot.
Feb 2 13:39:04 nexus systemd[1]: selinux-autorelabel-mark.service: Job selinux-autorelabel-mark.service/start failed with result 'dependency'.
Feb 2 13:39:04 nexus systemd[1]: local-fs.target: Job local-fs.target/start failed with result 'dependency'.

```

Does anyone know why this happens, and what I can do to prevent from occurring in the future? I’m running Rocky Linux release 9.5 (Blue Onyx). Thanks to all who respond.

---

<div class="post-metadata">

**Author:** ![label](https://avatars.discourse-cdn.com/v4/letter/l/c5a1d2/32.png) [@label](https://forums.rockylinux.org/u/label)\
**Post date:** [February 2, 2025, 8:28pm UTC](https://forums.rockylinux.org/t/stop-automounting-second-hard-disk-during-boot-before-etc-fstab-is-read/17400/2 "2025-02-02T20:28:52Z")

</div>

Try using a UUID instead of the block path. You can get the UUID by running blkid and replacing `/dev/sdb1` with `UUID="value"` in /etc/fstab.

---

<div class="post-metadata">

**Author:** ![linuxlover](https://sea2.discourse-cdn.com/flex020/user_avatar/forums.rockylinux.org/linuxlover/32/2227_2.png) [@linuxlover](https://forums.rockylinux.org/u/linuxlover)\
**Post date:** [February 3, 2025, 4:45am UTC](https://forums.rockylinux.org/t/stop-automounting-second-hard-disk-during-boot-before-etc-fstab-is-read/17400/3 "2025-02-03T04:45:13Z")

</div>

Hi,  
Dont use device name ( like /dev/sdb1 etc ) for mounting devices in fstab. Now Linux kernel have tendency to assign the device names which are not persistant across reboot.

Always mount devices by

1. Use UUID of device  
2 - Or can assign and use LABEL  
3- in case of LVM , can use LVM device name ( like /dev/DATA/DISK1 etc )

---

<div class="post-metadata">

**Author:** ![jlehtone](https://avatars.discourse-cdn.com/v4/letter/j/e9a140/32.png) [@jlehtone](https://forums.rockylinux.org/u/jlehtone)\
**Post date:** [February 3, 2025, 3:36pm UTC](https://forums.rockylinux.org/t/stop-automounting-second-hard-disk-during-boot-before-etc-fstab-is-read/17400/4 "2025-02-03T15:36:06Z")

</div>

> [@lhouk](#):
>
> two hard drives, /dev/sdb0 and /dev/sdb1

The way system names things, `/dev/sdb` is _one_ hard drive and the `/dev/sdb0` and `/dev/sdb1` are _partitions_ on that drive. If there were two drives, they would be `/dev/sda` and `/dev/sdb` and the `/dev/sdb1` would be the name for partition that holds either the `/boot` or the `/disk2’.

You can see all drives/partitions/volumes with:

```auto
lsblk

```

and also their filesystem type, LABEL, and UUID with:

```auto
lsblk -f

```

I’d look the UUID from that and update the /etc/fstab.

* * *

PS. On terminology, there have been many implementations of “_automounter_”. The two available in Rocky are SystemD’s automounter and separate _autofs_ service. Both “automount”, which with them means that the “drive” is not mounted by default – not on boot. Rather, these services watch whether any process tries to access something from the mount point. In your example in or under `/disk2`. Only on access the mount is actually done (if possible), and it can also automatically umount if nothing does access the filesystem for a while.

It is possible to add `noauto` option to fstab entry to prevent it from being mounted during boot. Then one could manually mount (e.g. `mount /disk2`) or use the automounters. None of these naturally help with the non-predictable/persistent name ‘/dev/sdb1’.

---

<div class="post-metadata">

**Author:** ![lhouk](https://avatars.discourse-cdn.com/v4/letter/l/c89c15/32.png) [@lhouk](https://forums.rockylinux.org/u/lhouk)\
**Post date:** [February 4, 2025, 3:41pm UTC](https://forums.rockylinux.org/t/stop-automounting-second-hard-disk-during-boot-before-etc-fstab-is-read/17400/5 "2025-02-04T15:41:37Z")

</div>

Thank you nazunalika, linuxlover, and jlehtone for your helpful and informative responses. I changed my /etc/fstab file to use the second drive’s UUID, and when I rebooted, my system came up correctly.

---

<div class="post-metadata">

**Author:** ![Hedges](https://avatars.discourse-cdn.com/v4/letter/h/58f4c7/32.png) [@Hedges](https://forums.rockylinux.org/u/Hedges)\
**Post date:** [February 5, 2025, 8:18pm UTC](https://forums.rockylinux.org/t/stop-automounting-second-hard-disk-during-boot-before-etc-fstab-is-read/17400/6 "2025-02-05T20:18:10Z")

</div>

This line is really strange, as it looks like your file system on /dev/sdb1 has the same UUID as the file system on /boot.  
Can you check if for some reason both file systems have the same UUID or if this is an internal error in the software assigning the wrong UUID to /dev/sdb1?

> [@lhouk](#):
>
> `Feb 2 13:39:03 nexus kernel: XFS (sdb1): Mounting V5 Filesystem 2db34dbb-e0ee-41dd-9e8f-06aacb27ea08`

---

<div class="post-metadata">

**Author:** ![jlehtone](https://avatars.discourse-cdn.com/v4/letter/j/e9a140/32.png) [@jlehtone](https://forums.rockylinux.org/u/jlehtone)\
**Post date:** [February 6, 2025, 2:10pm UTC](https://forums.rockylinux.org/t/stop-automounting-second-hard-disk-during-boot-before-etc-fstab-is-read/17400/7 "2025-02-06T14:10:12Z")

</div>

> [@Hedges](#):
>
> This line is really strange, as it looks like your file system on /dev/sdb1 has the same UUID as the file system on /boot.

Not really. It was already explained that the /dev/sd_X_ names are generated randomly.  
Therefore, on some boot the /dev/sdb1 can refer to the filesystem that “has /boot” (and hence both show the same UUID), and on some to the other filesystem.

You are right though that same UUID on multiple filesystems is possible and usually a problem.[1]  
As @lhouk did already imply, that does not seem to be an issue here.

[1] RAID 1 and multipathing typically have that, but there it is not an issue as it is intentional (and handled by said setups).

---

<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:** [April 7, 2025, 2:10pm UTC](https://forums.rockylinux.org/t/stop-automounting-second-hard-disk-during-boot-before-etc-fstab-is-read/17400/8 "2025-04-07T14:10:36Z")

</div>

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