启动linux的时候怎么自动挂载win分区?
linux吧
全部回复
仅看楼主
level 11
shell_way 楼主
RT,怎么在启动系统(不是启动Xorg)的时候自动挂载win的分区呢?
2010年07月20日 10点07分 1
level 14
/dev/sda1       /mnt/sda1       vfat,umask=0    iocharset=cp936,codepage=936,noauto,ro,exec     0       0
我一般写成[不]自动挂载。

2010年07月20日 11点07分 4
level 13
用UUID可以避免在分区改动的时候出现问题
2010年07月20日 12点07分 7
level 1
回复:4楼
不自动挂载还要你写么
2010年07月20日 15点07分 8
level 11
我先睡先…明天给你贴个脚本。
2010年07月20日 15点07分 10
level 11
呃…
2010年07月20日 16点07分 11
level 11
等审核完了你好好研究吧。。。。XD
2010年07月21日 00点07分 12
level 4
学些了~~~~~
2010年07月21日 14点07分 13
level 11
这是一个shell脚本
===================================
#!/bin/sh
#
#autowinfs auto mount windows disks
#
# Copyright (c) 2005 Jiahua Huang <[email protected]>
#License: GPLv2
#
# /usr/bin/sutowinfs
# 用来自动挂载机器上的 Windows 分区 , 并写入 /etc/fstab
# 五 2月 18 14:06:12 CST 2005

2010年07月21日 14点07分 14
level 1
回复:9楼
哦 明白了 这样省事些 不用每次手动挂载的时候加umask iocharset等参数了 直接mount就可以 对不对?
2010年07月21日 14点07分 15
level 14
请14楼放心发完,我会把插楼的清掉或移到下方。
2010年07月21日 14点07分 16
level 11
omg。。。审核啊审核。。。垃圾审核!!!
我贴我的空间里了。
http://hi.baidu.com/0xan/blog/item/f76af420bd6babfed7cae2ca.html
2010年07月21日 14点07分 17
level 11
这是一个shell脚本
===================================
#!/bin/sh
#
#autowinfs auto mount windows disks
#
# Copyright (c) 2005 Jiahua Huang <[email protected]>
#License: GPLv2
#
# /usr/bin/sutowinfs
# 用来自动挂载机器上的 Windows 分区 , 并写入 /etc/fstab
# 五 2月 18 14:06:12 CST 2005
mkdir -p /windows/
rmdir /windows/* 1> /dev/null
grep -v '/windows/' /etc/fstab > /etc/fstab.swp
# 本脚本用于 UTF-8 的 Locale 下 , 如果是 GBK 的 locale , 就把 下面的 iocharset=utf8 换成 iocharset=cp936
# 单独的 fdisk -l 不能列出分区的情况很少了 , 所以把 /dev/[hs]d[a-z] 去掉
## fdisk -l /dev/[hs]d[a-z] | grep -E 'FAT|NTFS' | cut -d' ' -f1 | cut -d/ -f3 | while read WDISKS
# 查找 NTFS 分区 , 新内核的 auto 好像有点问题 , 所以现在把 NTFS 和 VFST 分开来
fdisk -l /dev/[hs]d[a-z] | grep 'NTFS' | cut -d' ' -f1 | cut -d/ -f3 | while read WDISKS
do echo "/dev/$WDISKS /windows/$WDISKS ntfs auto,user,iocharset=utf8,umask=0 0 0" >> /etc/fstab.swp
mkdir "/windows/$WDISKS"
done
fdisk -l /dev/[hs]d[a-z] | grep 'FAT' | cut -d' ' -f1 | cut -d/ -f3 | while read WDISKS
do echo "/dev/$WDISKS /windows/$WDISKS vfat auto,user,iocharset=utf8,umask=0 0 0" >> /etc/fstab.swp
mkdir "/windows/$WDISKS"
done
mv /etc/fstab.swp /etc/fstab
mount -a
exit 0
=====================================

2010年07月21日 15点07分 18
level 11

mkdir -p /windows/
rmdir /windows/* 1> /dev/null
grep -v '/windows/' /etc/fstab > /etc/fstab.swp
# 本脚本用于 UTF-8 的 Locale 下 , 如果是 GBK 的 locale , 就把 下面的 iocharset=utf8 换成 iocharset=cp936
# 单独的 fdisk -l 不能列出分区的情况很少了 , 所以把 /dev/[hs]d[a-z] 去掉
## fdisk -l /dev/[hs]d[a-z] | grep -E 'FAT|NTFS' | cut -d' ' -f1 | cut -d/ -f3 | while read WDISKS

2010年07月21日 15点07分 19
level 11

mkdir -p /windows/
rmdir /windows/* 1> /dev/null
grep -v '/windows/' /etc/fstab > /etc/fstab.swp
# 本(和谐)脚(和谐)本用于 UTF-8 的 Locale 下 , 如(和谐)果(和谐)是 GBK 的(和谐) locale , 就(和谐)把 (和谐)下(和谐)面的 iocharset=utf8 换(和谐)成 iocharset=cp936
# 单(和谐)独(和谐)的 fdisk -l 不能列(和谐)出(和谐)分区的(和谐)情(和谐)况(和谐)很(和谐)少了 , 所(和谐)以(和谐)把 /dev/[hs]d[a-z] 去(和谐)掉
## fdisk -l /dev/[hs]d[a-z] | grep -E 'FAT|NTFS' | cut -d' ' -f1 | cut -d/ -f3 | while read WDISKS

2010年07月21日 15点07分 20
1 2 尾页