今天爲將CentOS 下mysql數據庫備份至windows共享目錄,掛載windows共享目錄的時候總是報錯,經過一翻百度之後,終於解決。
[root@www ~]# mount -t cifs -o username=domain\administrator,password=Test123 //192.168.1.10/share /databackup
mount error(13): Permission denied
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)
原因:命令中關於域的格式不對,正確的是:
mount -t cifs -o domain=test.com,username=administrator,password=test123 //192.168.1.10/share /databackup
或
mount -t cifs -o username=domain/administrator,password=test123 //192.168.1.10/share /databackup
/var/log/messages內容:
Sep 26 09:50:40 www kernel: Status code returned 0xc000006d NT_STATUS_LOGON_FAILURE
Sep 26 09:50:40 www kernel: CIFS VFS: Send error in SessSetup = -13
Sep 26 09:50:40 www kernel: CIFS VFS: cifs_mount failed w/return code = -13
[root@www ~]# mount -t cifs -o username=name,password=123 //192.168.1.10/share /databackup
mount error(127): Key has expired
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)
/var/log/messages內容:
Sep 26 09:56:05 www kernel: Status code returned 0xc0000224 NT_STATUS_PASSWORD_MUST_CHANGE
Sep 26 09:56:05 www kernel: CIFS VFS: Send error in SessSetup = -127
Sep 26 09:56:05 www kernel: CIFS VFS: cifs_mount failed w/return code = -127
原因:帳號的密碼過期,將windows帳號的密碼改爲永不過期。
[root@www /]# mount -t cifs -o username=testuser,password=123 //192.168.214.128/npwpw /databackup
mount error(5): Input/output error
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)
Sep 26 11:04:18 www kernel: CIFS VFS: cifs_mount failed w/return code = -5
原因:/databackup已經掛載了,需要先umonut,再mount
讓linux 啓動自動掛載在/etc/fstab中增加
//192.168.1.100/test /media cifs defaults,username=manifold,password=manifolden 0 2
Linux下mount Window的共享文件夾
mount: unknown filesystem type "smbfs’
今天在使用FC6時,發現mount不了windows的共享盤
mount -t smbfs -o username=xxx,password=xxx //hostname/dir /mnt/tmp
mount: unknown filesystem type ’smbfs’
系統已經不能識別smbfs文件系統了
查資料說RHE5的kernel已經不再支持smbfs,而改用Common Internet File Systemcifs(cifs)取代了原有的smbfs,猜想fc6也做了這個改動,所以命令就改爲:
# mount -t cifs -o username=xxx,password=xxx //hostname/dir /mnt/tmp
很順利地mount上了