Category Archives: Linux System

Install Freebsd on Arch Linux

1, Getting the Image File
$ axel -n 8 ftp://ftp.freebsd.org/pub/FreeBSD/snapshots/amd64/amd64/ISO-IMAGES/10.3/FreeBSD-10.3-STABLE-amd64-20160429-r298781-uefi-memstick.img

2, Write the Image
# dd if=FreeBSD-10.3-STABLE-amd64-20160429-r298781-uefi-memstick.img of=/dev/sdc bs=1M conv=sync

3, Restart your pc, and choose the USB stick to boot

4, It turns out a easy GUI to install it.Just do it step by step. You can see it on http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/bsdinstall-pos…

5, Notice that when you allocate your disk space, don’t forget to add a boot to the disk.

Install Gentoo on Arch Linux

You can see it on http://www.unixmen.com/a-beginners-guide-to-install-gentoo/ and http://showerlee.blog.51cto.com/2047005/1314053 .
Make sure you are the user of “root”!
1, Setting up Partitions
/dev/sdXX
mkfs.ext4 /dev/sdXX
mkdir /mnt/gentoo
mount /dev/sdXX /mnt/gentoo

2, Downloading and Extracting the Tarball
axel -n 8 http://distfiles.gentoo.org/releases/amd64/autobuilds/20160505/stage3-amd64-20160505.tar.bz2
cd /home/liv/Downloads
tar xvjpf stage3-*.tar.bz2 -C /mnt/gentoo
cd /mnt/gentoo
3, cp -L /etc/reslov.conf /mnt/gentoo/etc/
4, mount -t proc none /mnt/gentoo/proc
mount –rbind /sys /mnt/gentoo/sys
mount –rbind /dev /mnt/gentoo/dev
5, chroot /mnt/gentoo /bin/bash
source /etc/profile
export PS1=”(chroot) $PS1″
5, nano /etc/portage/make.conf

# *** CFLAGS and CXXFLAGS ***
# CFLAGS and CXXFLAGS variables define the optimization flags for gcc C and C++ compiler.
# See https://wiki.gentoo.org/wiki/GCC_optimization for more information.
CFLAGS=”-O2 -pipe -march=native”
CXXFLAGS=”${CFLAGS}”
#
# *** CHOST ***
# WARNING: Changing your CHOST is not something that should be done lightly.
# Please consult http://www.gentoo.org/doc/en/change-chost.xml before changing.
# for 64bit Intel PCs
CHOST=”x86_64-pc-linux-gnu”
# for 32bit Intel PCs
# CHOST=”i686-pc-linux-gnu”
#
# *** USE flags ***
# These are the USE flags that were used in addition to what is provided by the
# profile used for building.
# See official Gentoo docs for more information.
USE=”bindist mmx sse sse2 udev branding dbus startup-notification”
#
# *** MAKEOPTS ***
# With MAKEOPTS you define how many parallel compilations should occur
# when you install a package. A good choice is the number of CPUs (or CPU cores)
# in your system plus one, but this guideline isn’t always perfect.
MAKEOPTS=”-j7″
# The nuber “7” means the nuber of CPU+1, so if you have a dual core machine use -j3.
GENTOO_MIRRORS=”http://mirror.bjtu.edu.cn/gentoo/”

6, emerge-webrsync
emerge –sync
if needed
emerge –oneshot portage

7, Choosing the Profile
eselect profile list
Available profile symlink targets:
[1] default/linux/amd64/13.0
[2] default/linux/amd64/13.0/selinux
[3] default/linux/amd64/13.0/desktop
[4] default/linux/amd64/13.0/desktop/gnome
[5] default/linux/amd64/13.0/desktop/kde
[6] default/linux/amd64/13.0/developer
[7] default/linux/amd64/13.0/no-multilib
[8] default/linux/amd64/13.0/x32
[9] hardened/linux/amd64
[10] hardened/linux/amd64/selinux
[11] hardened/linux/amd64/no-multilib
[12] hardened/linux/amd64/no-multilib/selinux
[13] hardened/linux/amd64/x32
[14] hardened/linux/uclibc/amd64
# eselect profile set 3

8, Setting up the Timezone
# ls /usr/share/zoneinfo
# cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
# echo “Asia/Shanghai” > /etc/timezone

9, Choosing and Compiling Kernel
# emerge gentoo-sources
# cd /usr/src/linux
# make menuconfig

In this step, you should configure your kernel. The important is to make the your net work.
Device Drivers —> Network device support > Ethernet drive support
Choose what driver which you use.

# make -j7 && make modules_install
# make install
# emerge –ask sys-kernel/genkernel
# genkernel –install initramfs

10, # nano /etc/conf.d/hostname
hostname=”your-hostname”

11, # nano /etc/locale.gen
en_US.UTF-8 UTF-8
# locale-gen
# nano /etc/env.d/02locale
LANG=”en_US.UTF-8″
LC_COLLATE=”C”
# env-update && source /etc/profile

12, # vi /etc/conf.d/net
config_eno1=(“192.168.168.0.2 netmask 255.255.255.0 brd 192.168.0.255″)
routes_eno1=(“default via 192.168.0.1″)
# ln /etc/init.d/net.lo /etc/init.d/net.eno1
# rc-update add net.eno1 default

13, # passwd

14, # emerge –ask syslog-ng
# rc-update add syslog-ng default

15, Setting up /etc/fstab
# nano /etc/fstab
/dev/sdXX / ext4 noatime 0 1

