How do I use a HDD to store media files

I am very new to manjaro, and my setup consists of a 120GiB SSD for the OS and a 700GiB HDD that I plan to use for storing the contents of Desktop, Documents, Downloads, Music, and Pictures. I followed this wiki to create a permanent mount point and used the kde system setting>removable storange>removable devices and checked the automount on attach option. I also followed the comments from this user and it all basically worked until I rebooted my system. None of the data is gone but the symlinks seem to have 'forgotten' where the media files are- if I try to open the symlink to Documents for example, I get an error (before the reboot though, it was working fine- I tested every symlink I created). Also, I am on kde- in Dolphin, under the Places section, if I click eg on Documents, I get a message saying The file or folder does not exist. I guess I screwed up while following the instructions but I can't seem to find where I made a mistake. Any help would be appreciated.

Here is my 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>
UUID=87b68a17-f14d-4fd4-8636-ea454d474b42 /              ext4    defaults,noatime,discard 0 1
UUID=9a047cf9-7922-406f-8a7f-6a16c0d40979 swap           swap    defaults,noatime,discard 0 2
tmpfs                                     /tmp           tmpfs   defaults,noatime,mode=1777 0 0
#700 GB HDD
#UUID=4aa132bd-9eea-422e-922d-5a14614e52de/media/Data ext4 nofail, noatime, rw, user, uid=1000, gid=1000, dmask=022, fmask=133, windows_names, auto 0 0
#Storage
UUID =4aa132bd-9eea-422e-922d-5a14614e52de  /run/media/peter/Data    ext4 defaults 

UPDATE: I have no idea what fixed it but I followed the steps outlined in this wiki except

  1. I had to chown user for the media and data directories. (this step was suggested by @Photon)

  2. I had to remove the noatime attribute (I kept getting a parsing error when I ran mount -a otherwise).

But now everything works as expected. Thank you everyone for your time and patience.

Not sure if this is the cause of the problem, but it is highly unusual to mount partitions in subfolders of /run. I'd change the mount point to /media/Data (as it is already has been set in the line which you now commented out). Make sure to create this folder before rebooting. Also make sure that you have reading and writing permissions in /media/Data (you should probably chown the folder with your user if you have a single user setup anyway).

1 Like

Are these both internal drives?

they are

1 Like

Thank you, I believe the sudo chown /media/Data was necessary, as you suggested. I originally thought if I just chown the media directory, all the subdirectories in media would inherit the permissions. Evidently that was wrong.

1 Like

I have two SSDs (one for Windows 10 Pro and one for Manjaro) and also one 4TB HDD for storing data.
I have created a mount point /data in the root directory of the filesystem.
The mount point is written in /etc/fstab.
The HDD is mounted automatically during boot.
Works fine!

There is a lot easier way to do this. When you install manjaro, choose the custom partitioner, and mount your 128G SSD as / and your 700G HDD as /home. You may also move the contents of /home to your drive, chown or chmod your drive to your user, then add your drive with mountpoint /home in the FStab.

You will take a performance hit by having all of home on your hdd instead of leaving /home on your ssd and just linking/mounting Documents/Desktop/Downloads/Pictures/Videos. This lets things like .config/.cache and similiar in ~ live on the ssd.

4 Likes

Oh. Thanks for the insight. That makes a lot of sense

1 Like

I don't know why it borked for me, I made to sure to follow the wiki I linked. As far as I can tell, every time I ran sudo mount -a I got a message saying there was a parsing error while executing the mount point in my /etc/fstab because of the noatime attribute. Once I put everything in default, it started working fine. This is my current 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>
UUID=87b68a17-f14d-4fd4-8636-ea454d474b42 /              ext4    defaults,noatime,discard 0 1
UUID=9a047cf9-7922-406f-8a7f-6a16c0d40979 swap           swap    defaults,noatime,discard 0 2
tmpfs                                     /tmp           tmpfs   defaults,noatime,mode=1777 0 0
#700 GB HDD
#UUID=4aa132bd-9eea-422e-922d-5a14614e52de/media/Data ext4 nofail, noatime, rw, user, uid=1000, gid=1000, dmask=022, fmask=133, windows_names, auto 0 0
#Storage
UUID=d483de0d-fb69-4112-b21f-3f06f8126fac /media/Data ext4 defaults, 0 1

The last line - mount point /media/Data
I think there must be a "tab" between /media/Data and ext4

The space- or tab-separated fields within each row (typically aligned in columns, as above, but this is not a requirement) must appear in a specific order, as follows:

    device-spec – The device name, label, UUID, or other means of specifying the partition or data source this entry refers to.
    mount-point – Where the contents of the device may be accessed after mounting; for swap partitions or files, this is set to none.
    fs-type – The type of file system to be mounted.
    options – Options describing various other aspects of the file system, such as whether it is automatically mounted at boot, which users may mount or access it, whether it may be written to or only read from, its size, and so forth; the special option defaults refers to a predetermined set of options depending on the file system type.
    dump – A number indicating whether and how often the file system should be backed up by the dump program; a zero indicates the file system will never be automatically backed up.
    pass – A number indicating the order in which the fsck program will check the devices for errors at boot time; this is 1 for the root file system and either 2 (meaning check after root) or 0 (do not check) for all other devices.

Missing values in the last two fields are interpreted as zeros. If necessary, space characters in the first, second, and fourth fields are indicated by the octal character code \040. 

Then show the error message during mount of /media/Data

I just tried to reproduce the error- the relevant line in /etc/fstab:

#Storage
UUID=d483de0d-fb69-4112-b21f-3f06f8126fac /media/Data ext4 defaults, noatime 0 1

the error message (copied from the terminal):

mount: /etc/fstab: parse error: ignore entry at line 14.

But when I tried it with

UUID=d483de0d-fb69-4112-b21f-3f06f8126fac /media/Data ext4 defaults, noatime, 0 1 
#comma at the end of "noatime"

it worked. Other than the comma, the only different thing I did is that I made the edit using nano instead of kate. Is there any way to tell if there is a 'tab' between the entries? On kate I made sure to hit backspace and delete to get rid of any extra whitespace between the fields.

Kate, document (end of line)= LF (unix) not CR/LF (win)

In geany (kate) View-Spaces
grafik


In /etc/fstab all whitespace (whether spaces or tabs) is viewed as equivalent, so the issue is the space between defaults, and noatime.

It should be

UUID=d483de0d-fb69-4112-b21f-3f06f8126fac /media/Data ext4 defaults,noatime 0 1

or just

UUID=d483de0d-fb69-4112-b21f-3f06f8126fac /media/Data ext4 noatime 0 1
2 Likes

so the issue is the space between defaults, and noatime.

I didn't know this- thank you!