1

I used the Disks utility to format my 2nd internal ssd. I added a whole-device partition without a name, and added a filesystem (ext4) name. Everything's working ok: it mounts at startup; the filesystem shows on the desktop (although I don't require that; I mostly use terminal). I already copied 400G of files to it, which took hours, so I'd prefer not to reformat it.

Currently to access a directory I have to type, schematically: /media/my-user-name/partition-name/directory-name. I want instead to type /some-short-name/directory-name, where some-short-name is at most three letters.

Now, I know that the shortest mount point name, "/", is already taken :) Disks shows the current mount point as /mnt/long-gibberish-UUID. Being a relative Ubuntu newbie, I guess /media got into the picture because it's a default for non-root storage devices.

What should I do?

brec
  • 223
  • 1
    I mount my data partition to /mnt/data and then link default olders back into /home like Music, Documents and then some others I add. https://askubuntu.com/questions/1013677/storing-data-on-second-hdd-mounting & https://askubuntu.com/questions/1058756/installing-all-applications-on-a-ssd-disk-and-putting-all-files-on-hdd-disk – oldfred Aug 26 '21 at 19:04

1 Answers1

2

If you want to change directory to [the file system in] your second drive, 'to-drive-two', I suggest the following alias:

alias 22='cd /media/my-user-name/partition-name/directory-name'

Store it along with the already existing aliases in your bash configuration file ~/.bashrc. (Activate in the current terminal window with source ~/.bashrc; It will be activated automatically in all new terminal windows that you open. So go to drive 2 with the command 22

If you want to use a shortcut, it is called symbolic link in Linux, for example, you can have a link in your home directory (alongside Documents, Downloads etc) to the file system in your second drive,

cd
ln -s '/media/my-user-name/partition-name/directory-name' 2

Then you can use ~/2 instead of the long name when listing files, copying files etc.

sudodus
  • 46,324
  • 5
  • 88
  • 152
  • Thanks, @sudodus, those two solutions seem feasible. What I did soon after posting was: cd / then sudo mkdir a-short-name then in the Disks utility I changed the mount point to /a-short-name. That seems to work, at least so far. Am I risking any harm from that? – brec Aug 26 '21 at 19:03
  • @brec, It is not common to have a working directory for private files directly in the root, but it is possible. For example, /mnt is recommended as a temporary mountpoint. For long-term use, you can create subdirectories in /mnt and use them as mountpoints. – sudodus Aug 26 '21 at 19:26
  • I gather that it's not common, but it seems it might be OK on a single-user system like mine. I notice that ls -l shows me as the user and group, and only the user has any access rights. I could chown it to root, but AFAIK the only applications that need access will have me as user. – brec Aug 26 '21 at 19:38
  • 1
    @brec, Keep it like that, work as much as possible with your normal user ID. Use elevated permissions (with sudo) as seldom as possible. – sudodus Aug 26 '21 at 19:51