ubuntu 自动挂载XP下的分区

1.建立挂载文件夹,用来挂载XP分区,每个分区建立需要建立一个文件夹
cd /media
sudo mkdir SYSTEM
sudo mkdir Program
sudo mkdir study
sudo mkdir other

 

2.查看分区
sudo fdisk -l

Disk /dev/sda: 320.1 GB, 320072933376 bytes
255 heads, 63 sectors/track, 38913 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0xf0b1ebb0

Device Boot Start End Blocks Id System
/dev/sda1 * 1 4047 32507496 7 HPFS/NTFS
/dev/sda2 4048 30130 209505281 f W95 Ext'd (LBA)
/dev/sda5 8096 12142 32507496 7 HPFS/NTFS
/dev/sda6 12143 18800 53480352+ 7 HPFS/NTFS
/dev/sda7 18801 25458 53480352+ 7 HPFS/NTFS

/dev/sda8 4048 8095 32514048 83 Linux
/dev/sda9 25459 29506 32514048 83 Linux
/dev/sda10 29506 30130 5006336 82 Linux swap / Solaris

上面粗体几行就是我要挂载到XP分区


为了确定设备号与分区到对应关系,可以先在文件管理器中将分区都挂载上,再用mount命令查看对应关系:

ckl@ckl-Lenovo-G450:/media$ mount
/dev/sda8 on / type ext4 (rw,errors=remount-ro,commit=0)
proc on /proc type proc (rw,noexec,nosuid,nodev)
sysfs on /sys type sysfs (rw,noexec,nosuid,nodev)
fusectl 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/sda10 on /home type ext4 (rw,commit=0)
binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc (rw,noexec,nosuid,nodev)
/home/ckl/.Private on /home/ckl type ecryptfs (ecryptfs_check_dev_ruid,ecryptfs_cipher=aes,ecryptfs_key_bytes=16,ecryptfs_unlink_sigs,ecryptfs_sig=ca20f372dca0f8d6,ecryptfs_fnek_sig=9da20520d449d7e7)
gvfs-fuse-daemon on /home/ckl/.gvfs type fuse.gvfs-fuse-daemon (rw,nosuid,nodev,user=ckl)
/dev/sda1 on /media/SYSTEM_ type fuseblk (rw,nosuid,nodev,allow_other,blksize=4096,default_permissions)
/dev/sda5 on /media/Program_ type fuseblk (rw,nosuid,nodev,allow_other,blksize=4096,default_permissions)
/dev/sda6 on /media/study_ type fuseblk (rw,nosuid,nodev,allow_other,blksize=4096,default_permissions)
/dev/sda7 on /media/other_ type fuseblk (rw,nosuid,nodev,allow_other,blksize=4096,default_permissions)
/dev/sda3 on /media/dev_ type fuseblk (rw,nosuid,nodev,allow_other,blksize=4096,default_permissions)


3.将挂载命令加入到开机运行脚本中
sudo cp /etc/rc.local /etc/rc.local.bak
sudo gedit /etc/rc.local
在最后一行(exit 0)前添加几行

#开机自动挂载XP下分区
mount /dev/sda1 /media/SYSTEM
mount /dev/sda5 /media/Program
mount /dev/sda6 /media/study
mount /dev/sda7 /media/other

 

 

搞定。之前试了网上说到另外两种方法(修改/etc/fstab,或ntfs-config)都没有成功,在此备份下。

 

你可能感兴趣的:(Solaris,ext,XP,ubuntu,permissions,文件管理器)