Score:1

How to make path specification of partition on 2nd internal ssd *short* -- easy to type?

lr flag

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?

oldfred avatar
cn flag
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
Score:2
jp flag

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.

lr flag
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?
sudodus avatar
jp flag
@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.
lr flag
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.
sudodus avatar
jp flag
@brec, Keep it like that, work as much as possible with your normal user ID. Use elevated permissions (with sudo) as seldom as possible.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.