Score:0

Mount drive and cd into a folder

ar flag

I have my work files on a different drive. Every time I want to work on it, I have to click through files -> Other locations -> /dev/sda2. Then run the terminal in there. I am wondering if this is automatable?

What I have tried:

sudo mount /dev/sda2 /media/username
cd /media/username/desiredFolder

The problem with my approach is when I run Sudo the password is needed which means the script can not run on its own. Is there a way to bypass that? Or perhaps a better way to accomplish the directory switch?

Ekadh Singh - Reinstate Monica avatar
I've edited out the first sentence of your post because it's unnecessary (don't worry though, people aren't going to be mean to you even if you ask a stupid question! If they are, just flag it and it will be taken down)
PonJar avatar
in flag
You need to research how to add a new entry in your /etc/fstab file. That tells the system what to mount when it boots and where with what options. There are lots of articles available with a simple google search for “fstab” This is the first hit when I try this - https://www.howtogeek.com/howto/38125/htg-explains-what-is-the-linux-fstab-and-how-does-it-work/ Let us know how you get on. If you cannot work it out yourself add your UUID and filesystem type to the question and I’ll answer more precisely.
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.