Thursday, May 2, 2024
 Popular · Latest · Hot · Upcoming
0
rated 0 times [  0] [ 0]  / answers: 1 / hits: 3989  / 1 Year ago, sun, may 14, 2023, 4:50:39

I am having some issue after adding users i am able to access my ftp fine, but while i am trying to mount a shared folder following error:
command i am using is



sudo mount --bind /newhd/shareddocs /home/foc


Error is:



mount: special device /newhd/shareddocs does not exist


and the result of mount command is



$ sudo mount
/dev/sda1 on / type ext4 (rw,errors=remount-ro)
proc on /proc type proc (rw,noexec,nosuid,nodev)
sysfs on /sys type sysfs (rw,noexec,nosuid,nodev)
none on /sys/fs/fuse/connections type fusectl (rw)
none on /sys/kernel/debug type debugfs (rw)
none on /sys/kernel/security type securityfs (rw)
udev on /dev type devtmpfs (rw,mode=0755)
devpts on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=0620)
tmpfs on /run type tmpfs (rw,noexec,nosuid,size=10%,mode=0755)
none on /run/lock type tmpfs (rw,noexec,nosuid,nodev,size=5242880)
none on /run/shm type tmpfs (rw,nosuid,nodev)
/dev/sdb1 on /media/NEWHD type ext4 (rw)
gvfs-fuse-daemon on /home/itpchr/.gvfs type fuse.gvfs-fuse-daemon (rw,nosuid,nodev,user=itpchr)


Here are the contents of /etc/fstab:



# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
#
proc /proc proc nodev,noexec,nosuid 0 0
# / was on /dev/sda1 during installation
UUID=534bc4e4-868c-4c7c-a026-66338953bd46 / ext4 errors=remount-ro 0 1
# swap was on /dev/sda5 during installation
UUID=8b4fed1f-8b32-4b90-9c50-0d4b21b0ebfb none swap sw 0 0
/dev/fd0 /media/floppy0 auto rw,user,noauto,exec,utf8 0 0

/dev/sdb1 /media/NEWHD ext4


Please tell me the exact command to mount a shared folder on NEWHD to foc user directory.


More From » mount

 Answers
1

I think there are many things you could do better in your configuration, such as using either UUID or disk labels instead of the /dev/sdxx notation (since that can change).



But the main problem seems to be that you are specifying /newhd/shareddocs in the problem command, but the actual mount point is /media/newhd/shareddocs.



EDIT1



If you want to mount a subdirectory of the partition /dev/sdb1, then you would need to first mount the partition, and then mount the directory within that partition, I think. I normally just use sharing, but I believe you would do it this way if using fstab:



/dev/sdb1 /media/NEWHD ext4
/media/NEWHD/shareddocs /home/foc


Or, if you don't want to edit fstab, you can use mount without --bind
sudo mount /newhd/shareddocs /home/foc



EDIT2
Personally, I have no experience with the bind option - I normally just use symbolic links, which work fine for what I have needed. Not there are good reasons for using bind, and it is a good way to mirror a directory structure without creating a special file that may not work in all situations.



So, there are a couple of tricks that might help, although I think the solution is simply to add "bind" as an option in /etc/fstab.



There is another file similar to fstab in the same directory, named /etc/mtab; this file shows all the current mounts, whether done via the mount command or via the fstab file. So, you can look at this file (cat /etc/mtab, or use gedit), and copy the line that is working into /etc/fstab. I believe you will find that the line is /media/NEWHD/SharedDOCS /home/foc none rw,bind 0 0.



The other trick is useful whenever you are making changes to /etc/fstab. After you make a change, save the changed file but don't close it yet. Then, go to the terminal and enter sudo mount -a - This will mount everything in fstab, and if there are any errors, it will tell you about them now, rather than possibly finding out at boot time. Depending on circumstances, you may need to unmount first if there was an error, then remount using this command.


[#29619] Monday, May 15, 2023, 1 Year  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
admin

Total Points: 459
Total Questions: 112
Total Answers: 109

Location: Equatorial Guinea
Member since Sun, Feb 14, 2021
3 Years ago
;