ubuntu无法读取windows下的硬盘
出错信息
Error mounting /dev/sda6 at /media/jcuan/media: Command-line `mount -t "ntfs" -o "uhelper=udisks2,nodev,nosuid,uid=1000,gid=1000,dmask=0077,fmask=0177" "/dev/sda6" "/media/jcuan/media"' exited with non-zero exit status 14: The disk contains an unclean file system (0, 0).
Metadata kept in Windows cache, refused to mount.
原因
windows8之后启用的fast startup
In normal shut down process, power is removed from all components such as CPU, RAM, CD-Rom and hard disks. But in fast start up, Windows 8 saves some system information such as caching the registry etc to a file during shutdown. Part of the metadata about the state of all mounted partitions at the time of turn-off, is among these system information. This reduces the boot time of the Windows 8 but it creates the trouble for Ubuntu.Since the information about the NTFS partition is stored in Windows 8, this prevents Ubuntu to mount them as mounting them in Linux will alter the metadata of the partitions. This is why it is in protected mode and you cannot mount it (without being root).
解决办法
1.利用ntfsfix
sudo ntfsfix /dev/sdXY //sdXY为出错的分区代号,比如sda7
2.在windows里关闭windows的快速启动
在电源选项里
显示网络已禁用
1.首先停掉network-manager这个服务
sudo service network-manager stop
2.删除掉NetworkManager.state这个文件
sudo rm /var/lib/NetworkManager/NetworkManager.state
3.启动network-manager这个服务
sudo service network-manager start
如何查看系统版本号
linux内核版本
cat /proc/version
Linux version 4.2.0-36-generic (buildd@lcy01-27) (gcc version 4.8.2 (Ubuntu 4.8.2-19ubuntu1) ) #42~14.04.1-Ubuntu SMP Fri May 13 17:27:22 UTC 2016
uname -a
此处能查看主机名
Linux JCUAN 4.2.0-36-generic #42~14.04.1-Ubuntu SMP Fri May 13 17:27:22 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
查看linux发行版本
lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 14.04.4 LTS
Release: 14.04
Codename: trusty
打开文件管理器的命令
nautilus
如何使程序可以被ubuntu的启动器搜到
命令行操作内容:
cd /usr/share/applications
vim xxx.desktop
打开需要编辑的文本内容为:
[Desktop Entry]
Version=1.0
Name=xxx
Exec=/home/username/xxx.sh(这个是启动程序需要执行的文件路径名)
Terminal=false
Icon=/home/username/xxx.png(这个是图标)
Type=Application
Categories=Development
下边是vscode的例子
[Desktop Entry]
Name=Visual Studio Code
Comment=Code Editing. Redefined.
GenericName=Text Editor
Exec=/usr/share/code/code --unity-launch %F
Icon=/usr/share/code/resources/app/resources/linux/code.png
Type=Application
StartupNotify=true
StartupWMClass=Code
Categories=Utility;TextEditor;Development;IDE;
MimeType=text/plain;inode/directory;
Actions=new-window;
Keywords=vscode;
X-Desktop-File-Install-Version=0.22
[Desktop Action new-window]
Name=New Window
Name[de]=Neues Fenster
Name[es]=Nueva ventana
Name[fr]=Nouvelle fenêtre
Name[it]=Nuova finestra
Name[ja]=新規ウインドウ
Name[ko]=새 창
Name[ru]=Новое окно
Name[zh_CN]=新建窗口
Name[zh_TW]=開新視窗
Exec=/usr/share/code/code --new-window %F
Icon=/usr/share/code/resources/app/resources/linux/code.png
更新chrome之后点击链接弹出浏览器都是空白页
查看/usr/share/applications/google-chrome.desktop是正常的,但是在~/.local/share/applications
里边还有一个google-chrome.desktop,缺少了一个%U参数
[Desktop Entry]
Encoding=UTF-8
Version=1.0
Type=Application
Name=新标签页 - Google Chrome
Icon=google-chrome.png
Path=/home/jcuan/下载
Exec=/opt/google/chrome/chrome %U
StartupNotify=false
StartupWMClass=Google-chrome
OnlyShowIn=Unity;
X-UnityGenerated=true
locale相关设定
locale的设定及其LANG、LC_ALL、LANGUAGE环境变量的区别
ubuntu中文:locale设定