OT: How do I Automount an Hard dRive in my Computer in Ubuntu?

Tom H tomh0665 at gmail.com
Sun Nov 29 19:46:22 UTC 2015


On Sun, Nov 29, 2015 at 4:53 PM, Ralf Mardorf <silver.bullet at zoho.com> wrote:
> On Sun, 29 Nov 2015 13:21:43 +0200, Tom H wrote:
>> On Sun, Nov 29, 2015 at 8:17 AM, Ralf Mardorf <silver.bullet at zoho.com>
>> wrote:


>>> - If you want to mount devices at startup use fstab, do not use
>>> desktop environment related apps.
>>
>> If you're using systemd as pid 1, you can create a mount unit.
>>
>> An example from a test VM:
>>
>> [Unit]
>> Before=local-fs.target
>>
>> [Mount]
>> What=/dev/disk/by-uuid/f72ce78b-216e-4cfc-ae49-8afc8d6160f2
>> Where=/opt
>> Type=ext4
>> Options=relatime
>
> Interesting :), but not helpful for the OP and other newbies.

My email was a response to your claiming that fstab was the way to
mount filesystems at boot.

Editing "/etc/fstab" is just as easy/difficult to do as creating a mount unit.

I targeted my email at newbies and non-newbies alike. This is
ubuntu-users@ not ubuntu-newbies@ or ubuntu-non-newbies at .


> systemd isn't part of all Ubuntu releases, while fstab is part of quasi
> all UNIXlike systems.

I started my email with "If you're using systemd as pid 1".


> Remember the original request is:
>
> I have a second HDD in my computer that I want to automount when I
> start the system. How do I accomplish this in Ubuntu?

So if the OP's using systemd, he can use a systemd mount unit.


> The universal and only correct reply is to use fstab. It doesn't matter
> what release of Ubuntu is used, it's easy to understand, at least with
> help from the mailing list and beyond that basic knowledge you should
> learn, when using Ubuntu or any other distro.

Not really. Most distros have defaulted to systemd as pid 1 so systemd
howtos are relevant and useful to many.

I'm currently running Debian Sid with systemd purged on my laptop but
until 15.10 was released, I was using the 15.10 devel/beta with
systemd as pid 1 and my "/etc/fstab" was empty. "/", "/boot", "swap"
were auto-mounted by systemd, based on their gpt properties, and
"/home" was mounted by a systemd mount unit.




More information about the ubuntu-users mailing list