Ext Harddrive Filepath/Create Directory

Quick to answer questions about finding your way around Linux Mint as a new user.
Forum rules
There are no such things as "stupid" questions. However if you think your question is a bit stupid, then this is the right place for you to post it. Stick to easy to-the-point questions that you feel people can answer fast. For long and complicated questions use the other forums in the support section.
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
LPredmore
Level 1
Level 1
Posts: 8
Joined: Sun Apr 18, 2021 7:20 am

Ext Harddrive Filepath/Create Directory

Post by LPredmore »

So I'm trying to connect an external hard drive to a media server program but it's saying that the file path doesn't exist when looking in the app. When I go into the properties folder, It appears to be located in media/administraton. But that option shows nothing when going through the apps file search. I created a directory, but can't figure out how to mount it. It also appears that it is already mounted. I'm trying to figure this out with google searching, but it's making me more confused.

Disk /dev/sdb: 3.65 TiB, 4000752599040 bytes, 976746240 sectors
Disk model: My Book 1230
Units: sectors of 1 * 4096 = 4096 bytes
Sector size (logical/physical): 4096 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: dos
Disk identifier: 0xdb4bf07b
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
User avatar
spamegg
Level 14
Level 14
Posts: 5101
Joined: Mon Oct 28, 2019 2:34 am
Contact:

Re: Ext Harddrive Filepath/Create Directory

Post by spamegg »

Can you show us the output of

Code: Select all

cat /etc/fstab
User avatar
zcot
Level 9
Level 9
Posts: 2838
Joined: Wed Oct 19, 2016 6:08 pm

Re: Ext Harddrive Filepath/Create Directory

Post by zcot »

What media server program?
LPredmore
Level 1
Level 1
Posts: 8
Joined: Sun Apr 18, 2021 7:20 am

Re: Ext Harddrive Filepath/Create Directory

Post by LPredmore »

spamegg wrote: Tue Apr 20, 2021 3:11 pm Can you show us the output of

Code: Select all

cat /etc/fstab
/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/sda2 during installation
UUID=07694ce3-1fcd-4c41-9ae0-1274d9907f34 / ext4 errors=remount-ro 0 1
# /boot/efi was on /dev/sda1 during installation
UUID=F4EA-42F2 /boot/efi vfat umask=0077 0 1
/swapfile none swap sw 0 0
djph
Level 7
Level 7
Posts: 1958
Joined: Thu Jun 27, 2019 5:43 am
Location: ::1

Re: Ext Harddrive Filepath/Create Directory

Post by djph »

Nothing there is mounting the drive automatically.

To check if it's already mounted:

Code: Select all

mount | grep "sdb" 
(NOTE -- going with sdb given your first post).

You'll ideally see a line to the effect of "/dev/sdb1 on /some/path type ntfs [...]"


If not; then it's not mounted. You can mount it temporarily with

Code: Select all

sudo mkdir -p /mnt/mybook
sudo mount -t ntfs -o defaults,uid=1000,gid=1000 /dev/sdb1 /mnt/mybook
this'll at least let you confirm everything is happy and the system can successfully mount it (and you can navigate around and so on).

To permanently mount it somewhere, the best thing to work with would be the partition UUID; which you can get with the command

Code: Select all

blkid
(note, might need "sudo" to work). For example, from one of my drives:

Code: Select all

# blkid
/dev/sda1: UUID="94518771-7381-4cc9-adfa-8aade95d8017" TYPE="ext4" PARTUUID="fbfb984e-01"
We then take the "UUID" portion, and edit /etc/fstab to include it (just stick this at the end of the file):

Code: Select all