16, # exit
pacman -S os-prober
grub-mkconfig -o /boot/grub/grub.cfg

Install Debian 8.4 on Arch Linux

You can see it on “https://www.debian.org/releases/stable/amd64/apds03.html.en”
Make sure your are using user “root”.
1, mke2fs -j /dev/sdaX
mkdir /mnt/debinst
mount /dev/sdaX /mnt/debinst
2, pacman -S debootstrap
3, yaourt -S debian-archive-keyring
4, debootstrap –arch amd64 jessie /mnt/debinst http://mirror.bjtu.edu.cn/debian
or
debootstrap –arch amd64 jessie /mnt/debinst http://mirrors.163.com/debian
or
debootstrap –arch amd64 jessie /mnt/debinst http://ftp.us.debian.org/debian
5, LANG=C.UTF-8 chroot /mnt/debinst /bin/bash
apt-get install makedev
mount none /proc -t proc
cd /dev
MAKEDEV generic
6, vi /etc/fstab
/dev/sdaX / ext3 defaults 0 1
7, dpkg-reconfigure tzdata
8, vi /etc/network/interfaces
auto lo
iface lo inet loopback
auto eth0
iface eth0 inet dhcp

or

auto eth0
iface eth0 inet static
address 192.168.0.2
network 192.168.0.0
netmask 255.255.255.0
broadcast 192.168.0.255
gateway 192.168.0.1

9, vi /etc/resolv.conf
nameserver 192.168.0.1
10, vi /etc/hostname
yourhostname
11, vi /etc/apt/sources.list
deb-src http://mirror.bjtu.edu.cn/debian jessie main
deb-src http://ftp.us.debian.org/debian jessie main

deb http://security.debian.org/ jessie/updates main
deb-src http://security.debian.org/ jessie/updates main
12, apt install locales
dpkg-reconfigure locales
13, apt-cache search linux-image
apt install linux-image-arch-etc
14, exit
pacman -S os-prober
grub-mkconfig -o /boot/grub/grub.cfg

安装Arch Linux笔记

1,dos硬盘安装
一,easybsd安装,grub4dos,添加命令
title Install ArchLinux
root (hd0,0)
kernel /vmlinuz archisolabel=archlinux
initrd /archiso.img
boot
二,遇到shell
mkdir /tmpmnt
mount -r -t ntfs /dev/sda1 /tmpmnt
modprobe loop
losetup /dev/loop6 /tmpmnt/archlinux.iso
ln -s /dev/loop6 /dev/disk/by-label/archlinux
exit
然后正常安装
2,uefi,gpt硬盘安装(未成功)(无法安装grub,下次尝试,借鉴winly-efi)
使用的是usb安装,使用USBWriter1.3刻录U盘安装
提到具体的硬盘分区问题
cfdisk
第一个分区2M,bios_grub
parted set 1 bios_grub on
第二个分区1G,efi system
parted set 2 boot on
注意安装dosfstools
pacman -S dosfstools
mkfs.fat -F32 /dev/sda2
第三个分区/ 10G
3,开始安装
参考http://www.cnblogs.com/mad/p/3280041.html
图文讲解比较容易理解
分区
cfdisk
格式化
mkfs.ext4 /dev/sda1
挂载分区
mount /dev/sda1 /mnt
选择镜像点
vim /etc/pacman.d/mirrorlist
把163的复制到第一行
安装基本系统
pacstrap -i /mnt base
生成fstab
genfstab -U -p /mnt >> /mnt/etc/fstab
配置系统
vi /etc/locale.gen
添加
en_US.UTF-8 UTF-8
执行
locale-gen
echo LANG=en_US.UTF-8 > /etc/locale.conf
export LANG=en_US.UTF-8
起名
echo myhostname > /etc/hostname
配置网络
systemctl enable dhcpd.service
设置密码
passwd
4,安装grub 这个非常重要
一,dos硬盘,传统legacy启动方式,安装上面的来直接可以
pacman -S grub
grub-install –target=i386-pc –recheck /dev/sda
grub-mkconfig -o /boot/grub/grub.cfg
二,gpt硬盘,UEFI启动方式,按照下面的来安装(–boot-directory=/boot/EFI )
mkdir /mnt/boot/EFI
mount /dev/sda2 /mnt/boot/EFI
grub-install –target=x86_64-efi –efi-directory=/boot –bootloader-id=grub –recheck
grub-mkconfig -o /boot/grub/grub.cfg
卸载mnt,重启
exit
umount /mnt
shutdown -r now
5,安装桌面环境
pacman -S xorg-server xorg-server-utils xorg-xinit
先看
lspci | grep VGA
pacman -Ss xf86-video | less
pacman -S xf86-video-nv
笔记本触摸板驱动
pacman -S xf86-input-synaptics
测试X环境
pacman -S xorg-twm xorg-xclock xterm
startx
exit
pkill X
安装xfce4
pacman -S lxdm xfce4
startxfce4
安装字体
pacman -S wqy-microhei wqy-zenhei wqy-bitmapfont
添加一个用户
pacman -S sudo
useradd -m yourname
passwd yourname
然后把该用户添加到一些组: audio disk locate network optical power storage video wheel systemd-journal
gpassd -a yourname wheel
6,设置xfce4自启动
重启
echo “exec startxfce4″ >> /home/user/.xinitrc
systemctl enable lxdm.service
注意:
文中提到工具都可以在ftp://oootwo.com中下载。