mkdir and mounting saying "special device does not exist"
Linux - NewbieThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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.
Distribution: Void, Linux From Scratch, Slackware64
Posts: 3,165
Rep:
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.
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
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.).
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.
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".
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.
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.
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:
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. ;-)
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.