Newbie Issue - storage mounting issues

background

Hi guys Newbie user here,
This is my first forum post i hope i didn't mess up something :smile:
i have just come to Garuda from Windows, i have some experience running linux distros from a VM or wsl console, but i have never faced how to actually move linux system folders to other drive
I installed garuda dragonized following Calamares installation on my laptop SSD

The aim

the aim is to keep my 120 gb SSD as OS files and the 1 TB HDD as storage
So i started searching online for help or guides, I tried to read Arch wiki/forum and Garuda wiki/forum but i havent really found the exact solution.

what i have learned is that i should:

  • wipe HDD
  • add a partition on HDD of max size
  • make a BTRFS filesystem on the partition
  • mount the directories i want to move in fstab (i suppose the home folder should do the trick)

I understood that mounting basically is telling the OS where to find the folders

What I tried

the main problem is that the concept of how to mount is not really clear to me and when i tried to mount the home folder adding the line in fstab everything broke... when i was clicking the icons of the bar a small rectangle popped up with written: "unable to find the application"
so i timeshifted back
i suppose the reason is that there is no actual home folder into the HDD yet?

The things i tried to do

  • i used the partition manager of Garuda welcome to deallocate my HDD and then create a new partition
  • i changed the UUID in fstab of the /home row to the HDD one

Useful things

the ouput of lsblk -f

:

 NAME        FSTYPE FSVER LABEL    UUID                                 FSAVAIL FSUSE% MOUNTPOINTS
 sda         btrfs                 7516f751-35a3-4b6d-be59-deff825da426
 zram0                                                                                 [SWAP]
 nvme0n1
 β”œβ”€nvme0n1p1 vfat   FAT32 NO_LABEL 0ED8-630F                             255,4M     0% /boot/efi
 └─nvme0n1p2 btrfs                 e6f81401-329a-4193-a512-f2861aeb46f3  101,3G    15% /run/timeshift/backup
                                                                                       /var/tmp
                                                                                       /var/log
                                                                                       /var/cache
                                                                                       /root
                                                                                       /srv
                                                                                       /home
                                                                                       /

the fstab file:

# /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=0ED8-630F                            /boot/efi      vfat    umask=0077 0 2
UUID=e6f81401-329a-4193-a512-f2861aeb46f3 /              btrfs   subvol=/@,defaults,noatime,space_cache,autodefrag,compress=zstd 0 0
UUID=e6f81401-329a-4193-a512-f2861aeb46f3 /home          btrfs   subvol=/@home,defaults,noatime,space_cache,autodefrag,compress=zstd 0 0
UUID=e6f81401-329a-4193-a512-f2861aeb46f3 /root          btrfs   subvol=/@root,defaults,noatime,space_cache,autodefrag,compress=zstd 0 0
UUID=e6f81401-329a-4193-a512-f2861aeb46f3 /srv           btrfs   subvol=/@srv,defaults,noatime,space_cache,autodefrag,compress=zstd 0 0
UUID=e6f81401-329a-4193-a512-f2861aeb46f3 /var/cache     btrfs   subvol=/@cache,defaults,noatime,space_cache,autodefrag,compress=zstd 0 0
UUID=e6f81401-329a-4193-a512-f2861aeb46f3 /var/log       btrfs   subvol=/@log,defaults,noatime,space_cache,autodefrag,compress=zstd 0 0
UUID=e6f81401-329a-4193-a512-f2861aeb46f3 /var/tmp       btrfs   subvol=/@tmp,defaults,noatime,space_cache,autodefrag,compress=zstd 0 0

output of inxi -Faz