UUID=94518771-7381-4cc9-adfa-8aade95d8017 /some/directory ntfs defaults,uid=1000,gid=1000 0 0
The six fields are as follows:
  1. UUID=[xxx] -- the partition UUID (could also be /dev/sdb1 ... but USB sometimes gets weird, UUID is best here). Replace with your UUID
  2. /some/directory -- the directory you want the partition to be available in. For example "/srv/mediaserver"
  3. ntfs -- filesystem type. should be "ntfs" for a mybook, unless you've reformatted it (in which case, use the new filesystem type)
  4. defaults,uid,gid -- mounting options. "Default" options for all filesystems are:
    • rw -- set filesystem read/write
    • suid -- allow set UID / set GID bits to take effect (probably no effect on NTFS, I can't remember or find it quick like in the manual)
    • dev -- interpret the character / block device
    • execv -- allow executable files (i.e. with the 'x' bit in permissions) to be executed.
    • auto -- can be automounted with "mount -a"
    • nouser -- forbid regular users from mounting
    • async -- I/O is done asynchronously
    In addition, the uid=1000/gid=1000 directives set ALL files and directories to the specified owning UID and GID (in mint, this'll be the user you created at setup - presumably the account you use daily). This is because NTFS doesn't actually follow linux permission setting paradigms.
  5. the first '0' -- used for dump(8), irrelevant for most drives.
  6. the second '0' -- used to set whether or not fsck will ever run at boot. Valid options are '0' (disable) or '2' (run, but after primary HDD). The only partition that should have this set to '1' is the partition that contains your root ("/") filesystem.
Last edited by djph on Wed Apr 21, 2021 10:46 am, edited 1 time in total.
User avatar
zcot
Level 9
Level 9
Posts: 2838
Joined: Wed Oct 19, 2016 6:08 pm

Re: Ext Harddrive Filepath/Create Directory

Post by zcot »

You might be able to use the apps file search and you would have to go into the root of the filesystem first to find the /media directory and get down in there. There might be an initial option for "Computer", or "File System" or maybe a selection for "Other" where you have to get to the "File System" which will be the base(root) of the whole system file tree. And look for the /media directory. It's a long way to do it if you are only using a mount like that but it can often work that way, but it depends on the program you are using and the particular file search option it uses.
LPredmore
Level 1
Level 1
Posts: 8
Joined: Sun Apr 18, 2021 7:20 am

Re: Ext Harddrive Filepath/Create Directory

Post by LPredmore »

djph wrote: Tue Apr 20, 2021 8:47 pm Nothing there is mounting the drive automatically.

To check if it's already mounted:

Code: Select all

mount | grep "sdb" 
(NOTE -- going with sdb given your first post).

You'll ideally see a line to the effect of "/dev/sdb1 on /some/path type ntfs [...]"


If not; then it's not mounted. You can mount it temporarily with

Code: Select all

sudo mkdir -p /mnt/mybook
sudo mount -t ntfs -o defaults,uid=1000,gid=1000 /dev/sdb1 /mnt/mybook
this'll at least let you confirm everything is happy and the system can successfully mount it (and you can navigate around and so on).

To permanently mount it somewhere, the best thing to work with would be the partition UUID; which you can get with the command

Code: Select all

blkid
(note, might need "sudo" to work). For example, from one of my drives:

Code: Select all

# blkid
/dev/sda1: UUID="94518771-7381-4cc9-adfa-8aade95d8017" TYPE="ext4" PARTUUID="fbfb984e-01"
We then take the "UUID" portion, and edit /etc/fstab to include it (just stick this at the end of the file):

Code: Select all

UUID=94518771-7381-4cc9-adfa-8aade95d8017 /some/directory ntfs defaults,uid=1000,gid=1000 0 0
The six fields are as follows:
  1. UUID=[xxx] -- the partition UUID (could also be /dev/sdb1 ... but USB sometimes gets weird, UUID is best here). Replace with your UUID
  2. /some/directory -- the directory you want the partition to be available in. For example "/srv/mediaserver"
  3. ntfs -- filesystem type. should be "ntfs" for a mybook, unless you've reformatted it (in which case, use the new filesystem type)
  4. defaults,uid,gid -- mounting options. "Default" options for all filesystems are:
    • rw -- set filesystem read/write
    • suid -- allow set UID / set GID bits to take effect (probably no effect on NTFS, I can't remember or find it quick like in the manual)
    • dev -- interpret the character / block device
    • execv -- allow executable files (i.e. with the 'x' bit in permissions) to be executed.
    • auto -- can be automounted with "mount -a"
    • nouser -- forbid regular users from mounting
    • async -- I/O is done asynchronously

    In addition, the uid=1000/gid=1000 directives set ALL files and directories to the specified owning UID and GID (in mint, this'll be the user you created at setup - presumably the account you use daily). This is because NTFS doesn't actually follow linux permission setting paradigms.
  5. the first '0' -- used for dump(8), irrelevant for most drives.
  6. the second '0' -- used to set whether or not fsck will ever run at boot. Valid options are '0' (disable) or '2' (run, but after primary HDD). The only partition that should have this set to '1' is the partition that contains your root ("/") filesystem.


It returned this code
/dev/sdb1 on /media/administrator/My Book type fuseblk (rw,nosuid,nodev,relatime,user_id=0,group_id=0,default_permissions,allow_other,blksize=4096,uhelper=udisks2)
altair4
Level 20
Level 20
Posts: 11460
Joined: Tue Feb 03, 2009 10:27 am

Re: Ext Harddrive Filepath/Create Directory

Post by altair4 »

You have 1 possibly 2 problems:

[1] It's not that the partition isn't being auto-mounted it's that it is mounting it at the wrong place for what you are trying to do:
/dev/sdb1 on /media/administrator/My Book
Regardless of the permissions on the "My Book" folder nobody will be able to get to it other than "administrator". If you notice djph has you mounting it far away from that path /mnt/mybook

[2] It goes back to this question:
zcot wrote: Tue Apr 20, 2021 3:14 pm What media server program?
What server program and more importantly how did you install it? If it is a flatpak you may have the issue of a flatpak not being able to connect to any folder outside of one's home directory.
Please add a [SOLVED] at the end of your original subject header if your question has been answered and solved.
djph
Level 7
Level 7
Posts: 1958
Joined: Thu Jun 27, 2019 5:43 am
Location: ::1

Re: Ext Harddrive Filepath/Create Directory

Post by djph »

LPredmore wrote: Wed Apr 21, 2021 7:19 am
djph wrote: Tue Apr 20, 2021 8:47 pm Nothing there is mounting the drive automatically.

To check if it's already mounted:

Code: Select all

mount | grep "sdb" 
[...]
It returned this code
/dev/sdb1 on /media/administrator/My Book type fuseblk (rw,nosuid,nodev,relatime,user_id=0,group_id=0,default_permissions,allow_other,blksize=4096,uhelper=udisks2)
Alright -- it means that it was automounted; and is only accessible to root (uid/gid=0)

unmount it

Code: Select all

sudo umount /dev/sdb1
then mount it by hand

Code: Select all

sudo mkdir -p /mnt/mybook
sudo mount -t ntfs -o defaults,uid=1000,gid=1000 /dev/sdb1 /mnt/mybook
LPredmore
Level 1
Level 1
Posts: 8
Joined: Sun Apr 18, 2021 7:20 am

Re: Ext Harddrive Filepath/Create Directory

Post by LPredmore »

altair4 wrote: Wed Apr 21, 2021 7:54 am You have 1 possibly 2 problems:

[1] It's not that the partition isn't being auto-mounted it's that it is mounting it at the wrong place for what you are trying to do:
/dev/sdb1 on /media/administrator/My Book
Regardless of the permissions on the "My Book" folder nobody will be able to get to it other than "administrator". If you notice djph has you mounting it far away from that path /mnt/mybook

[2] It goes back to this question:
zcot wrote: Tue Apr 20, 2021 3:14 pm What media server program?
What server program and more importantly how did you install it? If it is a flatpak you may have the issue of a flatpak not being able to connect to any folder outside of one's home directory.
I"m trying to use Emby. And I didn't use flatpak to download it. I just downloaded from the site and followed the commanda
Locked

Return to “Beginner Questions”