openSUSE Forums > Network/Internet » Mounting remote fliesystems - Permanent or temporary?

Go Back   openSUSE Forums > Network/Internet
Forums FAQ Members List Search Today's Posts Mark Forums Read

Network/Internet Questions about internet applications, network configuration, usage (SAMBA, network printing, NFS)

Reply
Page 1 of 2 1 2
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 06-Jul-2009, 09:11
suse_tpx60s's Avatar
Busy Penguin
 
Join Date: May 2009
Location: EU
Posts: 406
suse_tpx60s hasn't been rated much yet
Default Mounting remote fliesystems - Permanent or temporary?

I want to mount 4 NTFS filesystems that are on a XP system on the same LAN. At the moment I'm manually mounting them but's it's a pain. Ideally, I'd like them to auto mount when I boot but am not sure of the best way to go about this. I know you put the entries into fstab but what happens if I'm not on the network and the mounts fail? Will it cause a problem with or won't it matter as it gets taken care of automatically?

What's the best practice for my case?
__________________
IBM Thinkpad X60s | Intel L2400 1.66Ghz | Mesa DRI Intel 945GM video | 3GB Ram
openSuSE 11.1 | Linux 2.6.27.29-0.1 pae i686 | KDE 4.3.3
Reply With Quote
  #2 (permalink)  
Old 07-Jul-2009, 03:21
suse_tpx60s's Avatar
Busy Penguin
 
Join Date: May 2009
Location: EU
Posts: 406
suse_tpx60s hasn't been rated much yet
Default Re: Mounting remote fliesystems - Permanent or temporary?

No opinions? I'll try clarify my request.

I have a XP box on which there are 4 drives formatted as NTFS that I need to mount on my openSUSE laptop. The XP box is on the same LAN and subnet as my openSUSE laptop. At the moment I have a script which I manually run to mount these remote filesystems. I'm looking for a way to automate this so they mount at boot.
I know I can just run the script at boot or login but I have a few concerns with how thngs are handles in the event of no network available.
  1. What happens if the path to the filesystem is not avaialble, e.g. I'm not connected to the network at the time of booting or login? I'm assuming the mount just fails without any further problems.
  2. What happens if I've mounted the remote filesystem and the network then fails? Will I get data corruption? What happens to the mounted filesystem? Do I need to unmount it? Is there an elegant way to automatically have the system handle such events?
I'm basically looking for the best practice for mounting remote NTFS filesystems reliably and safely.
__________________
IBM Thinkpad X60s | Intel L2400 1.66Ghz | Mesa DRI Intel 945GM video | 3GB Ram
openSuSE 11.1 | Linux 2.6.27.29-0.1 pae i686 | KDE 4.3.3
Reply With Quote
  #3 (permalink)  
Old 07-Jul-2009, 04:01
Flux Capacitor Penguin
 
Join Date: Jun 2008
Location: GMT+10
Posts: 5,109
ken_yap has a reputation to be proud ofken_yap has a reputation to be proud ofken_yap has a reputation to be proud ofken_yap has a reputation to be proud ofken_yap has a reputation to be proud ofken_yap has a reputation to be proud ofken_yap has a reputation to be proud ofken_yap has a reputation to be proud ofken_yap has a reputation to be proud ofken_yap has a reputation to be proud of
Default Re: Mounting remote fliesystems - Permanent or temporary?

The correct way is to use the smbfs service (/etc/init.d/smbfs). This reads /etc/samba/smbfstab which contains a list of filesystems to mount. It also is sequenced after the network is up so that it won't before that happens. It's probably configured from YaST. I'm guessing, but yast2-samba-client looks like the required package for the YaST menus.

However I don't use it myself, this is what I deduce from reading the comments and knowing how init scripts work. Maybe swerdna can explain it in more detail.
Reply With Quote
  #4 (permalink)  
Old 07-Jul-2009, 04:07
Camaleón
Guest
 
Posts: n/a
Default Re: Mounting remote fliesystems - Permanent or temporary?

suse tpx60s wrote:

> No opinions? I'll try clarify my request.
>
> I have a XP box on which there are 4 drives formatted as NTFS that I
> need to mount on my openSUSE laptop. The XP box is on the same LAN and
> subnet as my openSUSE laptop. At the moment I have a script which I
> manually run to mount these remote filesystems. I'm looking for a way to
> automate this so they mount at boot.
> I know I can just run the script at boot or login but I have a few
> concerns with how thngs are handles in the event of no network
> available.


