Install win7 and archlinux on hard disk under ubuntu

I only did one thing during the two days at home last weekend, and that was to install the system. Different from taking a ghost disk to install the system (win) a long time ago, this time toss is more technical. In the whole process, I broke the card holder of an sdcard, and I checked the sdcard countless times. In the end, it was discovered that the full hard disk installation was enough.

What did you learn from this process? To put it simply, boot the system through grub, install the system through the hard disk, and there is a chip in the original card tray (or card reader) (before I thought it was just a connection).

Let's talk about the environment#

My laptop is a complete ubuntu system, and all the places where win was used before run in the virtual machine, which is slow. So there was the idea to install a win system under ubuntu. At the same time, I want to try archlinux, so the final ideal result is to install a dual system of archlinux and ubuntu.

Approximate process#

Win first then archlinux

The original idea is very simple, first reinstall the system as a win system, and then install an archlinux. There are more information in this area on the Internet, and it is easier to install. Reluctant to start after writing winxp into the sdcard, I found that the hard disk could not be found. It is estimated that I changed the entire hard disk format to ext4, and found that this path did not work, so I found another solution.

Install win directly under ubuntu

Since you can't install win first, change the plan and find articles about installing win under linux on the Internet. There have been some detours, mainly because the disk partition needed to install win was not considered at the beginning, and the system that can only boot the installation version through grub installation, ghost cannot be installed. Therefore, first use it as a gparted live disk, then enter the system, and draw an ntfs partition from the disk. Then boot the installation image of win7 through grub to install. After tossing, I basically understand how to boot the system with grub.

The topic, install win7 under ubuntu

Create Partition##

As mentioned above, if you also have a complete Linux environment, you must first create an ntfs partition. Then come to configure grub.

Which partition you need to install the system on can be checked by sudo fdisk -l. For example, mine is:

Device Boot      Start         End      Blocks   Id  System
/dev/sda1            204837117542318558668883  Linux
/dev/sda2   *575975424616935423204800007  HPFS/NTFS/exFAT

Among them, /dev/sda2 is the ntsf partition that I divided, then I will install the win system here.

Write iso image##

Establishing an iso image under ubuntu is much easier than under win. No other software is needed at all, just one command:

