Create directory

Questions about other topics - please check if your question fits better in another category before posting here
Forum rules
Before you post please read how to get help
User avatar
muffybean
Level 3
Level 3
Posts: 191
Joined: Thu Oct 17, 2019 8:22 am

Create directory

Post by muffybean » Sun Nov 03, 2019 6:47 pm

I want to create a folder on a drive, so I opened terminal and changed to the drive, it is called media. The route I took was as follows
veronica@veronica-M61PM-S2:~$ cd /media
veronica@veronica-M61PM-S2:/media$ mkdir Golf
mkdir: cannot create directory ‘Golf’: Permission denied
veronica@veronica-M61PM-S2:/media$
Can you please help.
Running Linux Mint MATE on 2 desktops + Linux Mint Xfce on Netbook

User avatar
JerryF
Level 11
Level 11
Posts: 3873
Joined: Mon Jun 08, 2015 1:23 pm
Location: Rhode Island, USA

Re: Create directory

Post by JerryF » Sun Nov 03, 2019 7:09 pm

Any particular reason why you want to create a directory there? Usually, that directory /media is used for mounting devices and is owned by root. That's why you're unable to create a subdirectory under /media.
IF your problem has been solved, please edit your ORIGINAL post and add [SOLVED] to the beginning of the Subject Line. It helps other members when browsing posts.

User avatar
Flemur
Level 17
Level 17
Posts: 7321
Joined: Mon Aug 20, 2012 9:41 pm
Location: Potemkin Village

Re: Create directory

Post by Flemur » Sun Nov 03, 2019 8:15 pm

Code: Select all

ls -l /media
will show that /media is owned by root - probably - so

Code: Select all

sudo mkdir /media/Golf
Please edit your original post title to include [SOLVED] if/when it is solved!
Your data and OS are backed up....right?

User avatar
pbear
Level 8
Level 8
Posts: 2425
Joined: Wed Jun 21, 2017 12:25 pm
Location: San Francisco

Re: Create directory

Post by pbear » Sun Nov 03, 2019 11:51 pm

Then, if you want to change ownership to yourself as user:

Code: Select all

sudo chown -R veronica /media/Golf
Time flies like an arrow. Fruit flies like a banana.
If your problem has been solved, please edit the thread title.

User avatar
muffybean
Level 3
Level 3
Posts: 191
Joined: Thu Oct 17, 2019 8:22 am

Re: Create directory

Post by muffybean » Mon Nov 04, 2019 6:28 am

Any particular reason why you want to create a directory there? Usually, that directory /media is used for mounting devices and is owned by root. That's why you're unable to create a subdirectory under /media.
I did not know that and have not seen that directory before. I have a 256GB HDD in addition to the SSD that is my Linux install, that I formatted in ext4 and gave it the name media. If this is an issue I could change this name if there is a directory called media?
Running Linux Mint MATE on 2 desktops + Linux Mint Xfce on Netbook

User avatar
muffybean
Level 3
Level 3
Posts: 191
Joined: Thu Oct 17, 2019 8:22 am

Re: Create directory

Post by muffybean » Mon Nov 04, 2019 6:43 am

Jerry can't see a directory called media in this machine, which is practically set up the same as the other machine, so I am confused
CODE: SELECT ALL

ls -l /media
will show that /media is owned by root - probably - so
Hi Flemur I have just logged on to my backup machine and ran that code you gave above and this is what it returned.
muffy@muffy-GA-78LMT-USB3:~$ ls -l /media
total 12
lrwxrwxrwx 1 root root 7 Oct 24 15:15 floppy -> floppy0
drwxr-xr-x 2 root root 4096 Oct 24 15:15 floppy0
drwxr-x---+ 2 root root 4096 Nov 3 15:17 muffy
drwxr-x---+ 2 root root 4096 Nov 3 15:17 root
muffy@muffy-GA-78LMT-USB3:~$
As you can see it does not mention a directory called media on this machine. Both machines are running MATE but on the 3rd machine I refer to in this thread I just formatted the the HDD and named it media and was unaware that there is a directory called media in the root. Just taken a snapshot in file manager with hidden files shown and can't see media in that either.
Muffy root folder?
Muffy root folder?
I assume on this machine muffy is the root; am I missing something here, should I change the name of that HDD from media to something else?
Running Linux Mint MATE on 2 desktops + Linux Mint Xfce on Netbook

RIH
Level 4
Level 4
Posts: 486
Joined: Sat Aug 22, 2015 3:47 am

Re: Create directory

Post by RIH » Mon Nov 04, 2019 6:51 am

Media is in root.. you're in home...
media.png
Aspire-TC-705 Kernel: 4.15.0-70-generic x86_64 bits: 64
compiler: gcc v: 7.3.0 Desktop: Cinnamon 4.2.3
Distro: Linux Mint 19.2