Well, that's a matter of taste. I don't mount samba shares, just access the
resources via konqueror and smb:// protocol.

But sometines it is usefull to create a static mount point by:

- Editing /etc/fstab and add an entry for your ntfs static mount point
- Going to yast / system / runlevel editor and enable "smbfs" which says is
for "import remote smb/cifs filesystems".

And just try :-)

> - What happens if the path to the filesystem is not avaialble, e.g.
> I'm not connected to the network at the time of booting or login? I'm
> assuming the mount just fails without any further problems.


smbfs script should handle a failure like this at boot time. If cannot
connect with the remote resource, whatever reason, it will just say "smsfs
service.... failed or timeout" and the mount point will not be present once
you login. You can manually mount it later.

> - What happens if I've mounted the remote filesystem and the network
> then fails? Will I get data corruption? What happens to the mounted
> filesystem? Do I need to unmount it? Is there an elegant way to
> automatically have the system handle such events?


The behavior should be same you get when working with a device or resource
that is not available over the network. You just can't access to that
device or if currently working or managing the files, they just become
unaccessible.

> I'm basically looking for the best practice for mounting remote NTFS
> filesystems reliably and safely.


"Test and error" is sometimes a good start point :-)

BTW, I am a bit reluctant with the status of the "ntfs-3g" driver to handle
writing operations. People say is quite safe but I am not so sure about
that :-/

Greetings,

--
Camaleón
Reply With Quote
  #5 (permalink)  
Old 07-Jul-2009, 04:46
Camaleón
Guest
 
Posts: n/a
Default Re: Mounting remote fliesystems - Permanent or temporary?

Camaleón wrote:

> BTW, I am a bit reluctant with the status of the "ntfs-3g" driver to
> handle writing operations. People say is quite safe but I am not so sure
> about that :-/


Oops, my fault O:-)

I was thinking on locally connected devices (i.e., usb hard disks) that
use "ntfs-3g" driver to handle ntfs filesystem, but this does not apply
when accessing or mounting a remote filesystem over the network.

Sorry for the mess.

Greetings,

--
Camaleón
Reply With Quote
  #6 (permalink)  
Old 07-Jul-2009, 10:14
suse_tpx60s's Avatar
Busy Penguin
 
Join Date: May 2009
Location: EU
Posts: 406
suse_tpx60s hasn't been rated much yet
Default Re: Mounting remote fliesystems - Permanent or temporary?

Quote:
Originally Posted by ken_yap View Post
The correct way is to use the smbfs service (/etc/init.d/smbfs). This reads /etc/samba/smbfstab which contains a list of filesystems to mount. It also is sequenced after the network is up so that it won't before that happens. It's probably configured from YaST. I'm guessing, but yast2-samba-client looks like the required package for the YaST menus.

However I don't use it myself, this is what I deduce from reading the comments and knowing how init scripts work. Maybe swerdna can explain it in more detail.
This seems like the way to go, except I have a few problems. I've added the mount points to the smbfstab. When I go to YAST system services smbfs looks like it's started but has a * next to it - like "Yes*". When I click on expert mode suddenly the smbfs service is not running and any attempt to start it comes up with
p, li { white-space: pre-wrap; } /etc/init.d/smbfs start returned 6 (program is not configured):
How do I get the service started?

I have the samba-client installed but not samba. From everything I've read only the samba-client is required for accessing windows shares as I don't intend to share anything on my Linux system. Do I still need to install samba for this to work? I can manually mount and rwx everything on the XP box as things are at the moment.
My smbfstab like like this:
Code:
//IP_address_of_XP_box/shared_drive       /path_to/mount_point      cifs      sername="user name",password=password
The quotes are around username as the username has a space in it.
__________________
IBM Thinkpad X60s | Intel L2400 1.66Ghz | Mesa DRI Intel 945GM video | 3GB Ram
openSuSE 11.1 | Linux 2.6.27.29-0.1 pae i686 | KDE 4.3.3
Reply With Quote
  #7 (permalink)  
Old 07-Jul-2009, 10:29
Flux Capacitor Penguin
 
