海运的博客

ubuntu自动安装preseed分区方法

发布时间:October 6, 2018 // 分类: // No Comments

使用自动分区,标准分区方式:

#d-i partman-auto/disk string /dev/sda
#选择第一个硬盘
d-i partman/early_command string debconf-set partman-auto/disk "$(list-devices disk | head -n1)"
d-i partman-auto/choose_recipe select atomic
d-i partman-auto/method string regular
d-i partman-lvm/device_remove_lvm boolean true
d-i partman-md/device_remove_md boolean true
d-i partman-partitioning/confirm_write_new_label boolean true
d-i partman/choose_partition select finish
d-i partman/confirm boolean true
d-i partman/confirm_nooverwrite boolean true
d-i partman/default_filesystem string ext4
d-i partman/mount_style select uuid

2018-10-06_091417.png

自动LVM分区:

d-i partman-auto/disk string /dev/sda
d-i partman-auto/choose_recipe select atomic
d-i partman-auto/method string lvm
d-i partman-auto-lvm/guided_size string 100%
d-i partman-lvm/confirm boolean true
d-i partman-lvm/confirm_nooverwrite boolean true
d-i partman-lvm/device_remove_lvm boolean true
d-i partman-md/device_remove_md boolean true
d-i partman-partitioning/confirm_write_new_label boolean true
d-i partman/choose_partition select finish
d-i partman/confirm boolean true
d-i partman/confirm_nooverwrite boolean true
d-i partman/default_filesystem string ext4
d-i partman/mount_style select uuid

2018-10-06_091702.png

使用自定义标准分区方案,第一个数字为最小分区大小(MB),第二个获取最大分区的优先级(越小优先级越高),第三个最大分区大小。

d-i partman-auto/disk string /dev/sda
d-i partman-auto/choose_recipe select boot-root
d-i partman-auto/method string regular
d-i partman-lvm/device_remove_lvm boolean true
d-i partman-md/device_remove_md boolean true

d-i partman-auto/expert_recipe string                         \
      boot-root ::                                            \
              5120 1 5120 ext4                                \
                     $primary{ } $bootable{ }                 \
                     method{ format } format{ }               \
                     use_filesystem{ } filesystem{ ext4 }     \
                     mountpoint{ /}                           \
              .                                               \
              1 3 -1 ext4                                     \
                      $primary{ }                             \
                      method{ format } format{ }              \
                      use_filesystem{ } filesystem{ ext4 }    \
                      mountpoint{ /home}                      \
              .                                               \
              1024 2 1024 linux-swap                          \
                      $primary{ }                             \
                      method{ swap } format{ }                \
              .

d-i partman-partitioning/confirm_write_new_label boolean true
d-i partman/choose_partition select finish
d-i partman/confirm boolean true
d-i partman/confirm_nooverwrite boolean true
d-i partman/default_filesystem string ext4
d-i partman/mount_style select uuid

2018-10-06_084106.png

使用自定义分区LVM:

d-i partman-auto/disk string /dev/sda
d-i partman-auto/choose_recipe select boot-lvm
d-i partman-auto/method string lvm
d-i partman-auto-lvm/guided_size string 100%
d-i partman-auto-lvm/new_vg_name string vg00
d-i partman-lvm/device_remove_lvm boolean true
d-i partman-md/device_remove_md boolean true

d-i partman-auto/expert_recipe string                         \
      boot-lvm ::                                             \
              1024 1 1024 ext4                                \
                      $primary{ } $bootable{ }                \
                      method{ format } format{ }              \
                      use_filesystem{ } filesystem{ ext4 }    \
                      mountpoint{ /boot }                     \
              .                                               \
              1 2 -1 ext4                                     \
                      $primary{ }                             \
                      $defaultignore{ }                       \
                      method{ lvm }                           \
                      device{ /dev/sda }                      \
                      vg_name{ vg00 }                         \
              .                                               \
              1024 3 1024 swap                                \
                      $lvmok{ } lv_name{ lv_swap } in_vg{ vg00 } \
                      method{ swap } format{ }                   \
          .                                                      \
              1 4 -1 ext4                                        \
                      $lvmok{} lv_name{ lv_root } in_vg{ vg00 }  \
                      method{ format } format{ }                 \
                      use_filesystem{ } filesystem{ ext4 }       \
                      mountpoint{ / }                            \
          .                                                      

