Results 1 to 4 of 4

Thread: 19.10 How to add a second and third hard drive so that GNOME apps can save to them

  1. #1
    Join Date
    Dec 2019

    Question 19.10 How to add a second and third hard drive so that GNOME apps can save to them

    Dear Friends,

    I am somewhat new to Ubuntu but have choosing the OS powering my HTPC and having problems encoding my blu-ray's to hard drive to play with Kodi. Please note that I own all the media I am using here!

    The OS runs off a modest SSD while my .mkv files for Kodi run on an 8TB conventional disk. I updated to 19.10 and now I
    can't navigate to the 8TB disc from the makemkv to write files. I have tried various mount points and permissions levels and makemkv just browse to the drive. Some GNOME apps can navigate to the drive just fine but makemkv and VLCplayer can not, I get permissions errors.

    Of course, this is problem as my SSD really doesn’t have room for the output files especially from higher density blur ray's in my collection.

    The upshot it this:

    I want to find a way to add more hard drives and have them mounted by all users at start-up and be writable by GNOME apps.

    I can provide more information if would help. Thanks!

  2. #2
    Join Date
    Apr 2011
    Mystletainn Kick!

    Re: 19.10 How to add a second and third hard drive so that GNOME apps can save to the

    Did you install these (makemkv and vlc) through Ubuntu Software?
    Might be snap packages which have restricted access by default.
    Should be able to set them with snap connect commands.
    for reference on snap interface management.
    Splat Double Splat Triple Splat
    Earn Your Keep
    Don't mind me, I'm only passing through.
    Once in a blue moon, I'm actually helpful

  3. #3
    Join Date
    Mar 2010
    Ubuntu Mate 16.04 Xenial Xerus

    Re: 19.10 How to add a second and third hard drive so that GNOME apps can save to the

    In 19.10, Canonical has decided that we don't need to access any storage areas for data outside our HOME directories. This is enforced by using snap packages. vlc was one of the first snaps that I'm aware which had this problem. I don't use 19.10, but think the normal debian package is available which will have access to read and write anywhere normal file permissions allow.

    First, need to determine if one or both of these programs is installed as a snap. Use snap list to check that. If they are, there isn't any known way for them to access storage outside the HOME directory of the userid currently used. If we call it a "bug", the snap people don't like it. They call it a security feature.

    To install vlc using APT, the package management system Ubuntu has used since the beginning, use sudo apt install vlc. If that works, you can remove safely the snap version.

    Gnome applications have been early adopters of snap packages. They will all have the HOME directory limitation for file access, unfortunately. You can try to find the APT/debian package versions, but Canonical, in their infinite wisdom, has replaced many APT packages with versions that install the snap packages instead.

    Ok, as for mounting storage, that is handled via the /etc/fstab file. Also, the storage needs to be formatted with a native Linux file system for a number of reasons. Most will be shipped with NTFS which doesn't support Linux permissions and will have less performance. There are a number of different ways to accomplish the formatting. If you understand Linux device names, then using sudo mkfs -t ext4 /dev/sdZX is the fastest. You'll need to know the ZX part of the device name. It can change every boot. There are considerations with using an 8TB disk completely as 1 partition. How do you backup this storage? I use 8TB disks, which I split in half to be (2) 4TB partitions because my backup storage can easily handle 4TB partitions, but not 8TB partitions. Even with the original optical discs, recreating all that data will be weeks of effort.

    Next, mounting the partition requires modifying the /etc/fstab. You will add a new line at the bottom of the file that will look something like this:
    UUID=f6e18a3e-fb42-22aaa-11aa-4ec2f26b6666     /D1    ext4    errors=remount-ro,nofail     0    1
    Let's break that down by field. The number of spaces between each part doesn't matter, provided there is 1 or more.

    The UUID is a unique identifier for a partition. Run blkid command to see it for all the storage connected to the machine. Definitely, copy+paste it into the file.

    /D1 is where is called a "mount point". This is an empty directory that must exist before the mount will work. sudo mkdir /D1 will create it. I'm assuming you'll be adding more storage, which will become /D2, /D3, ... etc. Plan ahead.

    ext4 is the file system type.

    The next items are the mount options which cannot have any whitespace in the group.

    The meaning for the last two fields isn't too important, just use the numbers I've shown.

    If any of these fields are incorrect, it won't mount.

    Use sudoedit /etc/fstab inside a terminal to edit the file. Use another terminal to get the UUID with the blkid command.

    Save the file and run sudo mount -a. This will mount the storage and you can cd /D1 to access it. If this fails, read the error message carefully. DO NOT REBOOT. It needs to be correct.

    If it does mount, 1 more thing is left before you start filling it. If this will be storage for a media player, most will be run using a specific userid that is NOT your login username. If you use plex, you will want to make these modifications:
    # make the own of the media your login userid.
    sudo chown $LOGNAME /D1 
    # add your userid to the "plex" group.
    sudo usermod  $LOGNAME -G plex
    # force all the new directories and files under /D1 to use the plex group.
    chgrp -R plex /D1
    chmod -R g+s /D1
    That should do it. Plex Media server should already be installed so the plex groupid exists. If you are using some other media server, change all references to "plex" to the groupid that media server uses above. The goal is to allow your userid and the media server group id to work together on the same files - modifying them, deleting them. If you don't want plex to be able to modify or delete any files under this new disk, just have read access, then you can ignore all the plex commands above, but you will want to do the first chown. Otherwise, the storage will be owned by root and nobody will be allowed to write anything there.

    Media servers tend to want Movies, TV, Music, Photos in different directories, so those would be the first directories I created under /D1.
    cd /D1
    mkdir Movies  TV  Music  Photos
    That's it. Hope it is clear enough. People tend to be stuck on the /dev/sdYX stuff and blkid stuff. Ask if you get stuck.

    If this disk is external, I'd use some other mount options or autofs, since USB storage isn't always available. There is a new method using systemd which might work. I haven't tried it.

    1 last issue. Setting up a media server on 19.10 isn't the best idea. Support for 19.10 has 7 months remaining. Media servers usually become very important in a household, so OS upgrades are very disruptive, especially if there are problems. 18.04 is the current LTS release which has support until April 2023, 5 yrs. That's a longer time for much fewer hassles with media playback. In 18.04, the use of snaps is much more optional, not as mandatory as it is with 19.10 and later. That is an important consideration for many.

    The commands with the chown, chgrp, chmod commands are 1-time per disk added. The usermod command is 1-time.
    Last edited by TheFu; December 10th, 2019 at 11:27 PM.

  4. #4
    Join Date
    Dec 2019

    Re: 19.10 How to add a second and third hard drive so that GNOME apps can save to the

    deadflowr and TheFu you were both right and I got it fixed... turns out I has installed makemkv and VLC from the Snappy package. I have installed the applications different way and now it works great! The moral of the story is that Snappy isn't the best for this use case.

    TheFu thanks for the detailed explanation. I appreciate it! My drives where set up more or less as you outlined, it turns out it was snappy. I also appreciate the insight on Ubuntu 18.04. I think I'm going to move to that after the xmas madness.

    Thanks for your help!

Tags for this Thread


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts