Ubuntu14.04 升级 SSD 产生的疑问

系统安装、升级讨论
版面规则
我们都知道新人的确很菜,也喜欢抱怨,并且带有浓厚的Windows习惯,但既然在这里询问,我们就应该有责任帮助他们解决问题,而不是直接泼冷水、简单的否定或发表对解决问题没有任何帮助的帖子。乐于分享,以人为本,这正是Ubuntu的精神所在。
回复
poloshiao
论坛版主
帖子: 18279
注册时间: 2009-08-04 16:33

Re: Ubuntu14.04 升级 SSD 产生的疑问

#121

帖子 poloshiao » 2014-11-14 20:22

怎么查看自己的服务启动方式呢?
以下是 Ubuntu 15.04

1. 把下面指令 複製 貼進終端機 執行
ps xao pid,comm | head
PID COMMAND
1 init
2 kthreadd
3 ksoftirqd/0
以下省略
表示是 upstart 啟動
參閱
1-1. http://unix.stackexchange.com/questions ... -the-shell
使用 /sbin/init 搜尋
1-2. 在 ubuntu
upstart 由 /sbin/init 啟動

2. 把下面指令 複製 貼進終端機 執行
ps xao pid,comm | head
PID COMMAND
1 systemd
2 kthreadd
3 ksoftirqd/0
以下省略
表示是 systemd 啟動
參閱
2-1. http://unix.stackexchange.com/questions ... -the-shell
使用 /sbin/init 搜尋

3. 補充
開機 第一個啟動的程序 PID 編號 1
所以 PID 1 就表示第一個啟動的程序

4. 還有許多方法 查看自己的服务启动方式 這裡有一些
http://unix.stackexchange.com/questions ... -the-shell
但是這一篇要適用 Ubuntu 有一些地方需要修正
我的virtualbox好的...原因是开机服务没有开启.我用sysv-rc-conf在virtualbox几个运行等级上加上x,就ok了...然后我把sysv-rc-conf卸载了
要啟動 virtualbox
從 終端機 或 Dash
virtualbox
即可啟動
头像
admin_xyz
帖子: 199
注册时间: 2012-05-26 8:33
系统: Ubuntu 12.04

Re: Ubuntu14.04 升级 SSD 产生的疑问

#122

帖子 admin_xyz » 2014-11-19 14:10

代码: 全选

xyz@benben:~$ ps xao pid,comm | head
  PID COMMAND
    1 init
    2 kthreadd
    3 ksoftirqd/0
    5 kworker/0:0H
    7 rcu_sched
    8 rcuos/0
    9 rcuos/1
   10 rcuos/2
   11 rcuos/3
xyz@benben:~$ 

恩, 是upstart启动的.


问题又来了, virtualbox 中, 客户机无法使用usb设备的问题.

代码: 全选

12.7.7 USB not working
If USB is not working on your Linux host, make sure that the current user is a member of the
vboxusers group. On older hosts, you need to make sure that the user has permission to access
the USB filesystem ( usbfs ), which VirtualBox relies on to retrieve valid information about your
host’s USB devices. The rest of this section only applies to those older systems.
As usbfs is a virtual filesystem, a chmod on /proc/bus/usb has no effect. The permissions
for usbfs can therefore only be changed by editing the /etc/fstab file.
For example, most Linux distributions have a user group called usb or similar, of which the
current user must be a member. To give all users of that group access to usbfs, make sure the
following line is present:
# 85 is the USB group
none
/proc/bus/usb
usbfs
devgid=85,devmode=664
0
0
Replace 85 with the group ID that matches your system (search /etc/group for “usb” or similar).
Alternatively, if you don’t mind the security hole, give all users access to USB by changing “664”
to “666”.
The various distributions are very creative from which script the usbfs filesystem is mounted.
Sometimes the command is hidden in unexpected places. For SuSE 10.0 the mount command
is part of the udev configuration file /etc/udev/rules.d/50-udev.rules . As this distribution
has no user group called usb , you may e.g. use the vboxusers group which was created by
the VirtualBox installer. Since group numbers are allocated dynamically, the following example
uses 85 as a placeholder. Modify the line containing (a linebreak has been inserted to improve
readability)
DEVPATH="/module/usbcore", ACTION=="add",
RUN+="/bin/mount -t usbfs usbfs /proc/bus/usb"
and add the necessary options (make sure that everything is in a single line):
DEVPATH="/module/usbcore", ACTION=="add",
RUN+="/bin/mount -t usbfs usbfs /proc/bus/usb -o devgid=85,devmode=664"
Debian Etch has the mount command in /etc/init.d/mountkernfs.sh . Since that distribu-
tion has no group usb , it is also the easiest solution to allow all members of the group vboxusers
to access the USB subsystem. Modify the line
domount usbfs usbdevfs /proc/bus/usb -onoexec,nosuid,nodev
so that it contains
domount usbfs usbdevfs /proc/bus/usb -onoexec,nosuid,nodev,devgid=85,devmode=664
As usual, replace the 85 with the actual group number which should get access to USB devices.
Other distributions do similar operations in scripts stored in the /etc/init.d directory.


