0

So, I've got the latest version of Ubuntu server, Ubuntu 20.04.1 LTS (GNU/Linux 5.4.0-47-generic x86_64), installed and running off a ssd.

I've already added the hard drive and managed it with Cockpit but I'm wondering whether I've set it up correctly. Especially the mount point. I've also seen the it change from sdd to sdc after a restart, is this normal?

This is what i've currently got: fdisk -l

Disk /dev/sdc: 3.65 TiB, 4000787030016 bytes, 7814037168 sectors
Disk model: WDC WD40EZRX-00S
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: gpt
Disk identifier: B315D095-3B0E-4CB7-A202-E1F14FCA1690
Device     Start        End    Sectors  Size Type
/dev/sdc1   2048 7814035455 7814033408  3.7T Linux filesystem

Thanks

  • Can you grep sdc1 /etc/fstab and findmnt -mn | grep sdc – Frobozz Sep 17 '20 at 21:32
  • /Media /dev/sdc1 ext4 rw,relatime – p4CK4dzDZVjSjoukQrRl Sep 17 '20 at 21:42
0
  1. Your mount point is determined by a location that your mediaserver application can access on the filesystem.

    This is important in locked-down systems like Ubuntu Core, which can only access /home and /media. On ordinary Ubuntu Server, it's a matter of preference ( I like to use /var/media_disk ) . If you use a clever mount point, remember to fix the ownership so you and your mediaserver application can access it.

  2. Use the command sudo blkid to find the UUID of your media partition(s).

  3. Put the mount point and the UUID together in /etc/fstab

    # /etc/fstab: static file system information.
    # <file system> <mount point>   <type>  <options>       <dump>  <pass>
    UUID=aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee /                     ext4    errors=remount-ro 0       1
    UUID=bbbbbbbb-cccc-dddd-eeee-ffffffffffff /var/movies_partition ext4    noauto,errors=remount-ro 2       2
    
    • Note that mounting lots of partitions may slow your boot (especially in fsck season). I start my mediaserver disks slightly later using a systemd twiddle, hence the 'noauto'.
  • Hmm, should i do this for the ssd? I've noticed that it also has changed. – p4CK4dzDZVjSjoukQrRl Sep 17 '20 at 21:58
  • The installer should have done that for you already. Look at /etc/fstab to see. – user535733 Sep 17 '20 at 22:12
  • Does the following look right? /dev/disk/by-id/dm-uuid-LVM-wIybP2d9F9O0n9Hp6KIX2eOptcS0CexLNe2QGH3DvUQZZVfmIgXuzcNWfPNx5h83 / ext4 defaults 0 0 # /boot was on /dev/sda2 during curtin installation /dev/disk/by-uuid/b5a7022b-356a-436d-900d-bbe86daea791 /boot ext4 defaults 0 0 /swap.img none swap sw 0 0 UUID=5a125848-414a-4513-9912-cb55fa1c6e69 /sdd auto defaults 0 0 – p4CK4dzDZVjSjoukQrRl Sep 17 '20 at 22:28
  • Hard to read all that random unformatted text -- avoid asking question in comments. However, since it needs to be correct for your system to boot...and your system boots...well, the rest is obvious. FYI: Your original Question should have mentioned LVM. – user535733 Sep 17 '20 at 22:44
  • Thanks for the help. Reading about lvm and it's not something i want. Don't even know how it came to be... – p4CK4dzDZVjSjoukQrRl Sep 17 '20 at 23:06
0

Updated

Yes. Disk device IDs (sda,sdb,etc) can change. These designations are assigned at boot time by when the device is discovered. This is why it is important to mount volumes using their unique identifier or UUID. The UUID is easy to find:

ls -l /dev/disk/by-uuid or lsblk -o MOUNTPOINT,NAME,UUID

Add an entry to /etc/fstab to have your volume mounted automatically at boot time using this UUID Example:

UUID=03361cf5-83bf-40f9-b3aa-f172c4cec12f /var/multimedia ext4 rw,relatime 0 1

Once in /etc/fstab, your volume will mount automatically at boot time. Or you can mount manually by:

sudo mount /var/multimedia

Once mounted, you will need to ensure users have appropriate access and permissions on the volume. The "chown" and "chmod" commands are used for this. Typical "full" access would be accomplished by:

sudo chown myuser:myuser /var/foldername
sudo chmod 774 /var/foldername

Test your access by creating a file in the folder:

touch /var/foldername/testfile

If you are using this volume for a particular application that has a dedicated user account or group, refer to your applications documentation for the appropriate settings.

  • How would i do this? lrwxrwxrwx 1 root root 10 Sep 17 07:35 03361cf5-83bf-40f9-b3aa-f172c4cec12f -> ../../sdc1 – p4CK4dzDZVjSjoukQrRl Sep 17 '20 at 21:43
  • UUID=03361cf5-83bf-40f9-b3aa-f172c4cec12f /var/multimedia auto defaults 0 0 Does this look ok? – p4CK4dzDZVjSjoukQrRl Sep 17 '20 at 22:23
  • If the UUID is correct. That should mount. See Update – Frobozz Sep 19 '20 at 15:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.