d-i partman-lvm/confirm boolean true
d-i partman-lvm/confirm_nooverwrite boolean true
d-i partman-partitioning/confirm_write_new_label boolean true
d-i partman/choose_partition select finish
d-i partman/confirm boolean true
d-i partman/confirm_nooverwrite boolean true
d-i partman/default_filesystem string ext4
d-i partman/mount_style select uuid

2018-10-06_090807.png
通过preseed自动安装ubuntu系统详细配置文件见:https://www.haiyun.me/archives/1246.html
参考:
https://stackoverflow.com/questions/33923952/ubuntu-14-04-preseed-lvm-disk-config
https://cptyesterday.wordpress.com/2012/06/17/notes-on-using-expert_recipe-in-debianubuntu-preseed-files/

ubuntu18.04编译qbittorrent4.13和libtorrent1.0.11

发布时间:October 5, 2018 // 分类:PT // No Comments

qbittorrent4在使用libtorrent最新版本1.1.9版本时有诸多问题,编译使用1.0.11稳定版本试试。
安装编译环境及libtorrent依赖:

apt-get install build-essential pkg-config automake libtool git
apt-get install libboost-dev libboost-system-dev libboost-chrono-dev libboost-random-dev libssl-dev libgeoip-dev

编译libtorrent:

git clone https://github.com/arvidn/libtorrent.git
#之前系统版本可直接下载源码使用,18.04需修改include/libtorrent/export.hpp替换boost/config/为boost/config/detail/
#https://github.com/arvidn/libtorrent/releases/download/libtorrent-1_0_11/libtorrent-rasterbar-1.0.11.tar.gz
cd libtorrent
git checkout origin/RC_1_0
./autotool.sh
./configure --prefix=/usr/local/libtorrent CXXFLAGS=-std=c++11
make clean && make -j$(nproc)
make install
echo '/usr/local/libtorrent/lib' > /etc/ld.so.conf.d/libtorrent-x86_64.conf 
ldconfig
export CPLUS_INCLUDE_PATH=/usr/local/libtorrent/include/
export PKG_CONFIG_PATH=/usr/local/libtorrent/lib/pkgconfig/

安装qbittorrent依赖及编译:

apt-get install qtbase5-dev qttools5-dev-tools libqt5svg5-dev zlib1g-dev
wget https://github.com/qbittorrent/qBittorrent/archive/release-4.1.3.tar.gz
tar zxvf release-4.1.3.tar.gz 
cd qBittorrent-release-4.1.3/
./configure --prefix=/usr/local/qbittorrent --disable-gui
make clean && make -j$(nproc)
make install
export PATH=$PATH:/usr/local/qbittorrent/bin/
echo 'export PATH=$PATH:/usr/local/qbittorrent/bin/' >> ~/.bashrc

centos/linux使用vnstat统计流量

发布时间:October 4, 2018 // 分类: // No Comments

vnstat安装:

yum install vnstat
systemctl start vnstat
systemctl enable vnstat

修改默认网卡:

sed 's/Interface ".*/Interface "eth0"/' /etc/vnstat.conf

按小时统计:

vnstat -h
vnstat -i eth0 -h

按天统计:

vnstat -d

实时流量:

vnstat -l -i ens33

centos repo管理使用

发布时间:October 2, 2018 // 分类: // No Comments

使用yum-config-manager启用或关闭指定repo:

yum install yum-utils
yum-config-manager --enable remi
yum-config-manager --disable remi

安装软件时指定repo或不使用指定repo:

yum --disablerepo=remi update
yum --enablerepo=remi update
分类
最新文章
最近回复
  • opnfense: 谢谢博主!!!解决问题了!!!我之前一直以为内置的odhcp6就是唯一管理ipv6的方式
  • liyk: 这个方法获取的IPv6大概20分钟之后就会失效,默认路由先消失,然后Global IPV6再消失
  • 海运: 不好意思,没有。
  • zongboa: 您好,請問一下有immortalwrt設定guest Wi-Fi的GUI教學嗎?感謝您。
  • 海运: 恩山有很多。
  • swsend: 大佬可以分享一下固件吗,谢谢。
  • Jimmy: 方法一 nghtp3步骤需要改成如下才能编译成功: git clone https://git...
  • 海运: 地址格式和udpxy一样,udpxy和msd_lite能用这个就能用。
  • 1: 怎么用 编译后的程序在家里路由器内任意一台设备上运行就可以吗?比如笔记本电脑 m参数是笔记本的...
  • 孤狼: ups_status_set: seems that UPS [BK650M2-CH] is ...