Join Date: Jun 2008
Location: GMT+10
Posts: 5,109
ken_yap has a reputation to be proud ofken_yap has a reputation to be proud ofken_yap has a reputation to be proud ofken_yap has a reputation to be proud ofken_yap has a reputation to be proud ofken_yap has a reputation to be proud ofken_yap has a reputation to be proud ofken_yap has a reputation to be proud ofken_yap has a reputation to be proud ofken_yap has a reputation to be proud of
Default Re: Mounting remote fliesystems - Permanent or temporary?

I don't know what's with the YaST interface, but try this from the CLI, as root of course:

chkconfig --set smbfs on
rcsmbfs start

and report back.
Reply With Quote
  #8 (permalink)  
Old 07-Jul-2009, 10:44
suse_tpx60s's Avatar
Busy Penguin
 
Join Date: May 2009
Location: EU
Posts: 406
suse_tpx60s hasn't been rated much yet
Default Re: Mounting remote fliesystems - Permanent or temporary?

Ok, I ran those commands. The second one returned
Code:
Mount CIFS File Systems                    unused
YAST still showing the service as described before.

To be clear I ran those commands from a terminal as su.
__________________
IBM Thinkpad X60s | Intel L2400 1.66Ghz | Mesa DRI Intel 945GM video | 3GB Ram
openSuSE 11.1 | Linux 2.6.27.29-0.1 pae i686 | KDE 4.3.3
Reply With Quote
  #9 (permalink)  
Old 07-Jul-2009, 11:00
Flux Capacitor Penguin
 
Join Date: Jun 2008
Location: GMT+10
Posts: 5,109
ken_yap has a reputation to be proud ofken_yap has a reputation to be proud ofken_yap has a reputation to be proud ofken_yap has a reputation to be proud ofken_yap has a reputation to be proud ofken_yap has a reputation to be proud ofken_yap has a reputation to be proud ofken_yap has a reputation to be proud ofken_yap has a reputation to be proud ofken_yap has a reputation to be proud of
Default Re: Mounting remote fliesystems - Permanent or temporary?

Do this, which will give you a trace as it runs smbfs start:

sh -x /etc/init.d/smbfs start

I bet it isn't finding a valid line from smbfstab.
Reply With Quote
  #10 (permalink)  
Old 07-Jul-2009, 11:21
suse_tpx60s's Avatar
Busy Penguin
 
Join Date: May 2009
Location: EU
Posts: 406
suse_tpx60s hasn't been rated much yet
Default Re: Mounting remote fliesystems - Permanent or temporary?

This is the output. Unfortunately it doesn't mean much to me. I did see a rc_status=6 which i assume is that the service isn't running.

