卷组扩容
Linux mint采用默认卷组的安装方式
sain@Linux ~ $ df -hl Filesystem Size Used Avail Use% Mounted on udev 3.7G 0 3.7G 0% /dev tmpfs 743M 9.5M 733M 2% /run /dev/mapper/mint--vg-root 213G 132G 71G 66% / tmpfs 3.7G 812K 3.7G 1% /dev/shm tmpfs 5.0M 4.0K 5.0M 1% /run/lock tmpfs 3.7G 0 3.7G 0% /sys/fs/cgroup /dev/sda1 472M 68M 380M 16% /boot cgmfs 100K 0 100K 0% /run/cgmanager/fs tmpfs 743M 32K 743M 1% /run/user/1000
想在卷组 /dev/mapper/mint--vg-root 加入新的硬盘/dev/sdb
1. sain@Linux ~ $ sudo fdisk -l [sudo] password for sain: Disk /dev/sda: 223.6 GiB, 240057409536 bytes, 468862128 sectors Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 4096 bytes I/O size (minimum/optimal): 4096 bytes / 4096 bytes Disklabel type: dos Disk identifier: 0x49aa6c17 Device Boot Start End Sectors Size Id Type /dev/sda1 * 2048 999423 997376 487M 83 Linux /dev/sda2 1001470 468860927 467859458 223.1G 5 Extended /dev/sda5 1001472 468860927 467859456 223.1G 8e Linux LVM Partition 2 does not start on physical sector boundary. Disk /dev/sdb: 298.1 GiB, 320072933376 bytes, 625142448 sectors Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disklabel type: dos Disk identifier: 0xcf13cf13 Device Boot Start End Sectors Size Id Type /dev/sdb1 * 63 625137344 625137282 298.1G 7 HPFS/NTFS/exFAT 2. sain@Linux ~ $ sudo vgdisplay --- Volume group --- VG Name mint-vg System ID Format lvm2 Metadata Areas 1 Metadata Sequence No 3 VG Access read/write VG Status resizable MAX LV 0 Cur LV 2 Open LV 2 Max PV 0 Cur PV 1 Act PV 1 VG Size 223.09 GiB PE Size 4.00 MiB Total PE 57111 Alloc PE / Size 57100 / 223.05 GiB Free PE / Size 11 / 44.00 MiB VG UUID VfTR2Z-OhL3-8w8T-QfSM-uq7L-C0lz-0uPob1
3.创建物理卷PV(Physical Volumes) sain@Linux ~ $ sudo pvcreate /dev/sdb1 WARNING: ntfs signature detected on /dev/sdb1 at offset 3. Wipe it? [y/n]: y Wiping ntfs signature on /dev/sdb1. Physical volume "/dev/sdb1" successfully created 4.sain@Linux ~ $ sudo vgdisplay --- Volume group --- VG Name mint-vg System ID Format lvm2 Metadata Areas 2 Metadata Sequence No 4 VG Access read/write VG Status resizable MAX LV 0 Cur LV 2 Open LV 2 Max PV 0 Cur PV 2 Act PV 2 VG Size 521.18 GiB PE Size 4.00 MiB Total PE 133421 Alloc PE / Size 57100 / 223.05 GiB Free PE / Size 76321 / 298.13 GiB VG UUID VfTR2Z-OhL3-8w8T-QfSM-uq7L-C0lz-0uPob1 5. sudo df -hl Filesystem Size Used Avail Use% Mounted on udev 3.7G 0 3.7G 0% /dev tmpfs 743M 9.5M 733M 2% /run /dev/mapper/mint--vg-root 213G 132G 70G 66% / tmpfs 3.7G 72M 3.6G 2% /dev/shm tmpfs 5.0M 4.0K 5.0M 1% /run/lock tmpfs 3.7G 0 3.7G 0% /sys/fs/cgroup /dev/sda1 472M 68M 380M 16% /boot cgmfs 100K 0 100K 0% /run/cgmanager/fs tmpfs 743M 32K 743M 1% /run/user/1000
逻辑卷 sudo lvdisplay --- Logical volume --- LV Path /dev/mint-vg/root LV Name root VG Name mint-vg LV UUID dKuhdv-ZCRY-5RvR-bxRe-k4KH-p406-HLJW1d LV Write Access read/write LV Creation host, time mint, 2018-05-25 09:30:40 +0800 LV Status available # open 1 LV Size 215.60 GiB Current LE 55194 Segments 1 Allocation inherit Read ahead sectors auto - currently set to 256 6 sain@Linux ~ $ sudo lvextend -L +298G /dev/mint-vg/root Size of logical volume mint-vg/root changed from 215.60 GiB (55194 extents) to 513.60 GiB (131482 extents). Logical volume root successfully resized. 7 sain@Linux ~ $ sudo resize2fs /dev/mint-vg/root resize2fs 1.42.13 (17-May-2015) Filesystem at /dev/mint-vg/root is mounted on /; on-line resizing required old_desc_blocks = 14, new_desc_blocks = 33 The filesystem on /dev/mint-vg/root is now 134637568 (4k) blocks long. sain@Linux ~ $ df -hl Filesystem Size Used Avail Use% Mounted on udev 3.7G 0 3.7G 0% /dev tmpfs 743M 9.5M 733M 2% /run /dev/mapper/mint--vg-root 506G 132G 352G 28% / tmpfs 3.7G 12M 3.7G 1% /dev/shm tmpfs 5.0M 4.0K 5.0M 1% /run/lock tmpfs 3.7G 0 3.7G 0% /sys/fs/cgroup /dev/sda1 472M 68M 380M 16% /boot cgmfs 100K 0 100K 0% /run/cgmanager/fs tmpfs 743M 32K 743M 1% /run/user/1000
文本检索神器 searchmonkey
sudo apt-get install searchmonkey
Agent Ransack (windows)
slickedit linux下的神器
阅读代码堪比 source insight,调试代码堪比 visual studio。
https://blog.csdn.net/huyuan7494/article/details/72897325
代码浏览分析工具understand
https://blog.csdn.net/qq_36355662/article/details/62887174
截图
https://jingyan.baidu.com/article/4ae03de3d71ec43eff9e6bbc.html
提高效率技巧:
1. 建立永久快捷键
参照上面的图示编辑用户目录下的.bashrc文件,添加一行:alias ll="ls -l" 保存退出
然后用source ~/.bashrc(或者 . ~/.bashrc)使修改立刻生效。
2. 为软件建立快捷启动命令模仿subl命令的写sain@Linux /opt/scitools/bin/linux64 $ which subl
/usr/bin/subl sain@Linux /opt/scitools/bin/linux64 $ cat /usr/bin/subl #!/bin/sh exec /opt/sublime_text/sublime_text "$@"
创建文件 /usr/bin/understand
文件添加exec /opt/scitools/bin/linux64/understand
chmod a+x /usr/bin/understand
1. 安装ssh服务:
先安装sudo apt-get install openssh-server
后安装sudo apt-get install openssh-client
显示sshd则表示服务安装成功
sain@Linux ~/Desktop $ ps -A | grep ssh*
1214 ? 00:00:00 cinnamon-sessio
1276 ? 00:00:00 ssh-agent
5389 ? 00:00:00 sshd
2. sougou输入法,网易云音乐,wps,visualstudiocode
http://music.163.com/#/download
http://pinyin.sogou.com/linux/
http://community.wps.cn/download/
https://code.visualstudio.com/?wt.mc_id=DX_841432
安装完sogoupinyin_2.2.0.0102_amd64.deb之后,需要安装fctix.重启
应用程序中搜素fcitx configuration,添加搜狗输入法
3. 安装shadowsocks
通过PPA源安装,仅支持Ubuntu 14.04或更高版本。
打开终端
sudo add-apt-repository ppa:hzwhuang/ss-qt5
sudo apt-get update
sudo apt-get install shadowsocks-qt5
4.安装Guake Terminal和sublime
sudo apt-get install guake
另外可参考
sublime安装参考:
1.下载sublime text3 deb包 wget https://download.sublimetext.com/sublime-text_build-3103_amd64.deb 2.安装sublime text3 sudo dpkg -i sublime-text_build-3103_amd64.de
5. AndroidStudio 配置
归一化配置:
sdk目录:
~/Android_tools/sdk
启动快捷方式:(不一定有效)
[Desktop Entry] Version=1.0 Type=Application Name=AndroidStudio2.3 Comment=AndroidStudio Icon=/opt/android-studio/bin/studio.png Exec=/opt/android-studio/bin/studio.sh Terminal=false StartupNotify=tr
更好的方法是启动androidstudio,Tools菜单下直接创建
6. deepin root 账号设置
deepin系统默认是没有为root账号设置密码的,需要执行下面的指令
sudo passwd root
7.开机自动挂载分区
编辑系统/etc/fstab 文件,默认是以UUID区分各分区
# /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> # / was on /dev/sda7 during installation UUID=20c18c6c-7fc0-4c30-bd9f-d5df7095f2da / ext4 errors=remount-ro 0 1 # /boot was on /dev/sda6 during installation UUID=0ba8d57e-a628-40ad-a106-aa3d56f21ff2 /boot ext4 defaults 0 2 # /home was on /dev/sda8 during installation UUID=55b3eb18-13c2-4e34-90f6-4df36bf449fa /home ext4 defaults 0 2 # swap was on /dev/sda5 during installation UUID=31ed8d6a-2575-4990-8ee5-0f101eb8b975 none swap sw 0 0
查看硬盘信息,可以看到UUID和分区的其实有一一对应关系:
sain@Linux ~/Desktop $ sudo blkid [sudo] password for sain: /dev/sda1: LABEL="ESP" UUID="F46C-A96B" TYPE="vfat" PARTLABEL="EFI system partition" PARTUUID="af5dc20b-b10b-4391-85b2-05e30732df65" /dev/sda3: LABEL="OS" UUID="F2369D40369D06AF" TYPE="ntfs" PARTLABEL="Basic data partition" PARTUUID="ca736ee9-c841-49b9-bd67-454d8e6b7c1e" /dev/sda4: LABEL="Data" UUID="D20C9C1D0C9BFAA5" TYPE="ntfs" PARTLABEL="Basic data partition" PARTUUID="de967f44-f620-4234-b310-6f500384768c" /dev/sda5: UUID="31ed8d6a-2575-4990-8ee5-0f101eb8b975" TYPE="swap" PARTUUID="e7c24756-5ba1-4155-8242-7acee14a432c" /dev/sda6: UUID="0ba8d57e-a628-40ad-a106-aa3d56f21ff2" TYPE="ext4" PARTUUID="f898d6c1-8992-495d-9764-a62c1adb3ab1" /dev/sda7: UUID="20c18c6c-7fc0-4c30-bd9f-d5df7095f2da" TYPE="ext4" PARTUUID="5b45a43d-c981-4f52-adea-53158b5ba79c" /dev/sda8: UUID="55b3eb18-13c2-4e34-90f6-4df36bf449fa" TYPE="ext4" PARTUUID="89854a0e-f085-498d-852e-1afa819d8675" /dev/sda9: LABEL="WINRETOOLS" UUID="F6A0BFFCA0BFC203" TYPE="ntfs" PARTUUID="667d7919-0759-4c4b-8b02-51fbc2f380b2" /dev/sda2: PARTLABEL="Microsoft reserved partition" PARTUUID="97ac0bb1-226a-48b2-8745-343f3827b0d5"
所以,简单起见,挂在某个硬盘
只需要/etc/fstab 在末尾加上一句,保存,重启实现开机自动挂载
/dev/sda4 /media/sain/Data ntfs defaults 0 0
defaults 等于rw,suid,dev,exec,auto,nouser,async
安装软件可能出现的问题:
情况1:
E: 有未能满足的依赖关系。请尝试不指明软件包的名字来运行“apt-get -f install”(也可以指定一个解决办法)。
说明:
因为安装的时候出现了一点问题,最后apt-get的包依赖关系被我搞乱了
解决办法:
在终端输入:apt-get -f install
然后在输入:
sudo apt-get install flex
情况2:
有的时候,使用sudo apt-get install可能导致意想不到的错误,尤其是中途中断了安装时,错误信息为:
Errors were encountered while processing:
ttf-dustin
khangman
kdeedu
kde
E: Sub-process /usr/bin/dpkg returned an error code (1)
此时可以这样解决:
cd /var/lib/dpkg
sudo mv info info.bak
sudo mkdir info
重新安装,在此为:
sudo apt-get --reinstall install ttf-dustin khangman kdeedu kde
推荐的软件,待尝试
http://blog.csdn.net/skykingf/article/details/45267517
Ubuntu增加快捷图标
[Desktop Entry] Encoding=UTF-8 Name=Android Studio Comment=android studio Exec=/opt/android-studio/bin/studio.sh Icon=/opt/android-studio/bin/bin/studio.png Terminal=false StartupNotify=true Type=Application
win7 远程桌面ubuntu16.04
使用win10远程控制ubuntu16.04
使用win10远程控制ubuntu16.04,网上很多需要安装xfce桌面的。今天介绍一下,不需要安装其他桌面,使用Ubuntu16.04自带桌面,漂亮美观。
Ubuntu16.04端:
1、打开终端,安装xrdp,vncserver
sudo apt-get install xrdp vnc4server xbase-clients
2、安装desktop sharing(Ubuntu16.04默认已经安装),可以到应用商店下载。打开desktop sharing,设置如下:
![]()
3、安装安装dconf-editor,取消权限限制:
sudo apt-get install dconf-editor
dconf-editor设置:org > gnome > desktop > remote-access,取消 “requlre-encryption”
Win10端:
搜索远程桌面连接,输入Ubuntu的ip地址,点击连接。
![]()
选择vnc-any,输入Ubuntu的ip地址,端口不变(5900),桌面共享设定的密码,即可远程连接到ubuntu 16.04桌面。
参考http://www.linuxdiyf.com/linux/27078.html
dconf-editor有一定概率启动不了
Starting dconf-editor: imediately crashes: (dconf-editor:15007): GLib-GIO-ERROR **: Settings schema 'ca.desrt.dconf-editor.Settings' is not installed Trace/breakpoint trap (core dumped) sudo glib-compile-schemas /usr/share/glib-2.0/schemas/
|
误删/var/lib/dpkg/info 解决办法
1、手动新建info目录:
mkdir/var/lib/dpkg/info
2、重新刷新软件安装列表
sudo apt-get upgrade
sudo apt-get install dis-upgrade
把所有的软件更新
ubuntu samba配置
安装samba
sudo apt get-install samba
启动时碰到一堆问题,结果发现是由于/etc/samba/smb.conf文件不存在
新建该文件
[global]
security = user
guest ok = yes
dos charset = UTF-8
unix charset = UTF-8
display charset = UTF-8
wins support = yes
time server = yes
[home]
comment = public share
path = /home/ninjame/
valid user = ninjame
browseable = yes
writable = no
[aosp]
comment = public share
path = /home/ninjame/aosp
valid user = ninjame
browseable = yes
writable = yes
[aosp]
comment = public share
guest ok = yes
dos charset = UTF-8
unix charset = UTF-8
display charset = UTF-8
path = /home/sain/aosp
browseable = yes
writable = no
[ftp]
comment = public share
guest ok = yes
dos charset = UTF-8
unix charset = UTF-8
display charset = UTF-8
path = /home/sain/ftp
browseable = yes
writable = yes
增加samba密码
sudo smbpasswd -a user,新增用户,该用户和ubuntu用户不是一回事,一定要加sudo,否则没有任何提示
重启服务
sudo service smbd restart
安装samba过程可能有些过于激进的操作,系统只能进入高级选项,选择一个特定的版本重启,且无法进入正常界面
考虑将系统内核进行升级
参考:http://www.linuxidc.com/Linux/2017-03/141940.htm
找到想升级的版本:http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.4.52/
ninjame@ubuntu1604:~$ uname -sr
Linux 4.4.0-79-generic
wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.4.52/linux-headers-4.4.52-040452_4.4.52-040452.201702260631_all.deb wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.4.52/linux-headers-4.4.52-040452-generic_4.4.52-040452.201702260631_amd64.deb wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.4.52/linux-image-4.4.52-040452-generic_4.4.52-040452.201702260631_amd64.deb
4.4.80
wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.4.80/linux-headers-4.4.80-040480_4.4.80-040480.201708062341_all.deb wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.4.80/linux-headers-4.4.80-040480-generic_4.4.80-040480.201708062341_amd64.deb wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.4.80/ linux-image-4.4.80-040480-generic_4.4.80-040480.201708062341_amd64.deb
以上命令在用户目录~下执行就可以,安装后在/boot 目录生成新文件
下载完成这些所有内核文件后,如下安装:
$ sudo dpkg -i *.deb
安装完成后,重启并验证新的内核已经被使用了:
$ uname -sr
就是这样。你下次就可以使用比 Ubuntu 16.04 默认安装的内核的更新版本了。
安装搜狗输入法
用 im-config 命令打开一个配置器窗口
默认是ibus,需要修改为 fcitx
重启 ubuntu 系统就可以了。