mkdir /mnt/win7
sudo mount -o loop windows7.iso /mnt/win7
sudo cp -rv /mnt/win7/* /dev/sda2

In this way, write win7 to your newly created partition (actually, decompress the image to the partition you created), and then boot.

grub boot##

In fact, it is a matter of several configurations. If your ubunut system does not select the system menu when it is turned on, you need to press shift to display it after booting. In fact, you can enter grubdos by pressing c in the system selection menu section without going through the configuration file. But there are more things to remember like that.

The configuration file here refers to the /boot/grub/grub.cfg configuration file in the system. In this file, you will see code similar to the following. When adding, write it in the same structure.
Thanks to netizens for pointing out, and there is another sentence to say, the value of blog is not only in articles, comments also have their value. This is like an open source project. There are bugs in it. If you find it, of course the discovery is also valuable, but it is more valuable to mention a patch, which is the same for others and yourself.

The configuration file is as follows:

menuentry "Windows 7 (loader) (on /dev/sda2)"--classwindows--classos{
 insmod ntfs
 set root='(hd0,2)'ntldr(hd0,2)/bootmgr
 boot
}

Note here that your win7 is the installation disk, not the ghost disk.

At this time, restart, you found an additional win7 option on the menu of selecting the operating system, and then the installation is normal. What needs to be reminded here is that I allocated 20 G of space to the win partition and installed it. After win7 and some basic software, only less than 1G is left, so if the disk is rich, you need to allocate more space.

Install archlinux#

Installing archlinux is more troublesome, because you can't directly boot the system from the partition you want to install. Therefore, you need to put the boot file system in another partition first, such as the home/the5fire/arch directory in my main partition (/dev/sda1/), and then write the grub configuration:

menuentry "Arch Install"--classgnu-linux --classgnu--classos{
 insmod part_msdos
 insmod ext2
 set root='(hd0,1)'linux(hd0,1)/arch/boot/vmlinuz-linux root=/dev/sda1
 initrd /boot/initramfs-linux.img
}

Start from here and enter the installation mode, which is actually a terminal.

You can refer to these two articles for the rest:

http://eidolon.iteye.com/blog/320923 Start from step 5.
Archlinux Chinese Newbie Guide

That's about it. If you have enough time, it's not bad to toss it yourself.

After installing archlinux, I actually didn't use it, because I had to install the GUI, and I needed to configure many things. The time cost didn't allow it. It was better to use a lightweight desktop under ubuntu. I have been trying out E17 desktop in the past two days.

Recommended Posts

Install win7 and archlinux on hard disk under ubuntu
Install ubuntu dual system under win10 (no U disk)
Install and configure MySQL on Ubuntu
Install and deploy Gerrit under Ubuntu
Install nodejs and npm under Ubuntu 16.04
Compile and install QEMU under Ubuntu
Talk about | Install and use Linux system Ubuntu under Win10
Install Gnome and VNC on Ubuntu Server
[Daily] Win10 open and install ubuntu subsystem
Install docker on ubuntu and basic usage
Install fonts on Ubuntu and switch default fonts
Install and uninstall CUDA and CUDNN on Ubuntu
How to install Pycharm and Ipython on Ubuntu 16.04/18.04
How to install and configure NATS on Ubuntu 16.04
Install JDK and configure environment variables on Ubuntu 16.04
How to install and configure Gogs on Ubuntu 18.04
How to install and configure Cyberpanel on Ubuntu 18.04
How to install and secure phpMyAdmin on Ubuntu 16.04
How to install and configure ownCloud on Ubuntu 16.04
How to install and configure ownCloud on Ubuntu 16.04
Install and use Git and GitHub on Ubuntu Linux
How to install and configure GitLab on Ubuntu 18.04
How to install and use Docker on Ubuntu 20.04
How to install and configure Ansible on Ubuntu 18.04
How to install and use Curl on Ubuntu 18.04
How to install and use Composer on Ubuntu 18.04
How to install and use Wine on Ubuntu 18.04
How to install and secure phpMyAdmin on Ubuntu 16.04
How to install and configure Elasticsearch on Ubuntu 16.04
How to install and configure PostGIS on Ubuntu 14.04
How to install and use Composer on Ubuntu 20.04
How to install and use BaasBox on Ubuntu 14.04
How to install and configure VNC on Ubuntu 18.04
How to install and configure Sphinx on Ubuntu 16.04
How to install and configure OrientDB on Ubuntu 14.04
How to install and use PostgreSQL on Ubuntu 16.04
How to install and configure AppScale on Ubuntu 12.04
How to install and use Docker on Ubuntu 16.04
How to install and configure PostGIS on Ubuntu 14.04
Install apache+PHP under Ubuntu
install vscode on ubuntu18
Install node.js under Ubuntu
Install Redis on Ubuntu
Install R4 on ubuntu20
Install nvtop on Ubuntu 18.04
Install postgresql-10 on Ubuntu 18.04
Install python3.6 under Ubuntu 16.04
Install docker on Ubuntu
Install mysql under Ubuntu 16.04
Install Thrift under ubuntu 14.10
Install OpenJDK10 under Ubuntu
Install Caffe under Ubuntu 14.04
Install Docker on ubuntu18.04
Install nodejs10 on Ubuntu16
[python] python2 and python3 under ubuntu
Install mysql on Ubuntu 14.04
Install Django on ubuntu
Install Pytorch+CUDA on Ubuntu 16.04
2018-09-11 Install arduino under Ubuntu
Install Python3 on Ubuntu 14.04
Install rJava on Ubuntu18