LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 08-30-2018, 06:03 PM   #1
ironclads
LQ Newbie
 
Registered: Aug 2018
Posts: 6

Rep: Reputation: Disabled
Question mkdir and mounting saying "special device does not exist"


I'm pretty new, and yes, rusty since I haven't touched Linux in 10 years +. Through the command line, I'm creating a directory "icon_archive" off root using "mkdir /icon_archive". I'm adding this to /etc/fstab "icondir /icon_archive none defaults,bind 0 0". When I attempt to "mount icondir" it says "special device does not exist." Is this not the way I should go to create a shortcut as it were to the /icon_archive directory? I must be doing something wrong, but I've searched all over and it says basically the same or similar information. I don't remember needing to create a volume just so I can mount it and use it with the short name. Any thoughts for this newbie? Thank you.
 
Old 08-30-2018, 07:05 PM   #2
Keith Hedger
Senior Member
 
Registered: Jun 2010
Location: Wiltshire, UK
Distribution: Void, Linux From Scratch, Slackware64
Posts: 3,153

Rep: Reputation: 856Reputation: 856Reputation: 856Reputation: 856Reputation: 856Reputation: 856Reputation: 856
fstab ojntz file systems, "icondir" is not a file system, the first entry on a line in fstab sbould either be a "/dev/" device node eg "/dev/sdb1" or a device label eg "bigdisk2" or a UUID.

you don't use the fstab file for shortcuts.
 
Old 08-31-2018, 07:09 AM   #3
sgrlscz
Member
 
Registered: Aug 2008
Posts: 123

Rep: Reputation: 84
Quote:
Originally Posted by ironclads View Post
I'm pretty new, and yes, rusty since I haven't touched Linux in 10 years +. Through the command line, I'm creating a directory "icon_archive" off root using "mkdir /icon_archive". I'm adding this to /etc/fstab "icondir /icon_archive none defaults,bind 0 0". When I attempt to "mount icondir" it says "special device does not exist." Is this not the way I should go to create a shortcut as it were to the /icon_archive directory? I must be doing something wrong, but I've searched all over and it says basically the same or similar information. I don't remember needing to create a volume just so I can mount it and use it with the short name. Any thoughts for this newbie? Thank you.
To put a bind mount in fstab, you need to use full paths, otherwise it only works when you're in the parent directory.

The first entry should be the 'source' path and the second is the 'destination' path. For example,

Code:
/icondir   /icon_archive    none     bind    0  0
will mount /icondir to /icon_archive.

Quote:
Originally Posted by Keith Hedger View Post
fstab ojntz file systems, "icondir" is not a file system, the first entry on a line in fstab sbould either be a "/dev/" device node eg "/dev/sdb1" or a device label eg "bigdisk2" or a UUID.

you don't use the fstab file for shortcuts.
He's doing a bind mount, which allows you to mount a directory to another name.

It's useful for keeping application files all on one file system, but mounting the various directories to standard system locations (e.g., /appl/config gets mounted to /etc/appl, /appl/db goes to /var/lib/appl, etc.).
 
Old 08-31-2018, 07:32 AM   #4
Keith Hedger
Senior Member
 
Registered: Jun 2010
Location: Wiltshire, UK
Distribution: Void, Linux From Scratch, Slackware64
Posts: 3,153

Rep: Reputation: 856Reputation: 856Reputation: 856Reputation: 856Reputation: 856Reputation: 856Reputation: 856
Quote:
Originally Posted by sgrlscz View Post
...
He's doing a bind mount, which allows you to mount a directory to another name.
...

whoops! my bad missed the 'bind' bit, sorry, must pay attention!
 
Old 08-31-2018, 09:30 AM   #5
ironclads
LQ Newbie
 
Registered: Aug 2018
Posts: 6

Original Poster
Rep: Reputation: Disabled
Question Thank you...but still stuck

That helped...a little. It still says the same error message, but I then tried putting "/dev/icon_archive" and it said does not exist. I know the dir is "icon_archive" and it exists off the root. I can do a "cd icon_archive" and it changes to that dir. Is there some full path I need to put into the /etc/fstab file with this entry that I'm missing. Thank you again for the help.
 
Old 08-31-2018, 09:34 AM   #6
hydrurga
LQ Guru
 
Registered: Nov 2008
Location: Pictland
Distribution: Linux Mint 21 MATE
Posts: 8,048
Blog Entries: 5

Rep: Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925
Did you try the fstab line suggested by sgrlscz in post #3?
 
Old 08-31-2018, 10:16 AM   #7
ironclads
LQ Newbie
 
Registered: Aug 2018
Posts: 6

Original Poster
Rep: Reputation: Disabled
Sure thing. I did, just as he wrote it. ;-) When I put in "/icondir /icon_archive none bind 0 0" into the /etc/fstab file, save, exit and type "mount /icondir", I get "mount: special device /icondir does not exist".
Quote:
# /etc/fstab
# Created by anaconda on Tue Aug 28 16:28:42 2018
#
# Accessible filesystems, by reference, are maintained under '/dev/disk'
# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info
#
/dev/mapper/vg00-rootlv00 / ext4 defaults 1 1
UUID=ee63723f-6a8c-4d53-a777-9a730f94b661 /boot ext4 defaults 1 2
/dev/mapper/vg00-optlv00 /opt ext4 defaults 1 2
/dev/mapper/vg00-softwarelv00 /software ext4 defaults 1 2
/dev/mapper/vg00-tmplv00 /tmp ext4 defaults 1 2
/dev/mapper/vg00-CernerESMlv00 /usr/cerneresm ext4 defaults 1 2
/dev/mapper/vg00-exportlv00 /usr1/EXPORT ext4 defaults 1 2
/dev/mapper/vg00-varlv00 /var ext4 defaults 1 2
/dev/mapper/vg00-varimagedevlv00 /var/imagedev ext4 defaults 1 2
/dev/mapper/vg00-swaplv00 swap swap defaults 0 0
tmpfs /dev/shm tmpfs defaults 0 0
devpts /dev/pts devpts gid=5,mode=620 0 0
sysfs /sys sysfs defaults 0 0
proc /proc proc defaults 0 0
/icondir /icon_archive none bind 0 0
 
