issue121:tutoriel2
Différences
Ci-dessous, les différences entre deux révisions de la page.
Prochaine révision | Révision précédente | ||
issue121:tutoriel2 [2017/05/29 16:55] – créée auntiee | issue121:tutoriel2 [2017/06/07 16:01] (Version actuelle) – andre_domenech | ||
---|---|---|---|
Ligne 1: | Ligne 1: | ||
- | Installing Ubuntu is not a complex process these days. Downloading an ISO image, and alternatively burning a DVD or creating a bootable USB to launch a LiveCD that can then be installed, is a well-documented process. Looking back at earlier times, this was not always the case. Many of us can still remember when the Knoppix CD was the first GNU/Linux distribution that could actually launch a live environment, | + | **Installing Ubuntu is not a complex process these days. Downloading an ISO image, and alternatively burning a DVD or creating a bootable USB to launch a LiveCD that can then be installed, is a well-documented process. Looking back at earlier times, this was not always the case. Many of us can still remember when the Knoppix CD was the first GNU/Linux distribution that could actually launch a live environment, |
- | However, we are never satisfied. Having to burn the image to a CD or DVD just to test out a new distribution soon lost its attractiveness. Using an USB pendrive was a move in the good direction, but nowadays one does not always have a spare pendrive lying around. I tend to lose mine, and think I may possibly not be the only one. Most administrators of large networks soon learn to make an ISO image available to boot over the network using PXE, but this may not always be possible, or even attractive, for more casual users, since it does mean messing around with your local DHCP server. | + | However, we are never satisfied. Having to burn the image to a CD or DVD just to test out a new distribution soon lost its attractiveness. Using an USB pendrive was a move in the good direction, but nowadays one does not always have a spare pendrive lying around. I tend to lose mine, and think I may possibly not be the only one. Most administrators of large networks soon learn to make an ISO image available to boot over the network using PXE, but this may not always be possible, or even attractive, for more casual users, since it does mean messing around with your local DHCP server.** |
- | So, what if we went one step further and did away completely with an installation medium? The scenario is as follows: suppose we have a functioning Ubuntu installation on a computer, at a certain version of the distribution. We then download a new version as an ISO file to our hard drive, and wish to install the new version over the existing one, without using any other local drives, an optical reader, or anything else connected via USB. It’s just us, and our computer’s single internal hard drive. | + | De nos jours, l' |
+ | |||
+ | Cependant, nous ne sommes jamais satisfaits. Devoir graver l' | ||
+ | |||
+ | **So, what if we went one step further and did away completely with an installation medium? The scenario is as follows: suppose we have a functioning Ubuntu installation on a computer, at a certain version of the distribution. We then download a new version as an ISO file to our hard drive, and wish to install the new version over the existing one, without using any other local drives, an optical reader, or anything else connected via USB. It’s just us, and our computer’s single internal hard drive. | ||
A point to be noted is that we will be needing sufficient RAM to hold most of the ISO image as well as running the Live CD environment, | A point to be noted is that we will be needing sufficient RAM to hold most of the ISO image as well as running the Live CD environment, | ||
- | Read on, dear reader, and find out how. Though, be warned: things will likely get fairly geeky at times. Do not try this on a computer you would not be happy to format completely, and make a backup of any user data before proceeding. Qapla' | + | Read on, dear reader, and find out how. Though, be warned: things will likely get fairly geeky at times. Do not try this on a computer you would not be happy to format completely, and make a backup of any user data before proceeding. Qapla'!** |
+ | |||
+ | Aussi, pourquoi ne pas franchir un pas de plus et le faire totalement sans média d' | ||
+ | |||
+ | Un point à noter, c'est que nous aurons besoin d'une RAM suffisante pour contenir la majorité de notre image ISO tout en tournant dans un environnement de Live CD ; aussi, notre ordinateur sera au mieux avec au moins 4 gigaoctets de taille mémoire, ce qui est standard pour les portables depuis quelque temps maintenant. | ||
+ | |||
+ | Lisez la suite, cher lecteur, et découvrez comment. Attention, cependant : certaines choses pourraient devenir assez « geeky » (techniques) par moments. N' | ||
- | I started out with a very slightly tweaked installation of Ubuntu 14.04. Partitioning of the hard drive was left to the Ubuntu installer’s default settings, and as a result we ended up with only two partitions: | + | **I started out with a very slightly tweaked installation of Ubuntu 14.04. Partitioning of the hard drive was left to the Ubuntu installer’s default settings, and as a result we ended up with only two partitions: |
/dev/sda1 (ext4 file format) containing both the operating system and user data; | /dev/sda1 (ext4 file format) containing both the operating system and user data; | ||
Ligne 17: | Ligne 27: | ||
The only main changes done to the system configuration are user preferences such as the WiFi network, Firefox browser history, and the desktop background. It would be nice to retain these, as well as any user files on the hard drive. | The only main changes done to the system configuration are user preferences such as the WiFi network, Firefox browser history, and the desktop background. It would be nice to retain these, as well as any user files on the hard drive. | ||
- | I then downloaded a more recent version of Ubuntu, ISO file: “ubuntu-16.10-desktop-amd64.iso”, | + | I then downloaded a more recent version of Ubuntu, ISO file: “ubuntu-16.10-desktop-amd64.iso”, |
- | Booting from an ISO image | + | Au départ, j' |
+ | |||
+ | /dev/sda1 (format de fichiers ext4) contenant le système d' | ||
+ | |||
+ | /dev/sda2 comme espace de swap. | ||
+ | |||
+ | Les seuls changements importants effectués au système d' | ||
+ | |||
+ | j'ai ensuite téléchargé une version d' | ||
+ | |||
+ | **Booting from an ISO image | ||
The first major challenge in this project is to boot from the ISO file image on our hard drive. Luckily, GRUB is well able to do this - with some persuading from the command-line. However, when a single Ubuntu system is installed on a drive, then, when booting, the default GRUB configuration times out and immediately launches the only operating system it sees. We will need some time to enter GRUB command-line mode. To solve this problem, edit the default configuration file using: | The first major challenge in this project is to boot from the ISO file image on our hard drive. Luckily, GRUB is well able to do this - with some persuading from the command-line. However, when a single Ubuntu system is installed on a drive, then, when booting, the default GRUB configuration times out and immediately launches the only operating system it sees. We will need some time to enter GRUB command-line mode. To solve this problem, edit the default configuration file using: | ||
Ligne 30: | Ligne 50: | ||
sudo update-grub | sudo update-grub | ||
- | We can then reboot. Once the GRUB menu comes up, hit key ‘c’ to obtain a command-line that starts with the ‘grub> | + | We can then reboot. Once the GRUB menu comes up, hit key ‘c’ to obtain a command-line that starts with the ‘grub> |
- | We now need to tell GRUB to use the first partition of our hard drive as its boot drive. We then tell it to identify the ISO filename in variable $isofile. We create a loopback drive with the filename, which basically sets up the file as a virtual disk drive. We then load the Linux kernel and the initial RAM disk. So, successively: | + | Démarrer sur l' |
+ | |||
+ | La première grande difficulté de ce projet est de démarrer sur le fichier de l' | ||
+ | |||
+ | sudo gedit / | ||
+ | |||
+ | en commentant ou effaçant la ligne qui commence par GRUB_HIDDEN_TIMEOUT. Ensuite, cette configuration doit être mise en place avec la commande : | ||
+ | |||
+ | sudo update-grub | ||
+ | |||
+ | Nous pouvons alors redémarrer. Une fois le menu GRUB affiché, appuyez sur la touche « c » pour obtenir une ligne de commande qui commence par l' | ||
+ | |||
+ | **We now need to tell GRUB to use the first partition of our hard drive as its boot drive. We then tell it to identify the ISO filename in variable $isofile. We create a loopback drive with the filename, which basically sets up the file as a virtual disk drive. We then load the Linux kernel and the initial RAM disk. So, successively: | ||
set root=(hd0, | set root=(hd0, | ||
Ligne 46: | Ligne 78: | ||
boot | boot | ||
- | Naturally, these commands may need to be tailored to suit your specific setup, both as regards the partition on which the ISO file is located, and concerning the filename and directory. Please take extra care to append parameter ‘toram’ to the line loading the kernel - this shall be explained further on. | + | Naturally, these commands may need to be tailored to suit your specific setup, both as regards the partition on which the ISO file is located, and concerning the filename and directory. Please take extra care to append parameter ‘toram’ to the line loading the kernel - this shall be explained further on.** |
- | We should boot successfully into the LiveCD environment. Depending on the speed of our hard drive, boot times should compare favourably with that of booting from a USB pendrive and, obviously, without the hassle of actually creating the USB drive in the first place. | + | Nous devons maintenant dire à GRUB d' |
+ | |||
+ | set root=(hd0, | ||
+ | |||
+ | set isofile=/ | ||
+ | |||
+ | loopback loop (hd0, | ||
+ | |||
+ | linux (loop)/ | ||
+ | |||
+ | initrd (loop)/ | ||
+ | |||
+ | boot | ||
+ | |||
+ | Naturellement, | ||
+ | |||
+ | **We should boot successfully into the LiveCD environment. Depending on the speed of our hard drive, boot times should compare favourably with that of booting from a USB pendrive and, obviously, without the hassle of actually creating the USB drive in the first place. | ||
If all we need is to test the new distribution, | If all we need is to test the new distribution, | ||
- | But, since we wish to install the new system onto our hard drive, some tweaks need to be applied. The main question that needs to be addressed is the fact that the Unity installer, Ubiquity, does not like to modify a partition on a disk drive that it has booted from - and our ISO image is contained within the same partition /dev/sda1 which we will now be modifying. | + | But, since we wish to install the new system onto our hard drive, some tweaks need to be applied. The main question that needs to be addressed is the fact that the Unity installer, Ubiquity, does not like to modify a partition on a disk drive that it has booted from - and our ISO image is contained within the same partition /dev/sda1 which we will now be modifying.** |
- | Now, the parameter ‘toram’ appended to the kernel in GRUB comes to the fore. This parameter told the kernel (through the Casper boot hook) to load the complete ISO file into RAM during boot. It is for this reason that we need a bit more RAM available to us than would normally be required to boot a Live CD. The time taken to load the file into RAM also explains why the boot process may seem slightly slower than expected if our computer has a fast SSD hard drive. | + | Nous devrions démarrer avec succès dans un environnement de Live CD. Suivant la vitesse de notre disque dur, la comparaison des temps de démarrage avec ceux d'un démarrage sur clé USB est favorable et, évidemment, |
+ | |||
+ | Si notre seul besoin est de tester la nouvelle distribution, | ||
+ | |||
+ | Mais, comme nous souhaitons installer le nouveau système sur notre disque dur, quelques ajustements sont nécessaires. La question principale à résoudre est que l' | ||
+ | |||
+ | **Now, the parameter ‘toram’ appended to the kernel in GRUB comes to the fore. This parameter told the kernel (through the Casper boot hook) to load the complete ISO file into RAM during boot. It is for this reason that we need a bit more RAM available to us than would normally be required to boot a Live CD. The time taken to load the file into RAM also explains why the boot process may seem slightly slower than expected if our computer has a fast SSD hard drive. | ||
However, even though the ISO file’s contents have been loaded into RAM, the file itself is still left mounted on the directory /isodevice. This needs to be unmounted with the command: | However, even though the ISO file’s contents have been loaded into RAM, the file itself is still left mounted on the directory /isodevice. This needs to be unmounted with the command: | ||
Ligne 61: | Ligne 115: | ||
before proceeding. We can check that no other disks have been left mounted with the command: | before proceeding. We can check that no other disks have been left mounted with the command: | ||
+ | |||
+ | mount | grep sd** | ||
+ | |||
+ | Maintenant, le paramètre « toram » ajouté au noyau dans GRUB vient sur le devant de la scène. Ce paramètre dit au noyau (par l' | ||
+ | |||
+ | Cependant, même si le contenu du fichier ISO a été chargé en RAM, le fichier lui-même est encore monté dans le répertoire /isodevice. Il est nécessaire de le démonter avec la commande : | ||
+ | |||
+ | sudo umount /isodevice | ||
+ | |||
+ | avant de poursuivre. Nous pouvons vérifier qu' | ||
mount | grep sd | mount | grep sd | ||
- | We should see one single line reporting on gvtsd-fuse, and nothing more. Once this is the case, we can proceed with system installation in the usual way. The one caveat is concerning disk partitioning. To retain user files, it is best to select ‘Something else’ and partition the hard disk manually. In my (very simple) situation, I will choose /dev/sda1, use it as an extended 4 file system mounted on /, but NOT format it. In essence, I am retaining the very same partitioning scheme used before. | + | **We should see one single line reporting on gvtsd-fuse, and nothing more. Once this is the case, we can proceed with system installation in the usual way. The one caveat is concerning disk partitioning. To retain user files, it is best to select ‘Something else’ and partition the hard disk manually. In my (very simple) situation, I will choose /dev/sda1, use it as an extended 4 file system mounted on /, but NOT format it. In essence, I am retaining the very same partitioning scheme used before. |
Since we are not formatting the partition destined for installing the operating system, the installer will complain about this and tell us that “Directories containing system files (/etc, /lib, /usr, /var, …) will be deleted during the install.” This is fine with us, since user data is contained within / | Since we are not formatting the partition destined for installing the operating system, the installer will complain about this and tell us that “Directories containing system files (/etc, /lib, /usr, /var, …) will be deleted during the install.” This is fine with us, since user data is contained within / | ||
- | If I were using a separate /home partition, I could tell the installer to mount it on /home, but obviously not to format it either. In either case, using the same user accounts’ names will enable us to find our files back in the same places and accessible on the new system. | + | If I were using a separate /home partition, I could tell the installer to mount it on /home, but obviously not to format it either. In either case, using the same user accounts’ names will enable us to find our files back in the same places and accessible on the new system.** |
+ | |||
+ | Nous ne devrions voir qu'une seule ligne faisant état de gvtsd-fuse, et rien d' | ||
+ | |||
+ | Comme nous ne formatons pas la partition destinée à l' | ||
+ | |||
+ | Si j' | ||
+ | |||
+ | **We can proceed with installation and, once finished, reboot as usual. As can be seen, all our user preferences and files - such as the desktop background - have been carried over. For whatever reason, the only element that was not preserved was the configuration for WiFi, which needed to be created anew. | ||
+ | |||
+ | The final result of this manipulation is that we have been able to reformat a computer running Ubuntu 14.04, with Ubuntu 16.10. This has been done by simply downloading the ISO file for the new version of the distribution, | ||
+ | |||
+ | Nous pouvons procéder à l' | ||
- | We can proceed with installation and, once finished, reboot as usual. As can be seen, all our user preferences and files - such as the desktop background - have been carried over. For whatever reason, the only element that was not preserved was the configuration for WiFi, which needed to be created anew. | + | Le résultat final de cette manipulation est que nous avons été capable de reformater un ordinateur, tournant sous Ubuntu 14.04, avec Ubuntu 16.10. Ça a été fait simplement en téléchargeant le fichier ISO de la nouvelle version de la distribution et en utilisant une combinaison de GRUB et Casper pour le démarrer en RAM, sans utiliser aucun disque autre que notre disque dur interne. Bien qu'il faille procéder avec beaucoup d' |
- | The final result of this manipulation is that we have been able to reformat a computer running Ubuntu 14.04, with Ubuntu 16.10. This has been done by simply downloading the ISO file for the new version of the distribution, |
issue121/tutoriel2.1496069711.txt.gz · Dernière modification : 2017/05/29 16:55 de auntiee