System:    Kernel: 5.14.7-zen1-1-zen x86_64 bits: 64 compiler: gcc v: 11.1.0  
parameters: BOOT_IMAGE=/@/boot/vmlinuz-linux-zen root=UUID=e6f81401-329a-4193-a512-f2861aeb46f3 rw  
[email protected] quiet splash rd.udev.log_priority=3 vt.global_cursor_default=0
systemd.unified_cgroup_hierarchy=1 loglevel=3
Desktop: KDE Plasma 5.22.5 tk: Qt 5.15.2 info: latte-dock wm: kwin_x11 vt: 1 dm: SDDM Distro: Garuda Linux  
base: Arch Linux  
Machine:   Type: Laptop System: HP product: HP Pavilion Power Laptop 15-cb0xx v: Type1ProductConfigId serial: <filter>  
Chassis: type: 10 serial: <filter>  
Mobo: HP model: 836B v: 46.21 serial: <filter> UEFI: Insyde v: F.10 date: 07/28/2017  
Battery:   ID-1: BAT0 charge: 46.8 Wh (83.3%) condition: 56.2/56.2 Wh (100.0%) volts: 17.6 min: 15.4 model: HP Primary  
type: Li-ion serial: N/A status: Charging  
CPU:       Info: Quad Core model: Intel Core i7-7700HQ bits: 64 type: MT MCP arch: Kaby Lake family: 6 model-id: 9E (158)  
stepping: 9 microcode: EA cache: L2: 6 MiB  
flags: avx avx2 lm nx pae sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx bogomips: 44798  
Speed: 3623 MHz min/max: 800/3800 MHz Core speeds (MHz): 1: 3623 2: 3670 3: 3601 4: 3601 5: 3802 6: 3602 7: 3600  
8: 3683  
Vulnerabilities: Type: itlb_multihit status: KVM: VMX disabled  
Type: l1tf mitigation: PTE Inversion; VMX: conditional cache flushes, SMT vulnerable  
Type: mds mitigation: Clear CPU buffers; SMT vulnerable  
Type: meltdown mitigation: PTI  
Type: spec_store_bypass mitigation: Speculative Store Bypass disabled via prctl and seccomp  
Type: spectre_v1 mitigation: usercopy/swapgs barriers and __user pointer sanitization  
Type: spectre_v2 mitigation: Full generic retpoline, IBPB: conditional, IBRS_FW, STIBP: conditional, RSB filling  
Type: srbds mitigation: Microcode  
Type: tsx_async_abort status: Not affected  
Graphics:  Device-1: Intel HD Graphics 630 vendor: Hewlett-Packard driver: i915 v: kernel bus-ID: 00:02.0 chip-ID: 8086:591b  
class-ID: 0300  
Device-2: NVIDIA GP107M [GeForce GTX 1050 Mobile] vendor: Hewlett-Packard driver: nvidia v: 470.74  
alternate: nouveau,nvidia_drm bus-ID: 01:00.0 chip-ID: 10de:1c8d class-ID: 0300  
Device-3: Chicony HP Wide Vision HD Camera type: USB driver: uvcvideo bus-ID: 1-4:2 chip-ID: 04f2:b5d6  
class-ID: 0e02  
Display: x11 server: X.Org 1.20.13 compositor: kwin_x11 driver: loaded: modesetting,nvidia display-ID: :0  
screens: 1  
Screen-1: 0 s-res: 1920x1080 s-dpi: 96 s-size: 508x285mm (20.0x11.2") s-diag: 582mm (22.9")  
Monitor-1: eDP-1 res: 1920x1080 hz: 60 dpi: 142 size: 344x194mm (13.5x7.6") diag: 395mm (15.5")  
OpenGL: renderer: Mesa Intel HD Graphics 630 (KBL GT2) v: 4.6 Mesa 21.2.2 direct render: Yes  
Audio:     Device-1: Intel CM238 HD Audio vendor: Hewlett-Packard driver: snd_hda_intel v: kernel bus-ID: 00:1f.3  
chip-ID: 8086:a171 class-ID: 0403  
Device-2: NVIDIA GP107GL High Definition Audio vendor: Hewlett-Packard driver: snd_hda_intel v: kernel  
bus-ID: 01:00.1 chip-ID: 10de:0fb9 class-ID: 0403  
Sound Server-1: ALSA v: k5.14.7-zen1-1-zen running: yes  
Sound Server-2: JACK v: 1.9.19 running: no  
Sound Server-3: PulseAudio v: 15.0 running: no  
Sound Server-4: PipeWire v: 0.3.37 running: yes  
Network:   Device-1: Intel Wireless 7265 driver: iwlwifi v: kernel port: 4000 bus-ID: 04:00.0 chip-ID: 8086:095a  
class-ID: 0280  
IF: wlo1 state: up mac: <filter>  
Device-2: Realtek RTL8111/8168/8411 PCI Express Gigabit Ethernet vendor: Hewlett-Packard driver: r8169 v: kernel  
port: 3000 bus-ID: 05:00.0 chip-ID: 10ec:8168 class-ID: 0200  
IF: eno1 state: down mac: <filter>  
Bluetooth: Device-1: Intel Bluetooth wireless interface type: USB driver: btusb v: 0.8 bus-ID: 1-7:3 chip-ID: 8087:0a2a  
class-ID: e001  
Report: bt-adapter ID: hci0 rfk-id: 0 state: up address: <filter>  
Drives:    Local Storage: total: 1.03 TiB used: 17.29 GiB (1.6%)  
SMART Message: Unable to run smartctl. Root privileges required.  
ID-1: /dev/nvme0n1 maj-min: 259:0 vendor: Toshiba model: N/A size: 119.24 GiB block-size: physical: 512 B  
logical: 512 B speed: 31.6 Gb/s lanes: 4 type: SSD serial: <filter> rev: 5KHA4102 temp: 41.9 C scheme: GPT  
ID-2: /dev/sda maj-min: 8:0 vendor: HGST (Hitachi) model: HTS721010A9E630 size: 931.51 GiB block-size:  
physical: 4096 B logical: 512 B speed: 6.0 Gb/s type: HDD rpm: 7200 serial: <filter> rev: A3T0
Partition: ID-1: / raw-size: 118.99 GiB size: 118.99 GiB (100.00%) used: 17.29 GiB (14.5%) fs: btrfs dev: /dev/nvme0n1p2
maj-min: 259:2
ID-2: /boot/efi raw-size: 260 MiB size: 256 MiB (98.46%) used: 562 KiB (0.2%) fs: vfat dev: /dev/nvme0n1p1
maj-min: 259:1
ID-3: /home raw-size: 118.99 GiB size: 118.99 GiB (100.00%) used: 17.29 GiB (14.5%) fs: btrfs dev: /dev/nvme0n1p2
maj-min: 259:2
ID-4: /var/log raw-size: 118.99 GiB size: 118.99 GiB (100.00%) used: 17.29 GiB (14.5%) fs: btrfs
dev: /dev/nvme0n1p2 maj-min: 259:2
ID-5: /var/tmp raw-size: 118.99 GiB size: 118.99 GiB (100.00%) used: 17.29 GiB (14.5%) fs: btrfs
dev: /dev/nvme0n1p2 maj-min: 259:2
Swap:      Kernel: swappiness: 133 (default 60) cache-pressure: 100 (default)
ID-1: swap-1 type: zram size: 15.51 GiB used: 0 KiB (0.0%) priority: 100 dev: /dev/zram0
Sensors:   System Temperatures: cpu: 51.0 C mobo: N/A
Fan Speeds (RPM): N/A
Info:      Processes: 259 Uptime: 49m wakeups: 1 Memory: 15.51 GiB used: 2.69 GiB (17.3%) Init: systemd v: 249 tool: systemctl
Compilers: gcc: 11.1.0 clang: 12.0.1 Packages: pacman: 1407 lib: 346 Shell: Bash v: 5.1.8 running-in: konsole
inxi: 3.3.06

