Advertisement
AndrzejL

AndrzejL Arch install 512MB HDD

Feb 5th, 2013
263
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.66 KB | None | 0 0
  1. GOAL? Install Arch Linux on a 512 MB hdd.
  2. PURPOSE? Thin client.
  3. WHAT ARE THE MAIN EXPECTATIONS?
  4. - network
  5. - ssh server for remote access
  6. - sshfs for mounting ssh share / large HDD
  7. - tmux for "window" management
  8. - mc for file management
  9. - alsa-utils for sound
  10. - mpg123 as a mp3 codec
  11. - moc as a mp3 / radio / streams player
  12. - all has to fit in on a 512 card...
  13.  
  14. MISSION ACCOMPLISHED ;D (so far only in VBox but this will do as a proof of concept).
  15.  
  16. http://postimage.org/image/ab1maucnh/
  17.  
  18. HOW?
  19.  
  20. 0) BOOT FROM CD and open this link: https://wiki.archlinux.org/index.php/Beginners%27_Guide
  21.  
  22. Follow the guide for the beginners and look at steps below. Make sure You understand what You're doing... Some steps are identical like in beginners guide. SOME are different. SOME will vary for You (locale, network setup). Have fun and good luck.
  23.  
  24. 1) LOCALE:
  25.  
  26. loadkeys uk
  27.  
  28. nano /etc/locale.gen
  29.  
  30. --- # the en_US locale un# the one You want (UTF-8 preffered)
  31.  
  32. locale-gen
  33.  
  34. 2) NETWORK:
  35.  
  36. ip link set eth0 up
  37.  
  38. ip addr add 192.168.0.201/24 dev eth0
  39.  
  40. ip route add default via 192.168.0.1
  41.  
  42. nano /etc/resolv.conf
  43.  
  44. --- Add:
  45.  
  46. nameserver 192.168.0.1
  47.  
  48. ping -c 3 google.com
  49.  
  50. 3) PARTITIONING:
  51.  
  52. cfdisk /dev/sda
  53.  
  54. --- Setup the whole disk as primary partition, Bootable, Linux (83) write the partition table and quit.
  55.  
  56. mkfs.ext4 /dev/sda1
  57.  
  58. --- Formatting as ext4
  59.  
  60. mount /dev/sda1 /mnt
  61.  
  62. --- mounting
  63.  
  64. 4) INSTALL PACKAGES TO NEW ROOT:
  65.  
  66. pacstrap -i /mnt linux e2fsprogs
  67.  
  68. --- 102.62 DOWNLOAD
  69. --- 334.33 INSTALL SIZE
  70.  
  71. rm -f /mnt/var/cache/pacman/pkg/*.tar.xz
  72.  
  73. pacstrap -i /mnt device-mapper gettext inetutils iproute2 iputils licenses lvm2 mdadm pacman pciutils procps-ng sysfsutils systemd-sysvcompat usbutils which xfsprogs jfsutils ifplugd mc netcfg grub-bios
  74.  
  75. --- IF You have pcmcia device / port and you're planning on using it add pcmciautils to the list
  76. --- 17.36 DOWNLOAD
  77. --- 77.39 INSTALL SIZE
  78.  
  79. rm -f /mnt/var/cache/pacman/pkg/*.tar.xz
  80.  
  81. --- FREE SPACE ~67 MB
  82.  
  83. pacstrap -i /mnt net-tools
  84.  
  85. --- 0.11 DOWNLOAD
  86. --- 0.49 INSTALL SIZE
  87.  
  88. rm -f /mnt/var/cache/pacman/pkg/*.tar.xz
  89.  
  90. pacstrap -i /mnt alsa-utils openssh mpg123 tmux moc sshfs
  91.  
  92. --- 7.01 DOWNLOAD
  93. --- 33.86 INSTALL SIZE
  94.  
  95. rm -f /mnt/var/cache/pacman/pkg/*.tar.xz
  96.  
  97. 5) FSTAB
  98.  
  99. genfstab -U -p /mnt >> /mnt/etc/fstab
  100.  
  101. nano /mnt/etc/fstab
  102.  
  103. -- Change this entry:
  104.  
  105. # /dev/sda1
  106.  
  107. UUID=xxxxxxxx-yyyy-aaaa-cccc-rrrrrrrrrrrr / ext4 rw,relatime,data=orderered 0 1
  108.  
  109. to
  110.  
  111. # /dev/sda1
  112. UUID=xxxxxxxx-yyyy-aaaa-cccc-rrrrrrrrrrrr / ext4 defaults 1 1
  113.  
  114. 6) CHROOT TO NEW INSTALL
  115.  
  116. arch-chroot /mnt
  117.  
  118. A) LOCALE:
  119.  
  120. mcedit /etc/locale.gen
  121.  
  122. --- # the en_US locale un# the one You want (UTF-8 preffered)
  123.  
  124. locale-gen
  125.  
  126. echo LANG=en_IE.UTF-8 > /etc/locale.conf
  127.  
  128. export LANG=en_IE.UTF-8
  129.  
  130. loadkeys uk
  131.  
  132. mcedit /etc/vconsole.conf
  133.  
  134. --- add:
  135.  
  136. KEYMAP=uk
  137. FONT=Lat2-Terminus16
  138.  
  139. --- and save
  140.  
  141. B) TIMEZONE
  142.  
  143. ln -s /usr/share/zoneinfo/Europe/Dublin > /etc/localtime
  144.  
  145. C) CLOCK
  146.  
  147. hwclock --systohc --utc
  148.  
  149. D) HOSTNAME
  150.  
  151. echo 512mb_arch_install > /etc/hostname
  152.  
  153. E) NETWORK
  154.  
  155. cd /etc/network.d
  156.  
  157. cp examples/ethernet-static .
  158.  
  159. mcedit ./ethernet-static
  160.  
  161. EXAMPLE:
  162.  
  163. --- CONNECTION='ethernet'
  164. --- DESCRIPTION='A basic static ethernet connection using iproute'
  165. --- INTERFACE='eth0'
  166. --- IP='static'
  167. --- ADDR='192.168.0.201'
  168. --- #ROUTES=('192.168.0.0/24 via 192.168.0.1')
  169. --- GATEWAY='192.168.0.1'
  170. --- DNS=('192.168.0.1')
  171.  
  172. --- ## For IPv6 autoconfiguration
  173. --- #IP6=stateless
  174.  
  175. --- ## For IPv6 static address configuration
  176. --- #IP6='static'
  177. --- #ADDR6=('1234:5678:9abc:def::1/64' '1234:3456::123/96')
  178. --- #ROUTES6=('abcd::1234')
  179. --- #GATEWAY6='1234:0:123::abcd'
  180.  
  181. systemctl enable net-auto-wired.service
  182.  
  183. F) KERNEL:
  184.  
  185. mkinitcpio -p linux
  186.  
  187. G) PASSWORDS / USERS
  188.  
  189. passwd
  190.  
  191. --- change root's password
  192.  
  193. groupadd andrzejl
  194.  
  195. --- add andrzejl group
  196.  
  197. useradd -m -g andrzejl -G wheel -s /bin/bash andrzejl
  198.  
  199. --- add andrzejl user with main group = andrzejl also member of wheel group, creating a home and with /bin/bash shell
  200.  
  201. passwd andrzejl
  202.  
  203. --- change andrzejl's password
  204.  
  205. H) BOOTLOADER = GRUB2
  206.  
  207. grub-install --target=i386-pc --recheck /dev/sda
  208.  
  209. cp /usr/share/locale/en\@quot/LC_MESSAGES/grub.mo /boot/grub/locale/en.mo
  210.  
  211. grub-mkconfig -o /boot/grub/grub.cfg
  212.  
  213. I) SSHD ENABLING:
  214.  
  215. sysctemctl enable sshd.service
  216.  
  217. J) FINISHING:
  218.  
  219. exit
  220.  
  221. umount -a
  222.  
  223. reboot
  224.  
  225. [andrzejl@wishmacer ~]$ nmap -p 22 192.168.0.201
  226.  
  227. Starting Nmap 6.25 ( http://nmap.org ) at 2013-02-05 15:39 GMT
  228. Nmap scan report for 192.168.0.201
  229. Host is up (0.010s latency).
  230. PORT STATE SERVICE
  231. 22/tcp open ssh
  232.  
  233. Nmap done: 1 IP address (1 host up) scanned in 0.21 seconds
  234. [andrzejl@wishmacer ~]$ ssh 192.168.0.201
  235. The authenticity of host '192.168.0.201 (192.168.0.201)' can't be established.
  236. ECDSA key fingerprint is c9:d5:e6:81:ab:66:cf:ec:50:10:09:05:84:91:a3:a8.
  237. Are you sure you want to continue connecting (yes/no)? yes
  238. Warning: Permanently added '192.168.0.201' (ECDSA) to the list of known hosts.
  239. andrzejl@192.168.0.201's password:
  240. X11 forwarding request failed on channel 0
  241. Last login: Tue Feb 5 15:38:44 2013
  242. [andrzejl@512mb_arch_install ~]$ ping google.com
  243. PING google.com (173.194.70.139) 56(84) bytes of data.
  244. 64 bytes from fa-in-f139.1e100.net (173.194.70.139): icmp_seq=1 ttl=49 time=203 ms
  245. 64 bytes from fa-in-f139.1e100.net (173.194.70.139): icmp_seq=2 ttl=49 time=402 ms
  246. 64 bytes from fa-in-f139.1e100.net (173.194.70.139): icmp_seq=3 ttl=49 time=192 ms
  247. ^C
  248. --- google.com ping statistics ---
  249. 3 packets transmitted, 3 received, 0% packet loss, time 2001ms
  250. rtt min/avg/max/mdev = 192.511/266.170/402.582/96.560 ms
  251. [andrzejl@512mb_arch_install ~]$ df -h
  252. Filesystem Size Used Avail Use% Mounted on
  253. rootfs 496M 446M 25M 95% /
  254. dev 249M 0 249M 0% /dev
  255. run 250M 308K 250M 1% /run
  256. /dev/sda1 496M 446M 25M 95% /
  257. tmpfs 250M 0 250M 0% /dev/shm
  258. tmpfs 250M 0 250M 0% /sys/fs/cgroup
  259. tmpfs 250M 0 250M 0% /tmp
  260. [andrzejl@512mb_arch_install ~]$ mocp
  261. Can't load plugin libaac_decoder: file not found
  262. Can't load plugin libffmpeg_decoder: file not found
  263. Can't load plugin libmodplug_decoder: file not found
  264. Can't load plugin libmusepack_decoder: file not found
  265. Can't load plugin libspeex_decoder: file not found
  266. Can't load plugin libwavpack_decoder: file not found
  267. Running the server...
  268. Trying JACK...
  269. Trying ALSA...
  270.  
  271. --- additional packages that could be installed:
  272.  
  273. - inxi
  274. - lm_sensors
  275. - acpi
  276. - htop
  277. - lsof
  278. - screen - remove tmux and install screen for alternative "window" management
  279. - gpm - enables mouse in terminal
  280.  
  281. pacman -S gpm
  282.  
  283. systemctl enable gpm
  284.  
  285. systemctl start gpm
  286.  
  287. --- additional fixes that could added:
  288.  
  289. --- edit sysctl.conf
  290.  
  291. mcedit /etc/sysctl.conf
  292.  
  293. --- add this:
  294.  
  295. # Added by AndrzejL
  296.  
  297. #disable ipv6
  298. net.ipv6.conf.all.disable_ipv6=1
  299. #less caching less swap use max ram
  300. vm.swappiness=0
  301.  
  302. --- to almost disable caching and to disable ipv6
  303.  
  304. --- change root prompt to red and add some aliases DONT FORGET TO CHANGE andrzejl TO YOUR LOGIN
  305.  
  306. mcedit /root/.bashrc
  307.  
  308. --- modify
  309.  
  310. PATH=/sbin:/usr/sbin:/bin:/usr/bin:/usr/X11R6/bin:/usr/local/bin:/usr/local/sbin:/usr/lib/kde4/libexec
  311. ENV=$HOME/.bashrc
  312. USERNAME="root"
  313. export XAUTHORITY=/home/andrzejl/.Xauthority
  314. export USERNAME ENV PATH
  315. # User specific aliases and functions
  316. alias ssh='ssh -Y'
  317. alias procesy='ps -A -o pid,stat,pmem,pcpu,start,etime,comm,user --sort=-pcpu'
  318. alias konq='konqueror --profile filemanagement&'
  319. # Source global definitions
  320. if [ -f /etc/bashrc ]; then
  321. . /etc/bashrc
  322. fi
  323. export PS1='\[\033[01;31m\][\u@\h \W]\$\[\033[00m\] '
  324.  
  325. --- to look like this ^^^
  326.  
  327. [root@512mb_arch_install andrzejl]# inxi -v7
  328. System: Host: 512mb_arch_install Kernel: 3.7.5-1-ARCH i686 (32 bit, gcc: 4.7.2) Console: tty 0 Distro: Arch Linux
  329. Machine: System: innotek product: VirtualBox version: 1.2 serial: 0 Chassis: Oracle type: 1
  330. Mobo: Oracle model: VirtualBox version: 1.2 serial: 0 Bios: innotek version: VirtualBox date: 12/01/2006
  331. CPU: Single core Intel Celeron M (-UP-) cache: 1024 KB flags: (sse sse2) bmips: 2998.46 clocked at 1498.783 MHz
  332. Graphics: Card: InnoTek Systemberatung VirtualBox Graphics Adapter bus-ID: 00:02.0 chip-ID: 80ee:beef
  333. X-Vendor: N/A driver: tty size: 116x32 Advanced Data: N/A for root out of X
  334. Audio: Card: Intel 82801AA AC'97 Audio Controller
  335. driver: snd_intel8x0 ports: d100 d200 bus-ID: 00:05.0 chip-ID: 8086:2415
  336. Sound: Advanced Linux Sound Architecture ver: k3.7.5-1-ARCH
  337. Network: Card: Intel 82540EM Gigabit Ethernet Controller
  338. driver: e1000 ver: 7.3.21-k8-NAPI port: d010 bus-ID: 00:03.0 chip-ID: 8086:100e
  339. IF: eth0 state: up speed: 1000 Mbps duplex: full mac: 08:00:27:e6:ea:69
  340. WAN IP: None Detected! IF: eth0 ip: 192.168.0.201 ip-v6: N/A
  341. Drives: HDD Total Size: 0.5GB (87.8% used)
  342. 1: id: /dev/sda model: VBOX_HARDDISK size: 0.5GB serial: VB8af86596-5056c6e9
  343. Optical: /dev/sr0 model: N/A rev: N/A dev-links: cdrom
  344. Features: speed: 32x multisession: yes audio: yes dvd: yes rw: none state: N/A
  345. Partition: ID: / size: 496M used: 450M (96%) fs: ext4 dev: /dev/sda1
  346. label: N/A uuid: a4fe56bc-2297-4ade-bc4d-3d80cc00a550
  347. RAID: No RAID data available - /proc/mdstat is missing - is md_mod kernel module loaded?
  348. Unmounted: ID: /dev/sr0 size: 1.07G label: N/A uuid: N/A
  349. Sensors: None detected - is lm-sensors installed and configured?
  350. Info: Processes: 58 Uptime: 4 min Memory: 18.8/499.5MB Runlevel: 5 Gcc sys: N/A
  351. Client: Shell (bash 4.2.42 running in tty 0) inxi: 1.8.34
  352. [root@512mb_arch_install andrzejl]#
  353.  
  354. all is peachy... sound, network and so on...
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement