Creating Symlinks

I recently shifted my /home partition to my SSD on a SSD+HDD type laptop, via a fresh install. The thing is, my older home directory is still in the HDD, how can I create symlinks from my ~/Downloads and ~/Documents etc, to the older /home? Is there a better, non-convoluted way of managing things? ( My new /home is only 58GiB, so I can’t move everything there)

My inxi-Fazy

System:
  Kernel: 5.8.16-2-MANJARO x86_64 bits: 64 compiler: N/A 
  parameters: BOOT_IMAGE=/boot/vmlinuz-5.8-x86_64 
  root=UUID=2c697afe-8b6f-42bc-8b35-dcb1df41810d rw quiet apparmor=1 
  security=apparmor resume=UUID=cb61cf2f-d1bf-446f-a80d-b128f9df4ac1 
  udev.log_priority=3 
  Desktop: KDE Plasma 5.19.5 tk: Qt 5.15.1 wm: kwin_x11 dm: SDDM 
  Distro: Manjaro Linux 
Machine:
  Type: Laptop System: HP product: OMEN by HP Laptop 15-dc1xxx v: N/A 
  serial: <filter> Chassis: type: 10 serial: <filter> 
  Mobo: HP model: 8575 v: 21.17 serial: <filter> UEFI: AMI v: F.22 
  date: 05/03/2021 
Battery:
  ID-1: BAT0 charge: 35.6 Wh condition: 44.5/44.5 Wh (100%) volts: 12.4/11.6 
  model: HP Primary type: Li-ion serial: N/A status: Unknown 
CPU:
  Topology: 6-Core model: Intel Core i7-9750H bits: 64 type: MT MCP 
  arch: Kaby Lake family: 6 model-id: 9E (158) stepping: A (10) microcode: DE 
  L2 cache: 12.0 MiB 
  flags: avx avx2 lm nx pae sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx 
  bogomips: 62431 
  Speed: 801 MHz min/max: 800/4500 MHz Core speeds (MHz): 1: 800 2: 800 3: 800 
  4: 800 5: 800 6: 800 7: 800 8: 800 9: 800 10: 800 11: 800 12: 800 
  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 UHD Graphics 630 vendor: Hewlett-Packard driver: i915 
  v: kernel bus ID: 00:02.0 chip ID: 8086:3e9b 
  Device-2: NVIDIA TU117M [GeForce GTX 1650 Mobile / Max-Q] 
  vendor: Hewlett-Packard driver: nvidia v: 455.28 bus ID: 01:00.0 
  chip ID: 10de:1f91 
  Device-3: Quanta HP Wide Vision HD Camera type: USB driver: uvcvideo 
  bus ID: 1-6:3 chip ID: 0408:5300 serial: <filter> 
  Display: x11 server: X.Org 1.20.9 compositor: kwin_x11 
  driver: modesetting,nvidia alternate: fbdev,intel,nouveau,nv,vesa 
  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: 344x193mm (13.5x7.6") 
  diag: 394mm (15.5") 
  OpenGL: renderer: Mesa Intel UHD Graphics 630 (CFL GT2) v: 4.6 Mesa 20.1.8 
  direct render: Yes 
Audio:
  Device-1: Intel Cannon Lake PCH cAVS vendor: Hewlett-Packard 
  driver: snd_hda_intel v: kernel bus ID: 00:1f.3 chip ID: 8086:a348 
  Sound Server: ALSA v: k5.8.16-2-MANJARO 
Network:
  Device-1: Intel Wireless-AC 9560 [Jefferson Peak] driver: iwlwifi v: kernel 
  port: 5000 bus ID: 00:14.3 chip ID: 8086:a370 
  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: 03:00.0 
  chip ID: 10ec:8168 
  IF: eno1 state: down mac: <filter> 
Drives:
  Local Storage: total: 1.14 TiB used: 42.69 GiB (3.6%) 
  SMART Message: Unable to run smartctl. Root privileges required. 
  ID-1: /dev/nvme0n1 vendor: Western Digital model: PC SN720 SDAPNTW-256G-1006 
  size: 238.47 GiB block size: physical: 512 B logical: 512 B speed: 31.6 Gb/s 
  lanes: 4 serial: <filter> rev: 10112006 scheme: GPT 
  ID-2: /dev/sda vendor: HGST (Hitachi) model: HTS721010A9E630 
  size: 931.51 GiB block size: physical: 4096 B logical: 512 B speed: 6.0 Gb/s 
  rotation: 7200 rpm serial: <filter> rev: A3T0 scheme: GPT 
RAID:
  Hardware-1: Intel 82801 Mobile SATA Controller [RAID mode] driver: ahci 
  v: 3.0 port: 5060 bus ID: 00:17.0 chip ID: 8086.282a rev: 10 
Partition:
  ID-1: / raw size: 40.00 GiB size: 39.12 GiB (97.80%) used: 10.77 GiB (27.5%) 
  fs: ext4 dev: /dev/nvme0n1p5 
  ID-2: /home raw size: 58.91 GiB size: 57.73 GiB (98.00%) 
  used: 262.6 MiB (0.4%) fs: ext4 dev: /dev/nvme0n1p6 
Swap:
  Kernel: swappiness: 60 (default) cache pressure: 100 (default) 
  ID-1: swap-1 type: partition size: 4.00 GiB used: 0 KiB (0.0%) priority: -2 
  dev: /dev/nvme0n1p7 
Sensors:
  System Temperatures: cpu: 68.0 C mobo: N/A 
  Fan Speeds (RPM): N/A 
Info:
  Processes: 311 Uptime: 48m Memory: 7.58 GiB used: 2.07 GiB (27.3%) 
  Init: systemd v: 246 Compilers: gcc: N/A Packages: pacman: 1186 lib: 340 
  flatpak: 0 Shell: Bash v: 5.0.18 running in: yakuake inxi: 3.1.05 

I just installed off an old iso, and am updating as I type this, so don’t worry for the old software and kernel versions!
Thanks!

I’m not sure if there is a ‘better’ way then linking, but to make it easier for the future I would not have two home folders on 2 disks in the same system to make sure it is crystal clear what is where. Read up on what happens when you link, eg does the backup handle the linked folders?

If I where in your position I would make a directory ‘data’ on a mounted partion on the /dev/sda where the large directories would live. Remove the folders in your new /home/[user]/ and make the link to the folders on the other disk. Then remove the old home folder and all the other old stuff on the sda drive.

One thing to check is the .cache and .local folders in your home directory, they can get rather large. I have those linked to a seperate directory under /data in my system, the backup setup that I use does not follow links so the backup stay’s nice and small, just documents, config files, images.

1 Like

Thanks for replying!
Actually I have only 1 /home folder, the other one is from the older install of whose files I want to see in my new /home via symlinks. So, you say there is no other way. Well, can you tell me now, how to make symlinks?( Thanks again from a complete newbie).

I take from your description that your HDD contains a full installation – thus previously mounted on /.

I think of two ways : a simple one and a clean one.

In the simpler case, you just need to automount your old drive to a directory of your choice (like /mnt/old), and then replace the folders in your current home with symlinks pointing the ones on the old drive.

In a cleaner case, you can prepare your old drive so you mount it on your actual home :

  • delete everything except the home folder
  • move the content of the home folder to the root folder
  • copy everything from your current home – including hidden files! – to your old drive
  • automount your old drive to /home
    This way, you actually use your old drive as your /home drive. But it may indeed by tricky if you aren’t used to “complex” partitioning.

https://lmddgtfy.net/?q=how%20to%20create%20a%20symlink

2 Likes

Thanks! will be implementing the simpler solution for sure.

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