i hope to find the solution here i am excited to have linux as the main OS but i still have (and want) to learn a lot, I hope to not annoy experienced users with my question :sweat_smile:

i will gladly even accept any kind of other solutions or links to read

I thank you all in advance :slight_smile:

Don't use your HDD as "home." Simply symlink your data directories to the same in the real "home." That's as simple as it gets. You're making it more difficult than it is.

There are several "how to" posts concerning this.

regards

4 Likes

You're making it FAR more difficult than it is.

You also don't need to use btrfs for a storage drive. You can use ext4 which has more options for data recovery should you ever require it.

Symlinking is super simple.

1 Like

is there any wiki page I can start with to learn about symlinks?

You can symlink via drag and drop if you're using Dolphin file manager. Doesn't get any simpler than that. :wink:

You can try typing man ln in terminal to learn how to use the ln command to make them. You can also type ln --help and you'll see the output. Effectively, you have to type:

ln -s [full path to the target] [link name]

You type this command in the directory where you want to place the link, or supply the full path in [link name]. So, for example, if I wanted to create a symlink for /opt in my /home directory, here's what I would do:

$ cd ~
$ ln -s /opt ./opt_directory

The cd ~ command ensures that you're in your home directory, ie, /home/[username]
ln -s specifies you're creating a symbolic link
/opt is the target you're trying to link TO
./opt_directory is saying you're creating a symbolic link inside the current directory (as specified by the period and forward slash - ./) with the LINK name opt_directory. Think of this like a "shortcut" in Windows. So now, if you type ls -lah in your home directory, you will see an output listing all the files and directories in your home folder, and you will see that opt_directory is SYMLINKED to /opt. So if you type cd opt_directory your local path will still be /home/[username]/opt_directory but will display all the files and directories that are in /opt.