Old 08-31-2018, 10:23 AM   #8
hydrurga
LQ Guru
 
Registered: Nov 2008
Location: Pictland
Distribution: Linux Mint 21 MATE
Posts: 8,048
Blog Entries: 5

Rep: Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925
Once you've created fstab, sudo mount -a tries to mount everything according to the info you've specified in it. That's the way you'll see if it works.

Edit: removed incorrect info - see below.

Last edited by hydrurga; 08-31-2018 at 11:06 AM.
 
Old 08-31-2018, 11:02 AM   #9
ironclads
LQ Newbie
 
Registered: Aug 2018
Posts: 6

Original Poster
Rep: Reputation: Disabled
Sorry. I've tried this too and it doesn't work. Gives the same error.
 
Old 08-31-2018, 11:03 AM   #10
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,759

Rep: Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931
Quote:
The mount command by itself is not aware of fstab.
Yes it is... From the man pages

Quote:
When mounting a filesystem mentioned in fstab or mtab, it suffices to give only the device, or only the mount point.

What happens when you try it from the command line?

mount --bind /icondir /icon_archive

What distribution / version are you running?
 
1 members found this post helpful.
Old 08-31-2018, 11:05 AM   #11
hydrurga
LQ Guru
 
Registered: Nov 2008
Location: Pictland
Distribution: Linux Mint 21 MATE
Posts: 8,048
Blog Entries: 5

Rep: Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925
Quote:
Originally Posted by michaelk View Post
Yes it is... From the man pages
My apologies. I stand corrected.
 
Old 08-31-2018, 11:14 AM   #12
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,759

Rep: Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931


As stated above /icondir is the source directory. I forgot to ask if you the path is correct.
 
Old 08-31-2018, 11:46 AM   #13
ironclads
LQ Newbie
 
Registered: Aug 2018
Posts: 6

Original Poster
Rep: Reputation: Disabled
Firstly, icondir doesn't actually exist anywhere. It is a shortcut name pointing to, or rather, that I'm attempting to point to "/icon_archive" which does exist off root. I've tried "icondir" and "/icondir" in the etc/fstab file. All give "special device does not exist. I've tried "mount --bind /icondir /icon_archive" and that too gives the same error. I've also tried "mount --bind icondir /icon_archive" and that too does the same thing.

From command line, I type: "cat /etc/redhat-release" I get "Red Hat Enterprise Linux Server release 6.9 (Santiago)"

I did actually create the "icondir" directory using mkdir and then these commands work. I don't really want to create a new directory, just another name/shortcut for the "/icon_archive" directory.

Thank you again.

Last edited by ironclads; 08-31-2018 at 11:51 AM.
 
Old 08-31-2018, 12:15 PM   #14
sgrlscz
Member
 
Registered: Aug 2008
Posts: 123

Rep: Reputation: 84
Quote:
Originally Posted by ironclads View Post
Firstly, icondir doesn't actually exist anywhere. It is a shortcut name pointing to, or rather, that I'm attempting to point to "/icon_archive" which does exist off root. I've tried "icondir" and "/icondir" in the etc/fstab file. All give "special device does not exist. I've tried "mount --bind /icondir /icon_archive" and that too gives the same error. I've also tried "mount --bind icondir /icon_archive" and that too does the same thing.

From command line, I type: "cat /etc/redhat-release" I get "Red Hat Enterprise Linux Server release 6.9 (Santiago)"

I did actually create the "icondir" directory using mkdir and then these commands work. I don't really want to create a new directory, just another name/shortcut for the "/icon_archive" directory.

Thank you again.
Mount doesn't work that way. For any mount, both the source and the destination must exist.

Also, what you actually did was mount /icondir over /icon_archive. In that case, if /icon_archive contained anything, it would be hidden. That is the opposite of what you seem to be trying to accomplish. Source is where things are now, destination is where you want them to appear. So, your source is /icon_archive, and your destination is /icondir.

You can create a symbolic link /icondir to point to /icon_archive:

Code:
ln -s /icon_archive /icondir
 
Old 08-31-2018, 12:20 PM   #15
ironclads
LQ Newbie
 
Registered: Aug 2018
Posts: 6

Original Poster
Rep: Reputation: Disabled
Um...ok. That worked. So is this permanent or will it be reset upon reboot? If so, how do I get it to always point correctly? Again, thank you all for your help. Boy its fun being a newbie. ;-)

Last edited by ironclads; 08-31-2018 at 12:22 PM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
After reboot, mount says "special device *LVM* does not exist" mahmoodn Linux - Server 5 04-27-2013 08:18 AM
mounting logical partition - special device does not exist sprockety1 Linux - Software 2 05-02-2010 03:33 AM
[SOLVED] how to simulate "mkdir -p /home/blah1/blah2/blah3" in "c" where only /home exist platinumedge Linux - Newbie 4 10-04-2009 06:28 PM
Mounting a "special device", Read Only hanasi Linux - Newbie 5 09-11-2005 09:06 AM
core linux : mounting ' special device does not exist ' xconspirisist Linux - Software 6 11-06-2003 01:49 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 09:30 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration