How to boots system fast without the device in /etc/fstab?

HuyGrogDev

New Member
Joined
Apr 20, 2022
Messages
6
Reaction score
4
Credits
48
_ Currently, i used the external hard drive for my daily work. I add the UUID of device inside /etc/fstab to make it auto mount when my system boots up. The problem here is everytime i plug it in and start boot my system, my system come up very fast, but if i not plug the hard drive which declare in /etc/fstab, it boots very slowly, i used format ext4 for my external hard drive.
 


kc1di

Well-Known Member
Joined
May 14, 2021
Messages
1,436
Reaction score
1,236
Credits
10,308
Hello and Welcome to the Forum.
Problem is when the HD is entered into /etc/fstab your system hunts for the HD on boot and if it can not find it it take time before the request times out. You did not say which Distro your using but if it's a systemd system you can issue the following command in a terminal and see just how much time it's taking.
Code:
systemd-analyze blame
 
OP
H

HuyGrogDev

New Member
Joined
Apr 20, 2022
Messages
6
Reaction score
4
Credits
48
Hello guys, thanks for your help. But after test plug it in, type in command and plug it out, type in command, nothings difference between two output.
 

dancaer69

New Member
Joined
Mar 10, 2020
Messages
14
Reaction score
6
Credits
109
Did you boot with disk plugged in, run the command, then reboot with plugged out and re-run the command? Anyway you can try to use "x-systemd.automount" option in fstab for that disk. I think that wiith this option the disk will mount automatic when you use it, so it will not mount at boot and delay the boot process if the disk isn't plugged.
 
OP
H

HuyGrogDev

New Member
Joined
Apr 20, 2022
Messages
6
Reaction score
4
Credits
48
Did you boot with disk plugged in, run the command, then reboot with plugged out and re-run the command? Anyway you can try to use "x-systemd.automount" option in fstab for that disk. I think that wiith this option the disk will mount automatic when you use it, so it will not mount at boot and delay the boot process if the disk isn't plugged.
That's it. How to decrease the boot process when the disk isn't plugged. Why i ask this question? Because sometime, i forgot to bring my external hard drive, and have to wait it boot. For me, it's the panic :(
 

Tolkem

Well-Known Member
Joined
Jan 6, 2019
Messages
1,484
Reaction score
1,210
Credits
10,801
That's it. How to decrease the boot process when the disk isn't plugged. Why i ask this question? Because sometime, i forgot to bring my external hard drive, and have to wait it boot. For me, it's the panic :(
Delete/comment the entry in /etc/fstab. Reboot. Now your system should boot faster. If you want your USB/external disk to be mounted automatically on login, there are a few ways to do this. First, answer these questions:
1. What distro are you using?
2. What Desktop environment? XFCE? KDE? Gnome?
 
OP
H

HuyGrogDev

New Member
Joined
Apr 20, 2022
Messages
6
Reaction score
4
Credits
48
Delete/comment the entry in /etc/fstab. Reboot. Now your system should boot faster. If you want your USB/external disk to be mounted automatically on login, there are a few ways to do this. First, answer these questions:
1. What distro are you using?
2. What Desktop environment? XFCE? KDE? Gnome?
1. I'm using linux mint
2. Desktop env: X-Cinamon
 

Tolkem

Well-Known Member
Joined
Jan 6, 2019
Messages
1,484
Reaction score
1,210
Credits
10,801
A couple of questions:
1. What Linux Mint version are you using?
2. Can you show the contents of /etc/fstab? Just launch a terminal and run
Code:
cat /etc/fstab
and copy/paste the output here, please.
 
OP
H

HuyGrogDev

New Member
Joined
Apr 20, 2022
Messages
6
Reaction score
4
Credits
48
A couple of questions:
1. What Linux Mint version are you using?
2. Can you show the contents of /etc/fstab? Just launch a terminal and run
Code:
cat /etc/fstab
and copy/paste the output here, please.

1. Description: Linux Mint 20.3
Release: 20.3
Codename: una
2.
# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point> <type> <options> <dump> <pass>
# / was on /dev/nvme0n1p2 during installation
UUID=6cb14398-864d-409b-9cc7-11c9025beb79 / ext4 errors=remount-ro 0 1
# /boot/efi was on /dev/nvme0n1p1 during installation
UUID=A409-646B /boot/efi vfat umask=0077 0 1
/swapfile none swap sw 0 0
# /data drive usb
UUID=0f83ef91-d750-4c99-a2a9-bbd84f9e2dcd /home/huygrogbro/usbdrive ext4 defaults 0 0
UUID=78740016-b4ec-46b5-99b8-5b8ac8f32051 /media/harddrive ext4 defaults 0 0
 

Tolkem

Well-Known Member
Joined
Jan 6, 2019
Messages
1,484
Reaction score
1,210
Credits
10,801
# /data drive usb
UUID=0f83ef91-d750-4c99-a2a9-bbd84f9e2dcd /home/huygrogbro/usbdrive ext4 defaults 0 0
UUID=78740016-b4ec-46b5-99b8-5b8ac8f32051 /media/harddrive ext4 defaults 0 0
Thanks for the details. Which one is the external drive you want to be mounted at login?
EDIT: I found this:
https://forum.endeavouros.com/t/root-mounting-any-device-using-systemd-mount-and-automount/7696
Read the whole thing. I think this will help you accomplish what you want to do. Otherwise, KDE Plasma has an option to do just this, I use it and works like a charm; the FSs/devices are mounted on login without affecting boot time :)
 
Last edited:
OP
H

HuyGrogDev

New Member
Joined
Apr 20, 2022
Messages
6
Reaction score
4
Credits
48
Thanks for the details. Which one is the external drive you want to be mounted at login?
EDIT: I found this:
https://forum.endeavouros.com/t/root-mounting-any-device-using-systemd-mount-and-automount/7696
Read the whole thing. I think this will help you accomplish what you want to do. Otherwise, KDE Plasma has an option to do just this, I use it and works like a charm; the FSs/devices are mounted on login without affecting boot time :)
Thanks for your help, it works like a charm.
 

Tolkem

Well-Known Member
Joined
Jan 6, 2019
Messages
1,484
Reaction score
1,210
Credits
10,801
$100 Digital Ocean Credit
Get a free VM to test out Linux!


Members online


Top