Keep in mind, if the TARGET you're trying to link to has permissions that prevent your user to read/execute then you will be unable as the user to create the symbolic link. I was just using /opt as an example.

2 Likes

i just tried it with dragging the downloads folder on the hdd device, unfortunately it says it failed, and to check permissions. So I tried to run dolphin with sudo but it doesnt open saying

Executing Dolphin with sudo is not possible due to unfixable security vulnerabilities

i guess i am doing something wrong here :frowning:

It sounds like

It seems like either the target or the destination you're trying to symlink has permissions that prevent your user from being able to make the symlink. Can you tell us the full path of the target directory and the full path of where you're making the symlink?

I tried to do it with /home/aron/Downloads and /dev/sda (which is the only partition of the hdd)

/dev/sda is a block device and not a partition, you have to operate on the mounted partition/folder.

1 Like

/dev/sda is the device for the hard drive, you will need to link to the directory that's on /dev/sda. You cannot symlink a block device as a user-accessible directory. Where do you have /dev/sda mounted in /etc/fstab ?

1 Like

man ln
(okay it's not a wiki, but you still get all the info you need)

1 Like

I'm sorry I am having a bit of confusion with this I'll try to make a recap to make things more clear:

  • /dev/sda is the HDD and i have an ext4 partition (i changed it from btrfs) that covers the whole disk named /dev/sda1 (made with garuda partition manager)
  • /dev/sda is not mounted as i have not added a line in fstab
  • what i want to do with it is to make my /dev/sda1 partition the place where I store my large data files so you suggested me to symlink the directories under /home/aron to the partition

to symlink for example my Downloads directory to the /dev/sda1 i should type the command

ln -s /dev/sda1 /home/aron/Downloads

this way when i save my files into the Downloads directory they are saved into my HDD?
to add another folder i just type another ln -s command?

thank to all of you for your patience :slight_smile:

Ok, first thing's first, you have to specify in /etc/fstab where you want that partition to be mounted. So, for example, you will edit that file and include something like this:

/dev/sda1 /hdd ext4 rw,user,auto 0 0

This tells the system to make the /dev/sda1 partition accessible on /hdd and to mount it as filesystem type ext4 and to make it read-write and accessible to all users, and to automatically mount it during startup.

Then, you will need to symlink the /hdd path. So following this example, it would be:

ln -s /hdd /home/aron/Downloads

That should do the trick :wink:

Edit: if you want to try a temporary mounted solution, you can also do this:

[email protected]:~$ sudo mkdir /hdd
[email protected]:~$ sudo mount /dev/sda1 -t ext4 -o rw,user /hdd
[email protected]:~$ cd /hdd

Note: "[email protected]:~$" represents the shell prompt, just reference the commands after the prompt. Once you're done with the above commands, the /dev/sda1 ext4 partition will be read-write accessible to you on the path /hdd. This will not persist after a reboot. You can also use the gnome-disk-tool (or something like that) GUI to mount that partition.

4 Likes

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.