(Unfinished)
Basic scenarios
Because work requires a new dedicated R & D server, it needs to run some R & D services, such as subversion, bugzilla, mediawiki, dailybuild environment and shared file library. Considering the reliability, I decided to use linux as the operating system of the new machine. Due to the shortage of electricity in summer and frequent peak-to-peak usage, the ReiserFS and XFS file systems are selected for ReiserFS. The reason is that ReiserFS is very efficient for small file storage, I will use subversion (using file storage) Here, which is suitable for use. I also heard that although XFS has good performance, it is very difficult to maintain it. It is estimated that the new version will not come out quickly, but later I found that ReiserFS was very slow to start, so I had to use XFS. Remember not to set/boot to XFS because GRUB does not know it.
Although it is a "new" server, it is an old machine. It was originally a 4G hard drive with MB memory and GB cpu (good speed). Later, an 80 GB hard drive was added. My installation plan is as follows: 4G hard drive is hda, dedicated storage system, 80g hard drive as hdb, dedicated storage data. The operating system is ubuntu server 7.04.
Preparations
I only have an iso image on hand, so I use the ubuntu hard disk installation method. The preparations are as follows:
- Read the appendix documents and understand them correctly.
- Download the required files for ubuntu hard drive installation: initrd.gz and vmlinuz
- Copy these files and iso images to my hdb root directory. For this reason, I first created a fat32 partition on it.
- Find a user manual for the vi editor online and print it at hand (remember ).
Linux Installation
In the previous article, I used a USB flash drive to start it in the GRUB environment. Press C to enter the GRUB command line environment and enter the following command:
Root (hd1, 0)
Kernel/vmlinuz root =/dev/ram ramdisk_size = 32000 devfs = mount, dall
Initrd/initrd.gz
Boot
The installation process is not mentioned much, but there are several points to note:
- Select the current country, otherwise it will be troublesome to set the time.
- Enable LVM when installing disk partitioning. If you have no concept, refer to the references in the appendix.
- Select the file format of the disk partition and select ReiserFS, which may be inconvenient. First, Select Automatic partition + LVM, and then ask whether to choose whether to set the file format of the partition when writing data to the disk, then, an error is reported in the middle, indicating that the root file system is not set, and then the system returns to Select Automatic + LVM. Be sure to take a closer look; otherwise, errors may occur easily.
- Do not use Chinese language for installation. If you do not have a translation, you can still understand it. If you do not have a translation, you cannot understand it (is it my problem ?), In addition, it is strange to recognize my hda as sda in Chinese.
Some situations may occur during the installation process. bigtall encountered the following problems during installation:
- Error 22 occurs when the USB flash drive is started. This is because the machine is not able to correctly identify the U disk file format, please check your BIOS settings, make sure to identify the U disk format and the actual U disk format is the same, Here bigtall is USB-HDD mode.
- If the isofile is not found during installation, make sure that the vmlinuzfile and initrd.gz file are consistent with your current version. Use feisty-related files in ubuntu 7.04. You can also use Alt + F2 to switch to the new console after the prompt that ISO cannot be found. Press enter to display the prompt and enter the following command:
# Mkdir/dev/loop
# Mknod/dev/loop/0 B 7 0
# Mknod/dev/loop/1 B 7 1
# Exit
Switch back to the installation interface with Alt + F1 and try again.
- Hard Disk cannot be found during installation. First, check the BIOS settings. If you can find the hard disk, continue to check. For SATA hard disks, see [NOTE 1 ]. If it is an IDE hard disk, check your hard disk jumper settings, and if necessary, remove all the disks with only one independent hard disk. If your hard disk capacity is greater than 160 GB, try again with a smaller one, for example, 80 GB.
- If you cannot access the black or white screen after entering or get stuck when setting the Frame Buffer, add the vga = NNN parameter when entering the GRUB kernel command, here, NNN is a number (generally, we recommend that you set the value to 771 ). The value and its meaning are as follows:
* Color 640x400 640x480x800 600x1024 768x1280 1024x1600x1200
* 4 bits? ----------? ----------- 770 --------? -----------? -----------?
* 8 bits 768-------769--------771--------773------775----------796
* 15 bits? --------- 784--------787--------790--------793--------797
* 16 bits? --------- 785--------788--------791--------794----------798
* 24 bits? --------- 786--------789--------792--------795--------799
For example, 1024*768 @ 16bits adds vga = 791
Note: vga does not support wide screens. You can only find similar values and the screen will be flattened.
Preparations
After the system restarts, the iso mount will not automatically start up, so we need to do it manually. Because our iso file is placed on hdb1, we need to mount hdb1 first, second, we can mount our iso. Because we need to use iso for upgrading.
$ Sudo mkdir/mnt/hdb
If the hdb1 format is ext3
$ Sudo mount/dev/hdb1/mnt/hdb
If the hdb1 format is fat32
$ Sudo mount-t vfat-o iocharset = cp936/dev/hdb1/mnt/hdb
$ Sudo mount-o loop/mnt/hdb/ubuntu. iso/cdrom
Configure the telnet Service
After the installation is complete, we need to perform some basic configuration, and then move the subsequent work to my vista machine, and use a remote terminal to continue, so we don't have to go to this machine to run around, it is easier to query information. Therefore, the first step is to install the telnet service. After logging on to the system, enter the following command (do not enter the $ symbol here, which is a command line prompt ):
$ Sudo apt-get install xinetd telnetd
$ Sudo vi/etc/xinetd. d/telnet
Input content:
Service telnet
{
Disable = no
Socket_type = stream
Protocol = tcp
Wait = no
User = telnetd
Server =/usr/sbin/in. telnetd
}
$ Sudo/etc/init. d/xinetd restart
$ Telnet 127.0.0.1
If it can be connected, it means it is OK and exit with ctrl + C
Preparations before remote Logon
First, write down the IP address of the Local Machine. Run the following command to see
$ Ifconfig | more
Connect to your machine via telnet. All future work will be done remotely through telnet.
Set Language
If you are not satisfied with the language settings when you install it accidentally, do not worry. Use the following method to modify it:
$ Sudo vi/etc/environment
In the editor, modify the content as follows:
LANGUAGE = "zh_CN: zh: en_US: en"
LC_CTYPE = zh_CN.UTF-8
LANG = zh_CN.UTF-8
Ststst_id3_tag_encoding = GBK
# If you need to use the English interface, modify the content as follows:
# LANGUAGE = "en_US: en"
# LC_CTYPE = zh_CN.UTF-8
# LANG = en_GB.UTF-8
# Ststst_id3_tag_encoding = GBK
Upgrade System
Use two commands to upgrade the system first. However, this step is required and can be done in the last step.
$ Sudo apt-get update
$ Sudo apt-get dist-upgrade
Add a permanent ip Address
First, write down the name of the current Nic of the machine and use the command
$ Ifconfig | more
/Etc/rc. local Add a row
Ifconfig ath0: 5 192.168.1.222 netmask 255.255.255.0 up
Mount hard disk permanently
$ Sudo cfdisk/dev/hdb
Partition two hard disks, one is the basic 5g partition hdb1, and the remaining is the extended partition hdb5.
$ Sudo mkfs-t xfs-f/dev/hdb1
Next, we will use LVM. Do you still remember the name we saw during installation? For more information, see the document guide in the Appendix. We add hdb5 and keep hdb1 because I have some problems with the 4G hard drive. If I am afraid it will break down, we will install a new system in hdb1. LVM commands are as follows:
$ Sudo lvm
Then go to the LVM management environment: its prompt is lvm>. Enter the command sequence as follows:
Lvm> vgcreate-s 32 M main/dev/hdb5
Lvm> vgdisplay
Here I will see two lvm settings: lvm2 set during system installation and main set. Then, set several logical volumes, lv_home, lv_var, and lv_share, each of which is 8 GB in size.
Lvm> lvcreate-L8G-nlv_home main
Logical volume "lv_home" created
Lvm> lvcreate-L8G-nlv_var main
Logical volume "lv_var" created
Lvm> lvcreate-L8G-nlv_share main
Logical volume "lv_share" created
Lvm> lvdisplay
Lvm> vgchage-a y main
Lvm> quit
Then, format several new logical volumes:
Sudo mkfs-t xfs-f/dev/main/lv_home
Sudo mkfs-t xfs-f/dev/main/lv_var
Sudo mkfs-t xfs-f/dev/main/lv_share
Sudo mkdir/share
I encountered a problem while formatting again, but it does not seem to be affected. Add/etc/fstab according to the parameter description. Here I only need to add share.
To expand the partition, for example, to expand share, run the following command:
$ Sudo lvextend-L + 8G/dev/main/lv_share
$ Sudo xfs_growfs/dev/main/lv_share
Install samba
$ Sudo apt-get install samba
$ Sudo apt-get install smbclient
$ Sudo vi/etc/samba/smb. conf
Enter the following content at the end of the file:
[Share Directory 2]
Comment = My Share Directory 2
Path =/share
Writable = yes
Valid users = smbuser1
Create mode = 0664
Directory mode = 0775
Then
$ Sudo useradd smbuser1
$ Sudo passwd smbuser1
$ Sudo smbpasswd-a smbuser1
$ Sudo chown smbuser1/share
$ Sudo/etc/init. d/samba restart
Migration/var
After all the settings are complete, you need to move the system directory to my hard disk. This step cannot be completed by telnet and must be in front of the machine.
$ Sudo init 1
# Mkdir/mnt/temp
# Mount/dev/main/lv_home/mnt/temp
# Cp-avx/home/*/mnt/temp
# Mv home. old
# Mkdir home
# Umount/mnt/temp
# Mount/dev/main/lv_home/home
# Mount/dev/main/lv_var/mnt/temp
# Cp-avx/var/*/mnt/temp
# Mv var. old
# Mkdir var
# Umount/mnt/temp
# Mount/dev/main/lv_var/var
# Vi/etc/fstab
Insert the/home And/var entries after the mount entry in the root directory, as follows:
/Dev/main/lv_home/home xfs defaults 2 2
/Dev/main/lv_var/var xfs defaults 2 2
# Init 5
Install LAMP to install subversion
Note:
- Q: Can I install Linux on a SATA hard disk?
A: Yes. For example, RedHat 9 must be set to Compatible Mode before installation. Otherwise, the hard disk cannot be found. After the kernel is installed, upgrade the kernel to 2.4.22. If the CPU used supports hyper-threading, select SMP support when compiling the kernel. Then modify the GRUB startup parameter, change hda to hde, And the partition number remains unchanged. You also need to change the fstab. Otherwise, the "SWAP" SWAP partition cannot be activated after startup. After restarting, change the Compatible Mode in BIOS to Enhanced Mode, so that you can use the performance of the SATA interface.
Reference:
- Ubuntu FAQs
- Notes on installing Ubuntu 6.10 Alternate on Hard Disk
References:
- Install telnetd on ubuntu
- Ubuntu 7.04 Desktop linux server configuration process
- The most critical factor for protecting linux machines on the Internet
- Linux samba Server SETUP
- How to integrate samba with activedirectory
- Detailed description of SVN server construction in Linux
- Learn linux LVM, part 1 and part 2
- A very professional Linux LVM HOWTO
- Linux topics
- Volume Management in Linux
- Summary of ubuntu 7.04 hard disk installation and configuration process