0

I have 2 versions of Ubuntu-Mate, 18.04 and 20.04.

This is my home directory for 20.04.

/media/andy/81353260-b5a5-4b72-9fce-432e7c620fdc/home/andy/

# /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=5b4b2ae5-9aaa-4559-9f41-afb313998c75 /               ext4    errors=remount-ro 0       1
/swapfile                                 none            swap    sw              0       0

Is there a way I can change the name to a more user friendly and shorter name.

fixit7
  • 2,776
  • 3
  • 30
  • 70
  • Can you edit your post with the output of `cat /etc/fstab` please – Nicolas Formichella Mar 11 '21 at 20:18
  • Consider [this answer](https://askubuntu.com/a/716880/307670) to a similar question. – graham Mar 11 '21 at 20:21
  • 1
    Does this answer your question? [giving a short name for frequently opened directory via terminal](https://askubuntu.com/questions/716795/giving-a-short-name-for-frequently-opened-directory-via-terminal) – graham Mar 11 '21 at 20:22
  • @Nicolas Formichella I edited my post. – fixit7 Mar 11 '21 at 20:50
  • @24601 I prefer renaming the directory. – fixit7 Mar 11 '21 at 20:51
  • 1
    that looks like an accident, since your home partition is mounted on media. Default would be `/home/andy`. Something goofed up your installation. And: **DO NOT RENAME IT** because the system relies on that path. Much easier is to create a new user. It will reside in /home/xxxx – kanehekili Mar 11 '21 at 20:52
  • @kanehekili OP is double booting 20.04 with 18.04, this name seems to be the the 20.04 home directory but mounted within 18.04 (correct me if I'm wrong @fixit7) – Nicolas Formichella Mar 11 '21 at 20:54
  • @Nicolas Formichella why not having two partions? This way seems to be trouble prone – kanehekili Mar 11 '21 at 20:56
  • Please [Edit] your question and add the output of `ls -la /home`. – Enterprise Mar 11 '21 at 20:56
  • My home dir for 18.04 is /home/andy/. @Nicolas Formichella – fixit7 Mar 11 '21 at 20:58
  • 1
    Generally best not to share a /home partition. When upgrading, applications may update settings in /home for new versions. But then old versions in the old install may not work. If you want to have two installs, use separate /home but have a third data partition with all the data normally in your data folders like Documents, Downloads, etc. Also best to label partitions so automounts are by label (do not use home) but not by UUID (the long number). – oldfred Mar 11 '21 at 21:22
  • I have 2 separate home directories. /media/andy/81353260-b5a5-4b72-9fce-432e7c620fdc/home/andy/ and /home/andy/ @oldfred – fixit7 Mar 11 '21 at 21:27
  • Still prefer separate data partition, but you can label partitions and then they are mounted by label. `lsblk -o name,fstype,size,label,partlabel,mountpoint,uuid | egrep -v "^loop"` To add labels, I often use Disks. You can also use terminal. I added groovy to sdb8 with this `sudo e2label /dev/sdb8 groovy` – oldfred Mar 12 '21 at 03:33
  • Does this answer your question? [Short-cut for switching to a given directory](https://askubuntu.com/questions/226417/short-cut-for-switching-to-a-given-directory) – Charo Mar 27 '21 at 08:37

4 Answers4

1

You could create an symlink in the /home directory of your 20.04 installation.

sudo ln -s /media/andy/81353260-b5a5-4b72-9fce-432e7c620fdc/home/andy /home/andy_1804

Then simply access your 18.04 "home" folder by using the shorter path "/home/andy_1804".

Enterprise
  • 12,002
  • 11
  • 60
  • 105
0

The reason I wanted a shorter name for my home directory is I thought I would have to change some aliases that change directories.

One alias was alias dwn='cd /home/andy/Downloads'

But the actual directory is

/media/andy/81353260-b5a5-4b72-9fce-432e7c620fdc/home/andy/Downloads/

But the alias still works.

fixit7
  • 2,776
  • 3
  • 30
  • 70
0

Run

  • lsblk to spot which partition holds the 20.04 install

  • blkid /dev/[what you found with sd* or nvme*n*p*] and copy the entire UUID=xx string (including the UUID= part)

  • mkdir whatever folder name you want in the /media/andy folder (ex. mkdir /media/andy/2004)

  • sudo nano /etc/fstab

  • Get at the end of the file and paste what I wrote in the code block and replace the UUID= and /media/andy/ part with yours

UUID=xxxxxx /media/andy/  ext4 rw,nofail,nosuid,nouser,auto,exec user 0 0 

See man 5 fstab and man 8 mount to find docs about what I did

Reboot and normally you should be able to cd to your new directory and have your partition mounted

0

I had the same issue. Go to settings and then about. Change the Device Name and voilà.