User avatar
muffybean
Level 3
Level 3
Posts: 191
Joined: Thu Oct 17, 2019 8:22 am

Re: Create directory

Post by muffybean » Mon Nov 04, 2019 7:06 am

Media is in root.. you're in home...
Thank you RIH for pointing that out to me, I have just seen it now. I have only been using Linux for three weeks and it is a steep learning curve :) Especially as I am working on three different machines with it, besides my main machine with Windows 10 only! I will rename that HDD to something else but will note the names in that file system. That is another chip off the learning block finding out about the difference between home and root!
Running Linux Mint MATE on 2 desktops + Linux Mint Xfce on Netbook

User avatar
JerryF
Level 11
Level 11
Posts: 3873
Joined: Mon Jun 08, 2015 1:23 pm
Location: Rhode Island, USA

Re: Create directory

Post by JerryF » Mon Nov 04, 2019 8:34 am

In File Manager, clicking on Filesystem in Mint is similar to clicking on C: in Windows. Those are the uppermost directories in each OS.

Also, in Mint, clicking on Home is similar to clicking on C:\Users\muffy
IF your problem has been solved, please edit your ORIGINAL post and add [SOLVED] to the beginning of the Subject Line. It helps other members when browsing posts.

User avatar
JerryF
Level 11
Level 11
Posts: 3873
Joined: Mon Jun 08, 2015 1:23 pm
Location: Rhode Island, USA

Re: Create directory

Post by JerryF » Mon Nov 04, 2019 8:39 am

muffybean wrote:
Mon Nov 04, 2019 6:28 am
I did not know that and have not seen that directory before. I have a 256GB HDD in addition to the SSD that is my Linux install, that I formatted in ext4 and gave it the name media. If this is an issue I could change this name if there is a directory called media?
You can name a disk "media", but it's not the same thing as creating a directory named media.
IF your problem has been solved, please edit your ORIGINAL post and add [SOLVED] to the beginning of the Subject Line. It helps other members when browsing posts.

User avatar
muffybean
Level 3
Level 3
Posts: 191
Joined: Thu Oct 17, 2019 8:22 am

Re: Create directory

Post by muffybean » Mon Nov 04, 2019 9:09 am

You can name a disk "media", but it's not the same thing as creating a directory named media.
To avoid any confusion I think I will re-name the disk; thank you as well for pointing out the comparison to windows to root and home. Things like this help to understand things more about Linux.
Running Linux Mint MATE on 2 desktops + Linux Mint Xfce on Netbook

jglen490
Level 5
Level 5
Posts: 691
Joined: Sat Jul 15, 2017 9:57 pm

Re: Create directory

Post by jglen490 » Fri Nov 08, 2019 5:42 pm

Let's not get too wrapped up on naming things, and instead focus on what your command

Code: Select all

ls -l /media
was doing.

The "ls" command directed the OS to display a list of files, the "/media" parameter directed that command at what was INSIDE of the directory called /media. So, yes, logically the OS had no need to list "/media" itself, only the files located inside that directory.
I feel more like I do than I did when I got here.
Toshiba A135-S2386, Intel T2080, ATI Radeon® Xpress 200M Chipset, 2GB RAM, 500GB

Hoser Rob
Level 15
Level 15
Posts: 5600
Joined: Sat Dec 15, 2012 8:57 am

Re: Create directory

Post by Hoser Rob » Sat Nov 09, 2019 11:00 am

Here's a pretty good guide to the file system: http://www.pathname.com/fhs/pub/fhs-2.3 ... MOUNTPOINT

gm10
Level 19
Level 19
Posts: 9709
Joined: Thu Jun 21, 2018 5:11 pm

Re: Create directory

Post by gm10 » Sat Nov 09, 2019 11:12 am

The point is that you should keep your data within your home directory, where you've got full permissions. You should never need to create a directory in /media.

As a side-note, it would be great if you could start quoting people by clicking on the respective button in the upper-right corner of their posts, for that puts their name on the quote and a link back to their post, which makes it easier for everybody reading the thread:
Image
Thanks :)
Tune up your LM 19.x: ppa:gm10/linuxmint-tools

User avatar
muffybean
Level 3
Level 3
Posts: 191
Joined: Thu Oct 17, 2019 8:22 am

Re: Create directory

Post by muffybean » Sat Nov 09, 2019 12:20 pm

gm10 wrote:
Sat Nov 09, 2019 11:12 am
The point is that you should keep your data within your home directory, where you've got full permissions. You should never need to create a directory in /media.

