给vmware的ubuntu虚拟机增加硬盘、增加新的分区并自动挂载
2014-01-17 14:50
549 查看
参考 http://qingyang.me/2012/ubuntu-1204-automatically-mount-other-partitions-on-system-startup/
root@Ubuntu32:/etc/init.d#
把第二块硬盘sdb的信息加入到 /etc/fstab中,就可以自动挂载
root@Ubuntu32:/etc/init.d# cat /etc/fstab
# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point> <type> <options> <dump> <pass>
proc /proc proc nodev,noexec,nosuid 0 0
# / was on /dev/sda1 during installation
UUID=7c76f0b7-85c4-4a27-9bf1-b7c2f3d4aa4e / ext4 errors=remount-ro 0 1
# swap was on /dev/sda5 during installation
UUID=0f42e1e0-a4cb-4b88-9d66-3281612cd77c none swap sw 0 0
/dev/fd0 /media/floppy0 auto rw,user,noauto,exec,utf8 0 0
UUID=8767f1c9-3fa5-49ec-b18d-c2c8600abd34 /home/zhangbin/alex ext4 defaults 0 2
root@Ubuntu32:/etc/init.d#
root@Ubuntu32:/etc/init.d# mount -t /dev/sda3 /home/zhangbin/zbhome
Usage: mount -V : print version
mount -h : print this help
mount : list mounted filesystems
mount -l : idem, including volume labels
So far the informational part. Next the mounting.
The command is `mount [-t fstype] something somewhere'.
Details found in /etc/fstab may be omitted.
mount -a [-t|-O] ... : mount all stuff from /etc/fstab
mount device : mount device at the known place
mount directory : mount known device here
mount -t type dev dir : ordinary mount command
Note that one does not really mount a device, one mounts
a filesystem (of the given type) found on the device.
One can also mount an already visible directory tree elsewhere:
mount --bind olddir newdir
or move a subtree:
mount --move olddir newdir
One can change the type of mount containing the directory dir:
mount --make-shared dir
mount --make-slave dir
mount --make-private dir
mount --make-unbindable dir
One can change the type of all the mounts in a mount subtree
containing the directory dir:
mount --make-rshared dir
mount --make-rslave dir
mount --make-rprivate dir
mount --make-runbindable dir
A device can be given by name, say /dev/hda1 or /dev/cdrom,
or by label, using -L label or by uuid, using -U uuid .
Other options: [-nfFrsvw] [-o options] [-p passwdfd].
For many more details, say man 8 mount .
=============
这次新增加一个分区
================
挂载一个新增加的分区到一个目录下:
root@Ubuntu32:/etc/init.d# mount -t ext4 /dev/sda3 /home/zhangbin/zbhome
root@Ubuntu32:/etc/init.d#
把这个命令加入到 /etc/rc.local
==============
参考 http://www.blogbus.com/apit-logs/62852260.html
这个文章还介绍了一个mount的封装的py工具:
[sudo] password for zhangbin:
root@Ubuntu32:/home/zhangbin# apt-get install mountpy
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following NEW packages will be installed:
mountpy
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 12.4 kB of archives.
After this operation, 98.3 kB of additional disk space will be used.
Get:1 http://us.archive.ubuntu.com/ubuntu/ precise/universe mountpy i386 0.8.1 [12.4 kB]
Fetched 12.4 kB in 0s (21.8 kB/s)
Selecting previously unselected package mountpy.
(Reading database ... 566309 files and directories currently installed.)
Unpacking mountpy (from .../mountpy_0.8.1_i386.deb) ...
Processing triggers for man-db ...
Setting up mountpy (0.8.1) ...
root@Ubuntu32:/home/zhangbin#
root@Ubuntu32:/home/zhangbin#
root@Ubuntu32:/home/zhangbin# mountpy
/dev/sdb seems to be already mounted on /home/zhangbin/alex
/dev/sda3 seems to be already mounted on /home/zhangbin/zbhome
/dev/sda1 seems to be already mounted on /
Found nothing to mount
root@Ubuntu32:/home/zhangbin# gedit /etc/rc.local
root@Ubuntu32:/home/zhangbin#
root@Ubuntu32:/etc/init.d#
把第二块硬盘sdb的信息加入到 /etc/fstab中,就可以自动挂载
root@Ubuntu32:/etc/init.d# cat /etc/fstab
# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point> <type> <options> <dump> <pass>
proc /proc proc nodev,noexec,nosuid 0 0
# / was on /dev/sda1 during installation
UUID=7c76f0b7-85c4-4a27-9bf1-b7c2f3d4aa4e / ext4 errors=remount-ro 0 1
# swap was on /dev/sda5 during installation
UUID=0f42e1e0-a4cb-4b88-9d66-3281612cd77c none swap sw 0 0
/dev/fd0 /media/floppy0 auto rw,user,noauto,exec,utf8 0 0
UUID=8767f1c9-3fa5-49ec-b18d-c2c8600abd34 /home/zhangbin/alex ext4 defaults 0 2
root@Ubuntu32:/etc/init.d#
root@Ubuntu32:/etc/init.d# mount -t /dev/sda3 /home/zhangbin/zbhome
Usage: mount -V : print version
mount -h : print this help
mount : list mounted filesystems
mount -l : idem, including volume labels
So far the informational part. Next the mounting.
The command is `mount [-t fstype] something somewhere'.
Details found in /etc/fstab may be omitted.
mount -a [-t|-O] ... : mount all stuff from /etc/fstab
mount device : mount device at the known place
mount directory : mount known device here
mount -t type dev dir : ordinary mount command
Note that one does not really mount a device, one mounts
a filesystem (of the given type) found on the device.
One can also mount an already visible directory tree elsewhere:
mount --bind olddir newdir
or move a subtree:
mount --move olddir newdir
One can change the type of mount containing the directory dir:
mount --make-shared dir
mount --make-slave dir
mount --make-private dir
mount --make-unbindable dir
One can change the type of all the mounts in a mount subtree
containing the directory dir:
mount --make-rshared dir
mount --make-rslave dir
mount --make-rprivate dir
mount --make-runbindable dir
A device can be given by name, say /dev/hda1 or /dev/cdrom,
or by label, using -L label or by uuid, using -U uuid .
Other options: [-nfFrsvw] [-o options] [-p passwdfd].
For many more details, say man 8 mount .
=============
这次新增加一个分区
================
挂载一个新增加的分区到一个目录下:
root@Ubuntu32:/etc/init.d# mount -t ext4 /dev/sda3 /home/zhangbin/zbhome
root@Ubuntu32:/etc/init.d#
把这个命令加入到 /etc/rc.local
==============
参考 http://www.blogbus.com/apit-logs/62852260.html
这个文章还介绍了一个mount的封装的py工具:
[sudo] password for zhangbin:
root@Ubuntu32:/home/zhangbin# apt-get install mountpy
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following NEW packages will be installed:
mountpy
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 12.4 kB of archives.
After this operation, 98.3 kB of additional disk space will be used.
Get:1 http://us.archive.ubuntu.com/ubuntu/ precise/universe mountpy i386 0.8.1 [12.4 kB]
Fetched 12.4 kB in 0s (21.8 kB/s)
Selecting previously unselected package mountpy.
(Reading database ... 566309 files and directories currently installed.)
Unpacking mountpy (from .../mountpy_0.8.1_i386.deb) ...
Processing triggers for man-db ...
Setting up mountpy (0.8.1) ...
root@Ubuntu32:/home/zhangbin#
root@Ubuntu32:/home/zhangbin#
root@Ubuntu32:/home/zhangbin# mountpy
/dev/sdb seems to be already mounted on /home/zhangbin/alex
/dev/sda3 seems to be already mounted on /home/zhangbin/zbhome
/dev/sda1 seems to be already mounted on /
Found nothing to mount
root@Ubuntu32:/home/zhangbin# gedit /etc/rc.local
root@Ubuntu32:/home/zhangbin#
相关文章推荐
- Ubuntu 增加全新硬盘 分区及开机自动挂载
- ubuntu增加新分区挂载空闲硬盘的方法
- UBUNTU手工自动挂载其他硬盘分区
- [虚拟机VMware_Ubuntu]VMware虚拟机Ubuntu增加硬盘空间及Android4.1源代码下载
- Ubuntu设置开机自动挂载所有格式硬盘分区
- Ubuntu设置开机自动挂载所有格式硬盘分区
- 在VMware中给Solaris增加新硬盘并进行分区和挂载
- VMWARE 虚拟机新增硬盘,格式化分区,并挂载
- ubuntu下开始自动挂载硬盘分区
- 在VMware中给Solaris增加新硬盘并进行分区和挂载
- ubuntu 双硬盘挂载 windows分区自动挂载
- ubuntu开机自动挂载Windows分区硬盘 用ntfs-config
- Ubuntu设置开机自动挂载所有格式硬盘分区
- vmware下扩展ubuntu系统磁盘、分区并自动挂载
- Ubuntu 16.04 UUID 开机自动挂载硬盘
- 扩展 VMware 虚拟机的磁盘空间(非增加一个硬盘)
- VirtualBox下Ubuntu虚拟机共享文件夹、自动挂载相关配置
- Fedora 9 硬盘安装 配置 3D 以及开机自动挂载分区 firefox脱机状态 网络激活问题解决
- vmware ubuntu14.04虚拟机不能正常拷贝文件到windows且不能自适应虚拟机屏幕窗口自动变化的解决办法
- Ubuntu 12.04开机自动挂载Windows分区