View previous topic :: View next topic |
Author |
Message |
Parev00 n00b
Joined: 11 Mar 2012 Posts: 17
|
Posted: Sun Jun 10, 2012 2:11 am Post subject: Mount network drive fails - Two problems discovered? |
|
|
Hi
I've got a network drive that I can mount as root with the proper terminal commands.
I'm trying to get it to mount automatically for all users on boot.
I think I have two problems.
1. /etc/fstab is processed during boot before dhcpd gets an IP address, so the mount fails. Is there a way to fix this without giving my box a static IP?
2. The mount location is visible to all users. As root, I can navigate to it, browse it, all is good. As a user, I can see it, but I can't get into the folder.
Output of stat command:
Code: | DellOptiPlex john # stat /mnt/j_nas/
File: `/mnt/j_nas/'
Size: 0 Blocks: 0 IO Block: 16384 directory
Device: 18h/24d Inode: 268435585 Links: 2
Access: (0770/drwxrwx---) Uid: ( 0/ root) Gid: (11578/ UNKNOWN)
Access: 2012-06-09 17:57:35.000000000 -0700
Modify: 2012-05-16 21:30:45.000000000 -0700
Change: 2012-05-16 21:30:45.000000000 -0700
Birth: -
|
I thought I had a permissions problem, so I tried to change it as root, but got denied.
Code: | DellOptiPlex john # chmod a+rwx /mnt/j_nas
chmod: changing permissions of `/mnt/j_nas': Permission denied
|
I saw a web post on using the chattr command, and I tried that too.
Code: | DellOptiPlex john # chattr -i /mnt/j_nas/
chattr: Inappropriate ioctl for device while reading flags on /mnt/j_nas/
|
And the /etc/fstab
Code: | /dev/sda5 /boot ext2 noauto,noatime 1 2
/dev/sda7 / ext3 noatime 0 1
/dev/sda6 none swap sw 0 0
/dev/cdrom /mnt/cdrom auto noauto,ro 0 0
#/dev/fd0 /mnt/floppy auto noauto 0 0
//192.168.1.202/j_nas_drive /mnt/j_nas auto,users,cifs,rw credentials=/etc/j_nas_share.credentials 0 0
/dev/sda1 /mnt/windows ntfs-3g users 0 0 s
|
Any help greatly appreciated! |
|
Back to top |
|
|
HeissFuss Guru
Joined: 11 Jan 2005 Posts: 414
|
Posted: Sun Jun 10, 2012 2:47 am Post subject: Re: Mount network drive fails - Two problems discovered? |
|
|
Parev00 wrote: | Hi
1. /etc/fstab is processed during boot before dhcpd gets an IP address, so the mount fails. Is there a way to fix this without giving my box a static IP?
|
Add _netdev to your list of mount options in fstab. Also, it looks like your fstab entry is not valid. The filesystem type should be cifs.
I don't know about your permission issue though. Maybe noperm mount option would avoid it? You'd be exposing the entire share rw to anyone on the system though. |
|
Back to top |
|
|
Parev00 n00b
Joined: 11 Mar 2012 Posts: 17
|
Posted: Sun Jun 10, 2012 6:09 am Post subject: |
|
|
OK so this one seems to work now. Everything boots, and the network share get loaded after the network comes up.
Code: | /dev/sda5 /boot ext2 noauto,noatime 1 2
/dev/sda7 / ext3 noatime 0 1
/dev/sda6 none swap sw 0 0
/dev/cdrom /mnt/cdrom auto noauto,ro 0 0
#/dev/fd0 /mnt/floppy auto noauto 0 0
//192.168.1.202/j_nas_drive /mnt/j_nas cifs auto,noperm,users,_netdev,credentials=/etc/j_nas_share.credentials 0 0
/dev/sda1 /mnt/windows ntfs-3g users 0 0 s
|
But you are suggesting that this is a security risk? So any suggestions on how I can take out the noperm attribute and restrict the share to one particular user? |
|
Back to top |
|
|
Parev00 n00b
Joined: 11 Mar 2012 Posts: 17
|
Posted: Sun Jun 10, 2012 6:22 am Post subject: |
|
|
Following up on my previous post, I now have this fstab:
Code: | /dev/sda5 /boot ext2 noauto,noatime 1 2
/dev/sda7 / ext3 noatime 0 1
/dev/sda6 none swap sw 0 0
/dev/cdrom /mnt/cdrom auto noauto,ro 0 0
#/dev/fd0 /mnt/floppy auto noauto 0 0
//192.168.1.202/j_nas_drive /mnt/j_nas cifs auto,uid=1000,_netdev,credentials=/etc/j_nas_share.credentials 0 0
/dev/sda1 /mnt/windows ntfs-3g users 0 0 s
|
Given that UID=1000 is the user I want to have access, is that tighter security? |
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|