issue121:tutoriel2
Différences
Ci-dessous, les différences entre deux révisions de la page.
Les deux révisions précédentesRévision précédenteProchaine révision | Révision précédente | ||
issue121:tutoriel2 [2017/06/05 09:07] – d52fr | issue121:tutoriel2 [2017/06/07 16:01] (Version actuelle) – andre_domenech | ||
---|---|---|---|
Ligne 2: | Ligne 2: | ||
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.** | ||
+ | |||
+ | 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. | **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. | ||
Ligne 8: | Ligne 12: | ||
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: | ||
Ligne 18: | Ligne 28: | ||
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”, | ||
+ | |||
+ | 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 | **Booting from an ISO image | ||
Ligne 31: | Ligne 51: | ||
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> | ||
+ | |||
+ | 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: | **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: | ||
Ligne 47: | Ligne 79: | ||
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.** | ||
+ | |||
+ | 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. | **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. | ||
Ligne 53: | Ligne 101: | ||
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.** | ||
+ | |||
+ | 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. | **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. | ||
Ligne 63: | Ligne 117: | ||
mount | grep sd** | 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 | ||
**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. | ||
Ligne 69: | Ligne 133: | ||
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. | **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, | 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' | ||
+ | |||
+ | 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' | ||
+ |
issue121/tutoriel2.1496646431.txt.gz · Dernière modification : 2017/06/05 09:07 de d52fr