issue216:tutoriel1
Différences
Ci-dessous, les différences entre deux révisions de la page.
Prochaine révision | Révision précédente | ||
issue216:tutoriel1 [2025/04/14 08:26] – créée philou511 | issue216:tutoriel1 [2025/04/29 16:20] (Version actuelle) – d52fr | ||
---|---|---|---|
Ligne 1: | Ligne 1: | ||
- | I recently read a book called Linux Unveiled, that only unveiled that the author, ‘Half-job Hussain’, had no idea how to show newbies around. I did like some of the book somewhat (very little), so I’ll be stealing some of that to do a proper job for our FCM newbies. (No, I will not be using anything from that horrible book). I’ll try to take a more hands-on approach, so I would ask you to keep your terminal emulators open and follow along, just to get the muscle-memory going. Now obviously I cannot cover a whole book’s worth of stuff here, but I’m thinking CPU, memory and disk… This can then tie into some of the LPI stuff we are covering elsewhere. That means there will be homework, but I’ll keep it short. | + | **I recently read a book called Linux Unveiled, that only unveiled that the author, ‘Half-job Hussain’, had no idea how to show newbies around. I did like some of the book somewhat (very little), so I’ll be stealing some of that to do a proper job for our FCM newbies. (No, I will not be using anything from that horrible book). I’ll try to take a more hands-on approach, so I would ask you to keep your terminal emulators open and follow along, just to get the muscle-memory going. Now obviously I cannot cover a whole book’s worth of stuff here, but I’m thinking CPU, memory and disk… This can then tie into some of the LPI stuff we are covering elsewhere. That means there will be homework, but I’ll keep it short. |
By this issue, I’m assuming you added the second drive to your VM or added a physical drive to your metal. If you did not, do it quickly before continuing this article as it will revolve around you doing some practical work. | By this issue, I’m assuming you added the second drive to your VM or added a physical drive to your metal. If you did not, do it quickly before continuing this article as it will revolve around you doing some practical work. | ||
- | (As you can see, mine is added) | + | (As you can see, below, mine is added)** |
- | Now for a quick check, with: df -h | + | J'ai récemment lu un livre intitulé Linux Unveiled (Linux révélé), qui révélait simplement que l' |
- | Oh no! The disk is nowhere to be found. What to do? | + | À ce stade, je suppose que vous avez ajouté le deuxième disque à votre VM ou ajouté un disque physique à votre disque dur. Si ce n'est pas le cas, faites-le rapidement avant de poursuivre cet article, car il s' |
- | First, let’s list out the block devices. You remember how! (lsblk) | + | (Comme vous pouvez le voir ci-dessous, le mien est ajouté) |
- | You can infer from my image that I have a disk, named sda1, that is mounted to “/” - meaning that this is my Lubuntu drive. You can also see a sdb, that is the “right size” for the disk we added. Currently you can see it has no mount points. If you would try to click on it in your file manager, you would get an error. | + | **Now for a quick check, with: |
+ | df -h | ||
+ | |||
+ | Oh no! The disk is nowhere to be found. What to do? | ||
+ | |||
+ | First, let’s list out the block devices. You remember how! (lsblk, shown top right) | ||
+ | |||
+ | You can infer from my image that I have a disk, named sda1, that is mounted to “/” - meaning that this is my Lubuntu drive. You can also see a sdb, that is the “right size” for the disk we added. Currently you can see it has no mount points. If you would try to click on it in your file manager, you would get an error. | ||
Any ideas? This is because we have no filesystem, that disk is considered RAW. So even though you can see it, you cannot use it. | Any ideas? This is because we have no filesystem, that disk is considered RAW. So even though you can see it, you cannot use it. | ||
Ligne 19: | Ligne 26: | ||
Enter tool #1: cfdisk or fdisk | Enter tool #1: cfdisk or fdisk | ||
- | Right, open a terminal and type: sudo cfdisk /dev/sdb (as we saw in lsblk) | + | Right, open a terminal and type: sudo cfdisk /dev/sdb (as we saw in lsblk)** |
- | You will be prompted to choose a label type. We’ll just choose gpt for now. | + | Maintenant, une vérification rapide avec : |
- | Then, you will work from this screen: | + | df -h |
+ | Oh non ! Le disque est introuvable. Que faire ? | ||
+ | |||
+ | Commençons par lister les périphériques de type bloc. Vous vous souvenez comment ! (lsblk, en haut à droite) | ||
+ | |||
+ | Mon image montre un disque nommé sda1, monté sur « / », ce qui signifie qu'il s'agit de mon lecteur Lubuntu. Vous pouvez également voir un fichier sdb, de la taille appropriée pour le disque que nous avons ajouté. Actuellement, | ||
+ | |||
+ | Une idée ? Comme nous n' | ||
+ | |||
+ | Utilisez l' | ||
+ | |||
+ | Ok, ouvrez un terminal et saisissez : | ||
+ | |||
+ | |||
+ | **You will be prompted to choose a label type. We’ll just choose gpt for now. | ||
+ | |||
+ | Then, you will work from the screen shown above. | ||
Notice the row of commands along the bottom. | Notice the row of commands along the bottom. | ||
- | Since we have “free space” and we need a new partition, we choose “new” and since there is no mouse interaction here, with “new” highlighted, | + | Since we have “free space” and we need a new partition, we choose “new” and since there is no mouse interaction here, with “new” highlighted, |
- | OK, but currently, the changes are only proposed, we need to write our changes to the disk. Select “write” and follow the prompts, to get your new disk sorted. We can now quit, highlight “quit” and press enter. Run lsblk again and compare the differences. You should see that sdb now has a partition, named sdb1. We are almost there, but not quite yet. We need a filesystem for the new disk. Let’s do it in the terminal also. Type: sudo mkfs.ext4 /dev/sdb1 | + | Vous serez invité à choisir un type d' |
+ | Vous travaillerez ensuite à partir de l' | ||
+ | |||
+ | Remarquez la rangée de commandes en bas. | ||
+ | |||
+ | Comme nous avons de l' | ||
+ | |||
+ | |||
+ | **OK, but currently, the changes are only proposed, we need to write our changes to the disk. Select “write” and follow the prompts, to get your new disk sorted. We can now quit, highlight “quit” and press enter. Run lsblk again and compare the differences. You should see that sdb now has a partition, named sdb1. We are almost there, but not quite yet. We need a filesystem for the new disk. Let’s do it in the terminal also. Type: | ||
+ | sudo mkfs.ext4 /dev/sdb1 | ||
Wham-bam-thankyou-mam and we are done. Here in Lubuntu, you can see that when I click on the drive, it mounts it, but it also has an eject symbol next to it (under devices). That is because it is not “permanently” mounted. For that, we need to edit the fstab file. However, we are not going to, as this drive is temporary, and faffing with fstab is dangerous for newbies, especially if you did not follow in a virtual machine. | Wham-bam-thankyou-mam and we are done. Here in Lubuntu, you can see that when I click on the drive, it mounts it, but it also has an eject symbol next to it (under devices). That is because it is not “permanently” mounted. For that, we need to edit the fstab file. However, we are not going to, as this drive is temporary, and faffing with fstab is dangerous for newbies, especially if you did not follow in a virtual machine. | ||
- | Since you know how, please check how much of the disk is free, via the terminal. You can use the -l modifier to see only local filesystems, | + | Since you know how, please check how much of the disk is free, via the terminal. You can use the -l modifier to see only local filesystems, |
- | If you were ever curious about what you could find out with the df command, type: df - - output ( that’s two dashes, no spaces). | + | OK, mais pour l' |
+ | |||
+ | sudo mkfs.ext4 /dev/sdb1 | ||
+ | |||
+ | Bon, merci, et c'est terminé. Ici, dans Lubuntu, vous pouvez voir que lorsque je clique sur le lecteur, il est monté, mais il y a aussi un symbole d' | ||
+ | |||
+ | Puisque vous savez comment procéder, vérifiez l' | ||
+ | |||
+ | |||
+ | **If you were ever curious about what you could find out with the df command, type: df - - output ( that’s two dashes, no spaces). | ||
That segues into something else, let’s check the status of our new disk. Oh no! We cannot check the S.M.A.R.T. status, as virtual machines do not support S.M.A.R.T. So any smarty pants who jumped the gun, good on you! I love to see it! | That segues into something else, let’s check the status of our new disk. Oh no! We cannot check the S.M.A.R.T. status, as virtual machines do not support S.M.A.R.T. So any smarty pants who jumped the gun, good on you! I love to see it! | ||
Ligne 43: | Ligne 84: | ||
We can also get more information from lsblk, simply type lsblk -fs in your terminal and peruse the output. | We can also get more information from lsblk, simply type lsblk -fs in your terminal and peruse the output. | ||
+ | Now I need to send you down the rabbit-hole. Clear your terminal with CTRL+L or the clear command, as we will need space. Type: | ||
+ | udevadm info -ap / | ||
+ | Si vous vous êtes déjà demandé ce que la commande df pouvait vous apprendre, saisissez : | ||
+ | Ceci nous amène à autre chose : vérifions l’état de notre nouveau disque. Oh non ! Nous ne pouvons pas vérifier l’état S.M.A.R.T., car les machines virtuelles ne le prennent pas en charge. Alors, félicitations à tous les petits malins qui ont anticipé ! J’adorerais voir ça ! | ||
+ | Nous pouvons également obtenir plus d’informations à partir de lsblk : saisissez simplement lsblk -fs dans votre terminal et consultez le résultat. | ||
+ | Maintenant, je dois vous envoyer dans le terrier du lapin. Videz votre terminal avec Ctrl+L ou la commande clear, car nous aurons besoin d’espace. Saisissez : | ||
- | Now I need to send you down the rabbit-hole. Clear your terminal with CTRL+L or the clear command, as we will need space. Type: udevadm info -ap / | + | udevadm info -ap / |
- | This displays the whole tree related to /dev/sdb, there should be pages of information. If you wanted a bit less, you could try: mount | grep sdb | + | **This displays the whole tree related to /dev/sdb, there should be pages of information. If you wanted a bit less, you could try: mount | grep sdb |
You’d notice that you can see the UUID in both this mount command as well as in lsblk -fs. Remember that, before you just start poking about in fstab as a newbie. | You’d notice that you can see the UUID in both this mount command as well as in lsblk -fs. Remember that, before you just start poking about in fstab as a newbie. | ||
- | With the mount command we can also find out more about our filesystem; type: mount | grep ext4 - and see what you get. :) | + | With the mount command we can also find out more about our filesystem; type: |
+ | |||
+ | mount | grep ext4 | ||
+ | |||
+ | and see what you get. | ||
I’m going to end this one here, as I want us to do more exploring in the next issue, so see you there! | I’m going to end this one here, as I want us to do more exploring in the next issue, so see you there! | ||
- | As per usual, if you see a mistake, let us know: misc@fullcirclemagazine.org | + | As per usual, if you see a mistake, let us know: misc@fullcirclemagazine.org** |
+ | |||
+ | Ceci affiche l' | ||
+ | |||
+ | Vous remarquerez que l'UUID est visible à la fois dans cette commande mount et dans lsblk -fs. N' | ||
+ | |||
+ | Avec la commande mount, nous pouvons également en savoir plus sur notre système de fichiers ; saisissez : | ||
+ | |||
+ | mount | grep ext4 | ||
+ | |||
+ | et voyez ce que vous obtenez. | ||
+ | |||
+ | Je termine ici, car je souhaite que nous approfondissions notre exploration dans le prochain numéro, alors à bientôt ! | ||
+ | |||
+ | Comme d' | ||
issue216/tutoriel1.1744612008.txt.gz · Dernière modification : 2025/04/14 08:26 de philou511