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.
|
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. |
Quote:
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 Quote:
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.). |
Quote:
whoops! my bad missed the 'bind' bit, sorry, must pay attention! |
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.
|
Did you try the fstab line suggested by sgrlscz in post #3?
|
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:
|
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. |
Sorry. I've tried this too and it doesn't work. Gives the same error.
|
Quote:
Quote:
What happens when you try it from the command line? mount --bind /icondir /icon_archive What distribution / version are you running? |
Quote:
|
:)
As stated above /icondir is the source directory. I forgot to ask if you the path is correct. |
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. |
Quote:
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 |
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. ;-)
|
All times are GMT -5. The time now is 10:33 AM. |