- Install Ubuntu directly from hard disk
- So how does one install Ubuntu or Linux Mint without burning the iso files?
- Advantages of installing Ubuntu directly from Hard Disk
- Install Ubuntu from iso using Grub4Dos
- Notes
- Related Posts:
- About the Author: Bharat Balegere
- 12 Comments + Add Comment
- Установка Ubuntu Linux с винчестера. Скрипт
- Ubuntu Documentation
- Live Ubuntu Desktop from Hard Drive
- Step 1, Partition
- Step 2, Copy
- Step 3, Grub
- Step 4, Reboot
- Step 5, Grub (again)
- Older Versions of Ubuntu
- Debootstrap
- Alternate CD
- Procedure 1
- Procedure 2
- Alternate CD Alternate Method
- Troubleshooting
Install Ubuntu directly from hard disk
Ubuntu is one of the most popular Linux Distribution.According DistroWatch.com Ubuntu and Linux Mint are the two most popular linux distros.Linux Mint is a derivative of Ubuntu.It is a customized version of Ubuntu.
Since new versions of Ubuntu and Linux Mint are released every 6 months, there is no point in burning the iso files to blank cds.
So how does one install Ubuntu or Linux Mint without burning the iso files?
Two possible answers to the above question.
- Install from bootable USB Flash Drive
- Install directly from the hard disk
There are many guides and tools which help in you in creating bootable usb drives to install Ubuntu.
In this article I will be showing how you can install Ubuntu(and its derivatives) directly from hard disk.
Advantages of installing Ubuntu directly from Hard Disk
- Secondary media like CD,DVD or USB Flash Drive are not required
- Installation is faster
- No need to change boot order.You have to boot normally from your hard disk
Install Ubuntu from iso using Grub4Dos
- Install Grub4dos to your Hard Disk.Grub4Dos is powerful bootloader which supports iso emulation
- Download Ubuntu to the root of any drive.
- Add the following entry to menu.lst
Notes
Defragment the downloaded iso with Wincontig.If your iso is fragmented,grub4dos will attempt to RAM load the entire iso.This may cause problems if you have less RAM.
The above procedure also works with Linux Mint.Just change corresponding iso file names in the menu.lst code.
Related Posts:
About the Author: Bharat Balegere
Bharat Balegere is a 27 year old blogger from Bengaluru. He is a technology enthusiast and loves tinkering with computers and usb drives.
12 Comments + Add Comment
but i dont have windows installed.. so can i do this from linux?
what about unetbootin can i use that or some other tool?
You can do this in Linux if it uses Grub2 as the bootloader.
You just need to make an entry in the Grub2 menu to boot Ubuntu or derivatives using iso emulation.
thanks a bunch will try and see how it goes
i have only 512Mb ram…..and it shows error on the startup for low ram what should i do.
help me before this i tried frugal install with unetbootin but that was failed too.
desperate to get hands back on ubuntu.
Which version of Ubuntu are you trying to install?
Also try to defragment the iso with Wincontig and then try.
If the iso file is fragmented then grub4os will try to load the iso into ram.
You avoid this by changing the line
not working after 15 sec count down windows 7 started.
Cheers mate, I’ll try this with Mint 13 when it comes out.
Hello, i tried the above method but it does not seem to find the iso. i have to hard disk of 2 partions.
how about open suse??
Since my cd drive is not working and booting from usb not supported, I tried your way of installing ubuntu in my computer E- drive as a dual boot with Windows XP on c drive. I followed the steps shown in your post, copying the commands you have given, grub4dos installed and then rebooted. Now the computer starts and and goes to grub and just stays there. I am neither able to go to my windows and neither able to install ubuntu. Please help me to get out of this mess. can I somehow remove or disable grub4dos right at the start in order to be able to reach to windows.
Thanks a ton
Amit
It says :
error 15: file not found
What is menu.lst?
When you use terms that beginners are unfamiliar with it might be a good idea to explain those terms in your article. Would only take 1 sentence probably. Or you may not bother and not have 99.9% of the population be able to understand what you’re saying or be able to use your info for something productive.
This is the problem with Linux. People familiar with it are too lazy and careless to take the time to explain basic things to nuubies. Yet they expect people to choose it.
Here’s the solution: Show directions how to install it after downloading it, without the nonsense of burning anything (why bother with a USB or optical drive?). Most people have a hard drive lying around they’re not using. Its easy to format and partition to try out Linux. Download to a hard drive and install from there to another hard drive. Like a sensible person would do. Who even uses optical drives anymore?
Источник
Установка Ubuntu Linux с винчестера. Скрипт
Никогда не любил устанавливать Ubuntu с Live-CD/DVD. Иногда может быть диск поцарапан и установка прерывается на самом интересном месте, музыку не послушаешь, фильмы не посмотришь. Я устанавливаю Ubuntu из iso-образа со своего жесткого диска на другой винчестер или раздел. Читая раньше в инете статьи, как ставить с жесткого диска, я просто слепо следовал инструкциям, копируя и выполняя команды. Бывали проблемы с загрузчиком grub, приходилось дополнительно искать в интернете решения, как исправить эти ошибки. Затем, чтобы не мучаться, я сделал свой скрипт установки.
Задача: Нужно, используя уже установленную Ubuntu, установить систему на другой винчестер.
Решение:
Для начала раздел, куда будет ставиться Ubuntu, отформатируйте в Редакторе разделов (gparted) и установите на разделе атрибут «boot», иначе после установки компьютер скажет INSERT SYSTEM DISK или что то в этом роде.
Запомните его путь (например /dev/sda1). Разархивированный архив со скриптами и всеми файлами надо положить в папку /home/setup. Это важно! Иначе скрипт не выполнится. Если не нравится местоположение скрипта, просмотрите скрипт и исправьте пути на свои. Разобраться в нем не сложно.
Первый файл setup.sh Его содержание:
- #!/bin/bash
- disk = / dev / sdb3 #раздел на который будет ставиться убунта
- version =jaunty #версия убунты.
- arch =i386 #архитектура
- path = / home / slimer / distr / ubuntu- 9.04 -alternate-i386.iso #путь до вашего образа Ubuntu
- pathstp = / home / setup #измените путь на тот, куда вы разахивировали архив.
- #это все переменные, изменяйте их значение в зависимости от раздела и версии убунты. в целом скрипт будет работать.
- mkdir / newubuntu #создание папки для монтирования новой системы
- mount $disk / newubuntu #монтирование раздела куда будет ставиться Ubuntu
- apt-get install debootstrap -y #установка debootstrap’а, если у кого он не установлен.
- mkdir / mnt / cd #создание папки для монтирования образа Ubuntu
- mount -o loop $path / mnt / cd / #монтирование образа ubuntu
- debootstrap —arch $arch $version / newubuntu file : / mnt / cd #Идет установка базовой системы убунту на новый винчестер
- cp / etc / fstab / newubuntu / etc / fstab #копируется ваш fstab в новую систему
- cp / etc / hostname / newubuntu / etc / hostname #копируется ваш hostname в новую систему
- cp / etc / hosts / newubuntu / etc / hosts #копируется ваш hosts в новую систему
- cp $pathstp / sourcescd / newubuntu / etc / apt / sources.list #источники пакетов из образа
- cp $pathstp / sources.list / newubuntu / etc / sources.inet #на будущее копируется источники из интернета
- cp $pathstp / sudoers / newubuntu / etc / sudoers #файл sudoers копируется в вашу новую систему
- mkdir / newubuntu / home / distr /
- cp $pathstp / chrootsetup.sh / newubuntu / home / distr / #копирование второй части установки внутрь новой системы
- cp $path / newubuntu / home / distr #пригодится нам еще образ
- mount -o bind / dev / newubuntu / dev #необходимо для установки GRUB
- mount -o bind / proc / newubuntu / proc #необходимо для вообще работы новой системы
- LANG = chroot / newubuntu / home / distr / chrootsetup.sh #переход к выполнению скрипта уже в новой системе
* This source code was highlighted with Source Code Highlighter .
Второй файл chrootsetup.sh
- #!/bin/bash
- user =slimer #имя будущего юзера
- disk = / dev / sdb3 #раздел на который будет ставиться убунту.
- obraz =ubuntu- 9.04 -alternate-i386.iso
- mount -t sysfs sysfs / sys #монтирование sysfs
- dpkg-reconfigure console-setup #настройка языка в консоли и всего прочего
- mkdir / mnt / cd #создание папки для монтирования образа
- mount -o loop / home / distr / $obraz / mnt / cd #монтирование образа
- apt-get update #получение пакетов из образа
- apt-get install ubuntu-standard grub linux-image linux-image-generic linux-headers-generic build-essential ssh samba -y #установка важных и нужных пакетов
- apt-get install ubuntu-desktop gnome-user-guide-ru language-pack-gnome-ru language-pack-ru -y #установка gnome
- #apt-get install xubuntu-desktop -y #у кого образ xubuntu раскоментируйте эту строчку и закомментируйте предыдущюю
- #apt-get install kubuntu-desktop -y #у кого образ kubuntu раскоментируйте эту строчку и закомментируйте 2 предыдущих
- cp / proc / mounts / etc / mtab #необходимо для grub
- grub-install —recheck $disk #установка grub
- echo «Добавление Юзера. Сейчас вам будет предложено ввести пароль и свои данные»
- adduser $user #создание пользователя
- addgroup —system admin #создание группы
- adduser $user admin #добавление юзера в группу админ
- cp / etc / apt / sources.inet / etc / apt / sources.list #Замена источников с диска на источники с интернета
- apt-get update
- #apt-get purge ekiga evolution evolution-common evolution-data-server pidgin pidgin-data transmission-common rhythmbox totem totem-common -y #удаляю всякую чепуху ненужную. можете закомментировать.
- apt-get dist-upgrade -y
* This source code was highlighted with Source Code Highlighter .
Содержание /home/setup/sourcescd должно быть примерно таким:
deb file:///mnt/cd/ jaunty restricted universe main multiverse stable unstable
Идем дальше. После того как установилось, редактируем файл fstab, который находится в /newubuntu/etc/. В одной вкладке терминала пишем:
Через редактор разделов легко разобраться что есть что и подправить под свои нужды fstab, желательно по UUID, а то эти все /dev/sdxx не очень надежны и не постоянны. После того, как закончили, выполняем команду:
sudo LANG = chroot / newubuntu / bin / bash
sudo update-grub
Создается файл menu.lst. По усмотрению, можете поправить /etc/hosts, hostname…
Вроде бы все. Скрипт примитивный. Если где ошибся — исправляйте!
Повторю еще раз: ПРОСМОТРИТЕ СКРИПТ И ИСПРАВЬТЕ МОИ ПУТИ НА СВОИ.
Не забудьте присвоить скриптам атрибут исполнения:
И все =) Запустите файл setup.sh из папки /home/setup/ и откиньтесь на спинку кресла идите пить чай или смотреть фильм, но не забудьте присматривать за выполнением скрипта. Пока он выполняется, будут выдаваться кое-какие вопросы. Например пароль, язык.
Для вашего удобства выкладываю все скрипты в одном архиве.
Скачать можно по любой из ссылок: 1, 2, 3
Источник
Ubuntu Documentation
If you already have Ubuntu installed, it is easy to upgrade using the Update Manager. However, this is not always safe, and it will overwrite your old system.
If upgrading is not an option (you are running a different Linux distro than Ubuntu, or your system is several versions old), or you wish to keep your old system, you should use the live Ubuntu Desktop installer or Debootstrap.
The Ubuntu Desktop installer is usually run on a DVD or a bootable USB stick. However, if you already run Linux, using a DVD or USB is not necessary. You may run the Ubuntu Desktop installer directly from your hard drive, or use Debootstrap.
Note: These are advanced installation techniques and are not recommended for new users. If you are uncomfortable with the command line terminal, you should create a live Ubuntu Desktop DVD or USB.
Running the Ubuntu Desktop installer from your hard drive requires an extra partition. Debootstrap installs Ubuntu directly, without using the guiding Ubuntu Desktop installer. Debootstrap does not require a DVD, USB, Ubuntu Desktop ISO, or an extra installer partition.
Live Ubuntu Desktop from Hard Drive
The Ubuntu Desktop installer is distributed as a .iso file — get it here. If you don’t want to download an ISO, use Debootstrap. If your ISO has «alternate» in its name, you are using an alternate installation image and should see the next section.
Note: You will need blank hard drive space to create new partitions. If your current system partition(s) take up all available space, you must create a live DVD or live USB.
Step 1, Partition
Create a new ext4 partition for the installer, using gparted. The partition must be a little larger than the install image (for example, if du -h disk-image.iso returns 1.1GB, make the partition 1.2GB). Remember the name of the new partition (for example, /dev/sda3).
Step 2, Copy
Copy Ubuntu Desktop installer contents over to the new partition using the commands
Replace disk-image.iso with the path to your disk image and /dev/sda3 with the new partition.
Step 3, Grub
Configure grub2. Edit the file /etc/grub.d/40_custom and add the lines
Replace Ver. with the version number and (hd0,3) with the new partition (for example, /dev/sda3 becomes (hd0,3) because Grub 2 counts drives from 0, but partitions from 1).
Then run update-grub to rebuild the grub configuration.
Step 4, Reboot
Reboot, and choose «installer» from the grub boot menu, and continue as if you were installing from CD. Be sure to set the root partition to another new partition, different from the installer; do not overwrite the whole drive.
Step 5, Grub (again)
The installer may not add an entry in Grub for the new version of Ubuntu. You will have to do this manually.
Older Versions of Ubuntu
Older verions of Ubuntu may use /casper/vmlinuz instead of /casper/vmlinuz.efi
For even older versions of Ubuntu with grub1, change the grub configuration file (typically /etc/grub.conf or /boot/grub/menu.lst) to boot from the new partition by adding the lines
The first line after the title tells grub which partition contains the installer. hd0 stands for «first hard disk,» and the 0 following it standards for first partition. You will need to change this if your installer partition is different from /dev/sda1. sdaN becomes (hd0, N-1), sdbN becomes (hd1,N-1) and so on. As you can see, grub starts counting from 0, which can be confusing.
If you are trying to use Hard Disk installation with Ubuntu 9.10 chances are initrd.gz is renamed as initrd.lz now. So rename accordingly in menu.lst.
Note (old, for grub1) You do not need to modify the grub config of the existing linux system, if you feel uncomfortable modifying an otherwise fine running system. Instead, you may create a new menu.lst file on the new partition, preferably in directory /boot/grub/. Then, reboot, and when the (old) grub menu appears, press ‘c’ to get the grub command line. Then, type: configfile (hd0,1)/boot/grub/menu.lst to switch over to your new grub menu. Tip: use the tab-key halfway typing to have grub help you complete the command, or grub commands such as search or help.
Note: if you unpacked the livecd on the same disk where you want to install Ubuntu, you may run into LP#288675, and be unable to select a partition. The workaround by Nick Spencer («sudo umount -l -r -f /dev/sda3 or sudo umount -l -r -f /cdrom (where sda3 was the device mounted as cdrom)») is a rather terrible hack, but usable as a workaround.
Note2: Instead of using ‘workaround’, an alternative is to modify the file /etc/mtab by erasing the line that specifies the partition where the cdrom is mounted. This way the kernel thinks that the /cdrom is not mounted and will not show the advice when installing ubuntu. I think this procedure is less dangerous than the one in the previous note.
Note3: Instead of the above ‘workarounds’, you may simply use the boot option live-media=/dev/sdb1 or LIVEMEDIA=/dev/sdb1, referring to the USB device holding the ISO. This would be the «bootable usb», even if your pc has a «buggy BIOS» and cannot boot from USB. The running kernel can access the USB device. This boot option is documented in http://manpages.ubuntu.com/manpages/karmic/man7/casper7.html, but unfortunately not supported by Ubuntu 11.10. Use the patch I filed as bug fix in https://bugs.launchpad.net/ubuntu/+source/casper/+bug/423616 while this is not yet put back in the ISO. Warning: this implies building a new initrd.gz which is not very trivial, although this forum has a good manual.
Debootstrap
You can install Ubuntu directly from Linux using debootstrap. Debootstrap installs some essential packages in a directory for use with chroot. Note that the essential packages does not in itself make the system bootable. It just installs what you need to chroot to that directory and use apt-get to install other packages which make Ubuntu usable.
Step 1. First check that you have debootstrap installed.
(NOTE: if you want to install a newer release than your current system, you normally need to install the backported debootstrap version, see: UbuntuBackports)
Step 2. Partition device and make a filesystem.
We will assume /dev/sda is the storage device for your fresh install.
Remove former partitions and create the new one.
Make the filesystem
Step 3. Mount that new partition.
Step 4. Download and install base system packages.
Step 5. Copy files to the new install to keep your repositories
Step 6. Chroot to your new install.
Step 7. Locale and language settings To make dpkg run without warning you need to set this settings first
Step 8. Upgrade the new install. Install your local «language-pack-en-base».
If you are using Software RAID and/or LVM, you should install these packages before installing a kernel:
Step 9. Install Grub and Linux Kernel.
Step 10. Add user and/or set root password.
To add a user and set a password for that user.
You may also want to add your user to the sudo group so that user can run programs as root.
To set a root password:
(NOTE: You must at least set a root password if you aren’t adding a user)
Step 11. Create fstab. A simple example of fstab is
It should now be safe to reboot; you may want the next few things.
Step 12. If you want to access it with ssh after reboot.
Use vi or install nano to edit /etc/hostname.
Remove any text in this file and add the hostname you would like.
Add these lines to /etc/network/interfaces. This will start eth0 at boot and request an IPv4 address with dhclient.
Next you need to install ssh
Your computer should be safe to reboot now. If you want the Ubuntu Gnome desktop, continue with Step 13.
Step 14. Install ubuntu-desktop.
Step 15. Reboot and keep those fingers crossed.
Alternate CD
As of December 29th 2007, the instructions above do not apply to the alternate CD provided for Ubuntu 7.10 (Gutsy Gibbon). Significant changes are required. Procedure 1 below has been used successfully with Gutsy (Ubuntu 7.10) and Procedure 2 with Hardy (Ubuntu 8.04).
Before going any further please note that the alternate CD contains documentation which can help with fixing problems or adapting solutions to your own situation. The documentation is located in doc/install/manual/ on the alternate CD. Please refer to that documentation as needed.
Note that Procedure 2 is potentially less disruptive because it does not call for a new partition.
For a simpler installation method which generally does not require re-partitioning, and downloads the packages at install time rather than requiring an ISO, see Installation/NetbootInstallFromInternet.
Procedure 1
I used the following procedure for Gutsy. It can also be used for Hardy.
Step 1. Use gparted to create a new primary partition and format it to ext3. You need slightly more than 700MB of free space on it. 750MB should be sufficient. Let’s say the name of the partition is /dev/sda1. If your new ubuntu install is going to coexist with your old system, you might find it convenient to create space for your new system as well at this point using gparted.
Step 2. Copy your alternate ISO to the root of the partition you created in step 1. You need to copy the ISO itself rather than the contents of the ISO.
Step 3. Grab the initrd.gz and vmlinuz files found in the following sub-directory of a Ubuntu mirror:
Put these files in your newly created partition. They can be in the root of the partition or in a sub-directory.
Step 4. Edit your grub configuration file (typically /etc/grub.conf or /boot/grub/menu.lst) to boot from the new partition by adding the lines:
If you use LILO, see the official documentation on the alternate CD for how to configure LILO. Or you can adapt the lines above for LILO if you know Grub and LILO well.
The first line after the title tells grub which partition contains the installer. hd0 stands for «first hard disk,» and the 0 following it standards for first partition. You will need to change this if your installer partition is different from /dev/sda1. sdaN becomes (hd0, N-1), sdbN becomes (hd1,N-1) and so on. As you can see, grub starts counting from 0, which can be confusing. The paths for the kernel and the initrd were set to start with /install/ in my setup but you could put those files in the root of the install partition and have them be /vmlinuz and /initrd.gz if you so wish.
As specified in the above, the installer will run without a preseed file. The preseed tells the installer what kind of system you are trying to install and it automatically selects some options for you during installation. For instance, using the ubuntu.seed file tells the installer that you want to install a full «desktop» system, with Gnome and everything. If you do not select a preseed file, it is unclear what the installer thinks. In my (LouisDominiqueDubeau) experience, it installs some sort of CLI or server form of Ubuntu. This is not disastrous but it may not be what you want. In Hardy in particular, running the installer without a seed results in LILO installed as the boot loader rather than Grub. Ugly. So it is better to select a seed. Adding the parameter file=/cdrom/preseed/ubuntu.seed to the kernel line above should take care of the problem. If installing Kubuntu, select kubuntu.seed instead. Adapt to other situations as needed.
Step 5. Reboot, and choose «installer» from the grub boot menu, and continue as normal.
Procedure 2
In this procedure you do not create a new partition to hold the installer. This procedure was used for Hardy. It may be adaptable for Gutsy.
Step 1. Copy your alternate ISO to the root of any partition that the installer can mount. You need to copy the ISO itself rather than the contents of the ISO. The important part here is that you must find a partition that the installer can mount, as it will search during the install procedure. If you use the traditional partitioning system used by DOS since ages immemorial, then any filesystem supported by Ubuntu should work. In particular ext2/ext3/ntfs/fat/vfat should all work. If you use LVM, things are trickier. As of April 26th 2008, the installer is unable to find an ISO stored on a partition managed in LVM. The installer can install Ubuntu in an LVM partition but in the stage at which it looks for the ISO it has not yet loaded the LVM modules so it cannot find the ISO if it is on an LVM partition. An enterprising person should be able to work around that problem but by default the installer won’t find the ISO if it is on an LVM partition. If you have Windows installed, then the Windows partition, which normally is not managed by LVM (because I don’t think Windows supports LVM), can hold the ISO.
Step 2. Grab the initrd.gz and vmlinuz files found in the following subdirectory of a Ubuntu mirror:
You will want to put these files in your normal /boot/ directory. It may be a good idea to create a subdirectory like newinstall, hardy-install, or something similar.
Step 3. Read the information at step 4 of procedure 1 above and then come back here: the information there will tell you what hd0,0 means and will inform you about seeds, etc. Edit your grub configuration file (typically /etc/grub.conf or /boot/grub/menu.lst) to boot from the new partition by adding the lines:
If you want a preseed file, change the kernel line to:
Note that some users report working installs with grub without seeds and/or seeds not working with this method. Adapt as needed to your situation.
Step 4. Reboot, and choose «installer» from the grub boot menu, and continue the installation as normal.
Alternate CD Alternate Method
I have a machine without a CD-ROM drive but with a network connection, and I struggled with these instructions for many days. Finally, I stumbled upon some straightforward solutions which appear to work for me.
1. Obtain Alternate CD. (This method may work for other CDs, I have not tried)
2. Mount at a temporary location, as described previously.
3. Copy vmlinuz and initrd.gz from mounted installation media to normal location on current linux root (the one to be replaced)
4. Unmount CDROM image.
5. Copy image as is to selected partition, i.e. cat "image" > /dev/hdXX
6. Configure grub or LILO as above
8. When choosing CD-ROM drive, choose manually, do not install a driver, for the device enter the partition to which you copied the image.
9. Continue installation as normal.
So far so good! I’ll let you know if it breaks later 😛
Troubleshooting
- If you are having issues installing grub, and dpkg-reconfigure grub-pc does not give you a chance to select the device you want to install grub to, make sure you have mounted /dev in your chroot. Review step 6.
Installation/FromLinux (последним исправлял пользователь jamiesonc 2020-06-23 22:49:53)
The material on this wiki is available under a free license, see Copyright / License for details
You can contribute to this wiki, see Wiki Guide for details
Источник