As a side-note, it would be great if you could start quoting people by clicking on the respective button in the upper-right corner of their posts, for that puts their name on the quote and a link back to their post, which makes it easier for everybody reading the thread:
Image
Thanks :)
Thanks for the advice gm10. However, the amount of stuff I'd like to add to my video pc is well over the size of the SSD drive that I have LM installed on, so really want it on the other drive I have on that machine called MultiMedia which is a 256GB HDD; I also back my timeshift stuff to that as well.
Running Linux Mint MATE on 2 desktops + Linux Mint Xfce on Netbook

gm10
Level 19
Level 19
Posts: 9709
Joined: Thu Jun 21, 2018 5:11 pm

Re: Create directory

Post by gm10 » Sat Nov 09, 2019 1:08 pm

muffybean wrote:
Sat Nov 09, 2019 12:20 pm
Thanks for the advice gm10. However, the amount of stuff I'd like to add to my video pc is well over the size of the SSD drive that I have LM installed on, so really want it on the other drive I have on that machine called MultiMedia which is a 256GB HDD; I also back my timeshift stuff to that as well.
Fair enough, I was not specific enough. It's perfectly fine to mount and use that additional drive, but you still won't have to create a folder in /media. Also for ease of access you'll often want to link wherever you mounted that second drive to your home folder, or even mount it there directly (you can change a mount point in the Disks tool).
Tune up your LM 19.x: ppa:gm10/linuxmint-tools

User avatar
muffybean
Level 3
Level 3
Posts: 191
Joined: Thu Oct 17, 2019 8:22 am

Re: Create directory

Post by muffybean » Sat Nov 09, 2019 6:15 pm

gm10 wrote:
Sat Nov 09, 2019 1:08 pm
muffybean wrote:
Sat Nov 09, 2019 12:20 pm
Thanks for the advice gm10. However, the amount of stuff I'd like to add to my video pc is well over the size of the SSD drive that I have LM installed on, so really want it on the other drive I have on that machine called MultiMedia which is a 256GB HDD; I also back my timeshift stuff to that as well.
Fair enough, I was not specific enough. It's perfectly fine to mount and use that additional drive, but you still won't have to create a folder in /media. Also for ease of access you'll often want to link wherever you mounted that second drive to your home folder, or even mount it there directly (you can change a mount point in the Disks tool).
Hi gm I suppose the best place to mount it would be to my video folder, currently this is mount path file:///media/root/MultiMedia. MultiMedia is the name I gave that 256GB HDD. Can you advise how I can mount to that point if that is OK? BTW it is not going so well in my other topic of using SMplayer. I followed the advise I was given, including installing the nVidea driver but still can't get that SMplayer to work.

One other side point is even with mpv Media Player I still do not get all the things to work like reverse F/F, slomo, shifting video backwards and forwards when I select a file from Synology FTP. Works fine from Video folder.
Running Linux Mint MATE on 2 desktops + Linux Mint Xfce on Netbook

gm10
Level 19
Level 19
Posts: 9709
Joined: Thu Jun 21, 2018 5:11 pm

Re: Create directory

Post by gm10 » Sun Nov 10, 2019 7:35 am

Go Mint menu > Disks > left-click the drive to the left and the partition to extend on the right > click the cogs icon below the partitions > select Edit Mount Options > enter your desired Mount Point in the respective field (if it's greyed out disable the session defaults checkbox first).
Tune up your LM 19.x: ppa:gm10/linuxmint-tools

User avatar
muffybean
Level 3
Level 3
Posts: 191
Joined: Thu Oct 17, 2019 8:22 am

Re: Create directory

Post by muffybean » Sun Nov 10, 2019 7:52 am

gm10 wrote:
Sun Nov 10, 2019 7:35 am
Go Mint menu > Disks > left-click the drive to the left and the partition to extend on the right > click the cogs icon below the partitions > select Edit Mount Options > enter your desired Mount Point in the respective field (if it's greyed out disable the session defaults checkbox first).
I went into that and
mount-point.png
but can't fathom the path to alter it to mount in the videos folder. the current is /mnt/MultiMedia. I do not want to mess it up, so can you please advise. TIA.
Running Linux Mint MATE on 2 desktops + Linux Mint Xfce on Netbook

gm10
Level 19
Level 19
Posts: 9709
Joined: Thu Jun 21, 2018 5:11 pm

Re: Create directory

Post by gm10 » Sun Nov 10, 2019 8:27 am

Assuming you do not have a MultiMedia folder in your Videos folder yet, copy & paste this command into a terminal window and run it, then copy & paste the path it will output into that form:

Code: Select all

echo "$(xdg-user-dir VIDEOS)/MultiMedia"
Tune up your LM 19.x: ppa:gm10/linuxmint-tools

Post Reply

Return to “Other topics”