这是从手册上找到的... 但是ubuntu 没有/proc/bus/usb 文件夹...
poloshiao
论坛版主
帖子: 18279
注册时间: 2009-08-04 16:33

Re: Ubuntu14.04 升级 SSD 产生的疑问

#123

帖子 poloshiao » 2014-11-19 14:40

1. guest 要使用 usb 必須在 host 把 guest 登入的使用者 username 加入 group vboxusers

2. 一般 host 與 guest 登入的使用者 username 是同一個
https://www.virtualbox.org/wiki/Downloads
下載 / 安裝 同一版本的 extension packs
就會自動幫你把 登入的使用者 username 加入 group vboxusers
意思是 不必再額外下指令 把 guest 登入的使用者 username 加入 group vboxusers

3. 在虛擬機管理員 / 左側 USB / 啟用 USB 控制器 / 啟用 USB 2.0 控制器 需要打勾
如果你同時有許多 usb 裝置
你也可以在 filter 設定 條件 指定使用哪些 usb 裝置
头像
admin_xyz
帖子: 199
注册时间: 2012-05-26 8:33
系统: Ubuntu 12.04

Re: Ubuntu14.04 升级 SSD 产生的疑问

#124

帖子 admin_xyz » 2014-11-20 8:12

代码: 全选

xyz@benben:~$ cat /etc/group | grep vbox
vboxusers:x:126:xyz
xyz@benben:~$ 
下载的就是同一版本的Extension packs
poloshiao
论坛版主
帖子: 18279
注册时间: 2009-08-04 16:33

Re: Ubuntu14.04 升级 SSD 产生的疑问

#125

帖子 poloshiao » 2014-11-20 8:29

下载的就是同一版本的Extension packs
这是从手册上找到的... 但是ubuntu 没有/proc/bus/usb 文件夹...
The rest of this section only applies to those older systems.
摘譯
從這一段以下 僅適用於 virtualbox 早期版本

你可以不理會
头像
admin_xyz
帖子: 199
注册时间: 2012-05-26 8:33
系统: Ubuntu 12.04

Re: Ubuntu14.04 升级 SSD 产生的疑问

#126

帖子 admin_xyz » 2014-11-20 8:51

poloshiao 写了:
下载的就是同一版本的Extension packs
这是从手册上找到的... 但是ubuntu 没有/proc/bus/usb 文件夹...
The rest of this section only applies to those older systems.
摘譯
從這一段以下 僅適用於 virtualbox 早期版本

你可以不理會

:em19 终于知道为什么 我使用不了usb了.........


原本我以为只要在guest里面安装增强包就可以了..........
万万没想到啊, 还得在host里面装一个Oracle_VM_VirtualBox_Extension_Pack-4.3.18-96516.vbox-extpack


装上就好了......................


感谢大神耐心讲解..... :em02
回复