Code:
sh -x /etc/init.d/smbfs start                           
+ . /etc/rc.status                                                             
++ LC_ALL=POSIX                                                                
++ export LC_ALL                                                               
++ trap rc_lc SIGWINCH                                                         
++ rc_lc                                                                       
++ test -n ''                                                                  
+++ stty size                                                                  
++ set -- 32 79                                                                
++ LINES=32                                                                    
++ COLUMNS=79                                                                  
++ test 32 -eq 0                                                               
++ test 79 -eq 0                                                               
++ export LINES COLUMNS                                                        
++ case ":$PATH:" in                                                           
++ test -t 1 -a xterm '!=' raw -a xterm '!=' dumb                              
++ stty size                                                                   
+++ echo -en '\033'                                                            
++ esc=$'\E'                                                                   
++ extd=''                                                                     
++ warn=''                                                                     
++ done=''                                                                     
++ attn=''                                                                     
+++ echo -en '\017'                                                            
++ norm=''                                                                     
+++ echo -en '\015                                                  '          
++ stat='                                                           '          
++ rc_done='                                                        done'      
++ rc_running='                                                     running'   
++ rc_failed='                                                      failed'    
++ rc_missed='                                                      missing'   
++ rc_skipped='                                                     skipped'   
++ rc_dead='                                                        dead'      
++ rc_unused='                                                      unused'    
++ rc_unknown='                                                     failed''   
++ rc_reset=''p='                                                              
++ rc_save=''                                                                  
++ rc_restor'='                                                                
++ _rc_service=/etc/init.d/smbfs                                               
++ _rc_status=0                                                                
++ _rc_status_all=0                                                            
++ _rc_todo=start                                                              
++ test start = status                                                         
++ test -n start                                                               
++ cmdline=                                                                    
+ rc_reset                                                                     
+ _rc_status=0                                                                 
+ _rc_status_all=0                                                             
+ rc_check                                                                     
+ _rc_status_ret=0                                                             
+ test 0 -eq 0                                                                 
+ test 0 -eq 0                                                                 
+ return 0                                                                     
+ return 0                                                                     
+ LC_ALL=en_US                                                                 
+ SMBFSTAB=/etc/samba/smbfstab                                                 
+ SMB_CONF=/etc/samba/smb.conf                                                 
+ SMBFS_STATE_FILE=/var/lock/subsys/smbfs                                      
+ SLEEP=1                                                                      
+ TIMEOUT=10                                                                   
+ grep -q ' cifs ' /proc/mounts                                                
+ test 1 -eq 0                                                                 
+ smbfs_used=no                                                                
+ case "$1" in                                                                 
+ grep -q '^[[:space:]]*[^#].*[[:space:]]cifs[[:space:]]' /etc/fstab           
+ rc=1                                                                         
+ '[' '!' -f /etc/samba/smbfstab -a 1 -ne 0 ']'                                
+ echo -n 'Mount CIFS File Systems '                                           
Mount CIFS File Systems + service_used=no                                      
+ '[' 1 -eq 0 ']'                                                              
+ timer=-1                                                                     
+ test -e /etc/samba/smbfstab                                                  
+ read service mountpoint vfstype options                                      
+ case "${service}" in                                                         
+ continue                                                                     
+ read service mountpoint vfstype options                                      
+ case "${service}" in                                                         
+ continue                                                                     
+ read service mountpoint vfstype options                                      
+ case "${service}" in                                                         
+ continue                                                                     
+ read service mountpoint vfstype options                                      
+ case "${service}" in                                                         
+ continue                                                                     
+ read service mountpoint vfstype options                                      
+ case "${service}" in                                                         
+ continue                                                                     
+ read service mountpoint vfstype options                                      
+ case "${service}" in                                                         
+ continue                                                                     
+ read service mountpoint vfstype options                                      
+ case "${service}" in                                                         
+ continue                                                                     
+ read service mountpoint vfstype options                                      
+ case "${service}" in                                                         
+ continue                                                                     
+ read service mountpoint vfstype options                                      
+ case "${service}" in                                                         
+ continue                                                                     
+ read service mountpoint vfstype options                                      
+ case "${service}" in                                                         
+ continue                                                                     
+ read service mountpoint vfstype options                                      
+ case "${service}" in                                                         
+ continue                                                                     
+ read service mountpoint vfstype options                                      
+ test no = no                                                                 
+ rc_status -u                                                                 
+ rc_check                                                                     
+ _rc_status_ret=0                                                             
+ test 0 -eq 0                                                                 
+ test 0 -eq 0                                                                 
+ return 0                                                                     
+ test 0 -gt 7
+ _rc_status_ret=0
+ case "$_rc_todo" in
+ local i
+ for i in '"$@"'
+ case "$i" in
+ echo -e '                                                         unused'
                                                                    unused
+ rc_failed 6
+ rc_reset
+ _rc_status=0
+ _rc_status_all=0
+ rc_check
+ _rc_status_ret=0
+ test 0 -eq 0
+ test 0 -eq 0
+ return 0
+ return 0
+ case "$1" in
+ _rc_status=6
+ rc_check
+ _rc_status_ret=0
+ test 0 -eq 0
+ test 6 -eq 0
+ _rc_status_all=6
+ return 0
+ return 6
+ return 0
+ touch /var/lock/subsys/smbfs
+ rc_exit
+ exit 6
__________________
IBM Thinkpad X60s | Intel L2400 1.66Ghz | Mesa DRI Intel 945GM video | 3GB Ram
openSuSE 11.1 | Linux 2.6.27.29-0.1 pae i686 | KDE 4.3.3
Reply With Quote
Reply
Page 1 of 2 1 2

Bookmarks


Thread Tools
Display Modes

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




 

Search Engine Friendly URLs by vBSEO 3.3.0 RC2