Salut,
j’ai essaye d’installer Debian 8 sur une clé usb, pas possible de booter à la fin de l’installation.
Ressources de départ
- un PC desktop Debian 8 Jessie XFCe en état de fonctionner ( le paquet syslinux y est installé)
# apt list syslinux
En train de lister... Fait
syslinux/stable,now 3:6.03+dfsg-5+deb8u1 i386 [installé]
ainsi que parted
# apt list parted
En train de lister... Fait
parted/stable,now 3.2-7 i386 [installé, automatique]
- une cle “A” usb live Debian 8 Jessie utilisée comme source de l’installation créée comme ça
imagewriter-ne-fonctionne-pas-sur-debian-8-3-t54561.html#p538286
image iso: debian-live-8.3.0-amd64-xfce-desktop.iso 20160124-16:00/ issue de
cdimage.debian.org/debian-cd/cur … so-hybrid/
Architectures: amd64
Codename: jessie
Components: main
Date: Sun, 24 Jan 2016 15:50:10 +0000
Description: Last updated: Sun, 24 Jan 2016 15:50:10 +0000
Label: Debian
Origin: Debian
Suite: jessie
Version: 8
- une clé “B” usb utilisée comme cible de l’installation
ca commence:
- Boot sur la clé “A”, sélection de graphical installation
- Installation de la clé B en sélectionnant installation complète sur un disque avec repartionnement de ce disque par Debian, je choisis le nom de machine cleusb, les mêmes utilisateurs et mots de passe que sur le PC
- Pas d’échec de l’installation.
- Ce que je constate: la cle B ne boot pas
Pas de MBR ni de boot flag sur la clé B
Cle B USB, MBR au départ
root@desktop:/# sudo dd if=/dev/sdh bs=512 count=1 | hexdump -C
1+0 enregistrements lus
1+0 enregistrements écrits
512 octets (512 B) copiés, 0,000301717 s, 1,7 MB/s
00000000 33 c0 fa 8e d8 8e d0 bc 00 7c 89 e6 06 57 8e c0 |3........|...W..|
00000010 fb fc bf 00 06 b9 00 01 f3 a5 ea 1f 06 00 00 52 |...............R|
00000020 52 b4 41 bb aa 55 31 c9 30 f6 f9 cd 13 72 13 81 |R.A..U1.0....r..|
00000030 fb 55 aa 75 0d d1 e9 73 09 66 c7 06 8d 06 b4 42 |.U.u...s.f.....B|
00000040 eb 15 5a b4 08 cd 13 83 e1 3f 51 0f b6 c6 40 f7 |..Z......?Q...@.|
00000050 e1 52 50 66 31 c0 66 99 e8 66 00 e8 35 01 4d 69 |.RPf1.f..f..5.Mi|
00000060 73 73 69 6e 67 20 6f 70 65 72 61 74 69 6e 67 20 |ssing operating |
00000070 73 79 73 74 65 6d 2e 0d 0a 66 60 66 31 d2 bb 00 |system...f`f1...|
00000080 7c 66 52 66 50 06 53 6a 01 6a 10 89 e6 66 f7 36 ||fRfP.Sj.j...f.6|
00000090 f4 7b c0 e4 06 88 e1 88 c5 92 f6 36 f8 7b 88 c6 |.{.........6.{..|
000000a0 08 e1 41 b8 01 02 8a 16 fa 7b cd 13 8d 64 10 66 |..A......{...d.f|
000000b0 61 c3 e8 c4 ff be be 7d bf be 07 b9 20 00 f3 a5 |a......}.... ...|
000000c0 c3 66 60 89 e5 bb be 07 b9 04 00 31 c0 53 51 f6 |.f`........1.SQ.|
000000d0 07 80 74 03 40 89 de 83 c3 10 e2 f3 48 74 5b 79 |..t.@.......Ht[y|
000000e0 39 59 5b 8a 47 04 3c 0f 74 06 24 7f 3c 05 75 22 |9Y[.G.<.t.$.<.u"|
000000f0 66 8b 47 08 66 8b 56 14 66 01 d0 66 21 d2 75 03 |f.G.f.V.f..f!.u.|
00000100 66 89 c2 e8 ac ff 72 03 e8 b6 ff 66 8b 46 1c e8 |f.....r....f.F..|
00000110 a0 ff 83 c3 10 e2 cc 66 61 c3 e8 76 00 4d 75 6c |.......fa..v.Mul|
00000120 74 69 70 6c 65 20 61 63 74 69 76 65 20 70 61 72 |tiple active par|
00000130 74 69 74 69 6f 6e 73 2e 0d 0a 66 8b 44 08 66 03 |titions...f.D.f.|
00000140 46 1c 66 89 44 08 e8 30 ff 72 27 66 81 3e 00 7c |F.f.D..0.r'f.>.||
00000150 58 46 53 42 75 09 66 83 c0 04 e8 1c ff 72 13 81 |XFSBu.f......r..|
00000160 3e fe 7d 55 aa 0f 85 f2 fe bc fa 7b 5a 5f 07 fa |>.}U.......{Z_..|
00000170 ff e4 e8 1e 00 4f 70 65 72 61 74 69 6e 67 20 73 |.....Operating s|
00000180 79 73 74 65 6d 20 6c 6f 61 64 20 65 72 72 6f 72 |ystem load error|
00000190 2e 0d 0a 5e ac b4 0e 8a 3e 62 04 b3 07 cd 10 3c |...^....>b.....<|
000001a0 0a 75 f1 cd 18 f4 eb fd 00 00 00 00 00 00 00 00 |.u..............|
000001b0 00 00 00 00 00 00 00 00 0d f3 1a f0 00 00 00 20 |............... |
000001c0 21 00 0b 7d 56 e7 00 08 00 00 00 78 77 00 00 00 |!..}V......xw...|
000001d0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
*
000001f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 55 aa |..............U.|
00000200
root@desktop:/#
Fin d’installation de Debian sur la clé B
[code]Disque /dev/sdh : 3,8 GiB, 4009754624 octets, 7831552 secteurs
Unités : secteur de 1 × 512 = 512 octets
Taille de secteur (logique / physique) : 512 octets / 512 octets
taille d’E/S (minimale / optimale) : 512 octets / 512 octets
Type d’étiquette de disque : dos
Identifiant de disque : 0xfac6a413
Device Boot Start End Sectors Size Id Type
/dev/sdh1 2048 7403519 7401472 3,5G 83 Linux
/dev/sdh2 7405566 7829503 423938 207M 5 Extended
/dev/sdh5 7405568 7829503 423936 207M 82 Linux swap / Solaris
La clé B n’est pas bootable [/code]
Relecture du MBR de la clé B, il est massacré
root@desktop:/# dd if=/dev/sdh bs=512 count=1 | hexdump -C
1+0 enregistrements lus
1+0 enregistrements écrits
512 octets (512 B) copiés, 0,000262326 s, 2,0 MB/s
00000000 fa b8 00 10 8e d0 bc 00 b0 b8 00 00 8e d8 8e c0 |................|
00000010 fb be 00 7c bf 00 06 b9 00 02 f3 a4 ea 21 06 00 |...|.........!..|
00000020 00 be be 07 38 04 75 0b 83 c6 10 81 fe fe 07 75 |....8.u........u|
00000030 f3 eb 16 b4 02 b0 01 bb 00 7c b2 80 8a 74 01 8b |.........|...t..|
00000040 4c 02 cd 13 ea 00 7c 00 00 eb fe 00 00 00 00 00 |L.....|.........|
00000050 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
*
000001b0 00 00 00 00 00 00 00 00 13 a4 c6 fa 00 00 00 20 |............... |
000001c0 21 00 83 d8 4c cc 00 08 00 00 00 f0 70 00 00 f8 |!...L.......p...|
000001d0 6b cc 05 5c 75 e7 fe ff 70 00 02 78 06 00 00 00 |k..\u...p..x....|
000001e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
000001f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 55 aa |..............U.|
00000200
Comment j’ai répare le MBR de la clé B
root@desktop:/usr/lib/syslinux/mbr# dd if=/usr/lib/syslinux/mbr/mbr.bin of=/dev/sdh bs=448
0+1 enregistrements lus
0+1 enregistrements écrits
440 octets (440 B) copiés, 0,00810781 s, 54,3 kB/s
root@desktop:/usr/lib/syslinux/mbr#
comment j’ai réparé le boot flag de la clé B
root@desktop:/usr/lib/syslinux/mbr# parted -a optimal /dev/sdh
GNU Parted 3.2
Using /dev/sdh
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) set 1 boot on
(parted) quit
Information: You may need to update /etc/fstab.
Fdisk après
[code]Disque /dev/sdh : 3,8 GiB, 4009754624 octets, 7831552 secteurs
Unités : secteur de 1 × 512 = 512 octets
Taille de secteur (logique / physique) : 512 octets / 512 octets
taille d’E/S (minimale / optimale) : 512 octets / 512 octets
Type d’étiquette de disque : dos
Identifiant de disque : 0xfac6a413
Device Boot Start End Sectors Size Id Type
/dev/sdh1 * 2048 7403519 7401472 3,5G 83 Linux
/dev/sdh2 7405566 7829503 423938 207M 5 Extended
/dev/sdh5 7405568 7829503 423936 207M 82 Linux swap / Solaris[/code]
Regeneration du grub du PC pour avoir une ligne atteignant la clé B
root@desktop:/# update-grub
Création du fichier de configuration GRUB…
Found background image: /usr/share/images/desktop-base/desktop-grub.png
Image Linux trouvée : /boot/vmlinuz-4.3.0-0.bpo.1-686-pae
Image mémoire initiale trouvée : /boot/initrd.img-4.3.0-0.bpo.1-686-pae
Image Linux trouvée : /boot/vmlinuz-3.16.0-4-686-pae
Image mémoire initiale trouvée : /boot/initrd.img-3.16.0-4-686-pae
Found memtest86+ image: /boot/memtest86+.bin
Found memtest86+ multiboot image: /boot/memtest86+_multiboot.bin
Debian GNU/Linux (8.3) trouvé sur /dev/sdd1
fait
Reboot, selection de Debian GNU/Linux (8.3) trouvé sur /dev/sdd1
je suis bien sur la clé B
Réparation du grub de la cle en virant os-prober d’abord
[code]root@cleusb:~# cd /etc/grub.d/
root@cleusb:/etc/grub.d# ls -alrt
total 92
-rwxr-xr-x 1 root root 1570 sept. 10 2014 20_memtest86+
-rwxr-xr-x 1 root root 6058 déc. 14 14:13 05_debian_theme
-rw-r–r-- 1 root root 483 déc. 14 18:37 README
-rwxr-xr-x 1 root root 216 déc. 14 18:37 41_custom
-rwxr-xr-x 1 root root 214 déc. 14 18:37 40_custom
-rwxr-xr-x 1 root root 1416 déc. 14 18:37 30_uefi-firmware
-rwxr-xr-x 1 root root 11692 déc. 14 18:37 30_os-prober
-rwxr-xr-x 1 root root 11082 déc. 14 18:37 20_linux_xen
-rwxr-xr-x 1 root root 12261 déc. 14 18:37 10_linux
-rwxr-xr-x 1 root root 9424 déc. 14 18:37 00_header
drwxr-xr-x 2 root root 4096 févr. 26 08:13 .
drwxr-xr-x 128 root root 12288 févr. 26 08:57 …
root@cleusb:/etc/grub.d# rm 30_os-prober
root@cleusb:/etc/grub.d# grub-install /dev/sdc
Installing for i386-pc platform.
Installation terminée, sans erreur.
root@cleusb:/etc/grub.d# update-grub
Création du fichier de configuration GRUB…
Found background image: /usr/share/images/desktop-base/desktop-grub.png
Image Linux trouvée : /boot/vmlinuz-3.16.0-4-amd64
Image mémoire initiale trouvée : /boot/initrd.img-3.16.0-4-amd64
Found memtest86+ image: /boot/memtest86+.bin
Found memtest86+ multiboot image: /boot/memtest86+_multiboot.bin
fait[/code]
Verification de la cle
[code]Disque /dev/sdc : 3,8 GiB, 4009754624 octets, 7831552 secteurs
Unités : secteur de 1 × 512 = 512 octets
Taille de secteur (logique / physique) : 512 octets / 512 octets
taille d’E/S (minimale / optimale) : 512 octets / 512 octets
Type d’étiquette de disque : dos
Identifiant de disque : 0xfac6a413
Device Boot Start End Sectors Size Id Type
/dev/sdc1 * 2048 7403519 7401472 3,5G 83 Linux
/dev/sdc2 7405566 7829503 423938 207M 5 Extended
/dev/sdc5 7405568 7829503 423936 207M 82 Linux swap / Solaris
root@cleusb:/etc/grub.d# dd if=/dev/sdc bs=512 count=1 | hexdump -C
1+0 enregistrements lus
1+0 enregistrements écrits
512 octets (512 B) copiés, 0,000280762 s, 1,8 MB/s
00000000 eb 63 90 8e d8 8e d0 bc 00 7c 89 e6 06 57 8e c0 |.c…|…W…|
00000010 fb fc bf 00 06 b9 00 01 f3 a5 ea 1f 06 00 00 52 |…R|
00000020 52 b4 41 bb aa 55 31 c9 30 f6 f9 cd 13 72 13 81 |R.A…U1.0…r…|
00000030 fb 55 aa 75 0d d1 e9 73 09 66 c7 06 8d 06 b4 42 |.U.u…s.f…B|
00000040 eb 15 5a b4 08 cd 13 83 e1 3f 51 0f b6 c6 40 f7 |…Z…?Q…@.|
00000050 e1 52 50 66 31 c0 66 99 e8 66 00 80 01 00 00 00 |.RPf1.f…f…|
00000060 00 00 00 00 ff fa 90 90 f6 c2 80 74 05 f6 c2 70 |…t…p|
00000070 74 02 b2 80 ea 79 7c 00 00 31 c0 8e d8 8e d0 bc |t…y|…1…|
00000080 00 20 fb a0 64 7c 3c ff 74 02 88 c2 52 bb 17 04 |. …d|<.t…R…|
00000090 f6 07 03 74 06 be 88 7d e8 17 01 be 05 7c b4 41 |…t…}…|.A|
000000a0 bb aa 55 cd 13 5a 52 72 3d 81 fb 55 aa 75 37 83 |…U…ZRr=…U.u7.|
000000b0 e1 01 74 32 31 c0 89 44 04 40 88 44 ff 89 44 02 |…t21…D.@.D…D.|
000000c0 c7 04 10 00 66 8b 1e 5c 7c 66 89 5c 08 66 8b 1e |…f…|f…f…|
000000d0 60 7c 66 89 5c 0c c7 44 06 00 70 b4 42 cd 13 72 ||f.\..D..p.B..r| 000000e0 05 bb 00 70 eb 76 b4 08 cd 13 73 0d 5a 84 d2 0f |...p.v....s.Z...| 000000f0 83 d0 00 be 93 7d e9 82 00 66 0f b6 c6 88 64 ff |.....}...f....d.| 00000100 40 66 89 44 04 0f b6 d1 c1 e2 02 88 e8 88 f4 40 |@f.D...........@| 00000110 89 44 08 0f b6 c2 c0 e8 02 66 89 04 66 a1 60 7c |.D.......f..f.
||
00000120 66 09 c0 75 4e 66 a1 5c 7c 66 31 d2 66 f7 34 88 |f…uNf.|f1.f.4.|
00000130 d1 31 d2 66 f7 74 04 3b 44 08 7d 37 fe c1 88 c5 |.1.f.t.;D.}7…|
00000140 30 c0 c1 e8 02 08 c1 88 d0 5a 88 c6 bb 00 70 8e |0…Z…p.|
00000150 c3 31 db b8 01 02 cd 13 72 1e 8c c3 60 1e b9 00 |.1…r…`…|
00000160 01 8e db 31 f6 bf 00 80 8e c6 fc f3 a5 1f 61 ff |…1…a.|
00000170 26 5a 7c be 8e 7d eb 03 be 9d 7d e8 34 00 be a2 |&Z|…}…}.4…|
00000180 7d e8 2e 00 cd 18 eb fe 47 52 55 42 20 00 47 65 |}…GRUB .Ge|
00000190 6f 6d 00 48 61 72 64 20 44 69 73 6b 00 52 65 61 |om.Hard Disk.Rea|
000001a0 64 00 20 45 72 72 6f 72 0d 0a 00 bb 01 00 b4 0e |d. Error…|
000001b0 cd 10 ac 3c 00 75 f4 c3 13 a4 c6 fa 00 00 80 20 |…<.u… |
000001c0 21 00 83 d8 4c cc 00 08 00 00 00 f0 70 00 00 f8 |!..L…p…|
000001d0 6b cc 05 5c 75 e7 fe ff 70 00 02 78 06 00 00 00 |k…\u…p…x…|
000001e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |…|
000001f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 55 aa |…U.|
00000200[/code]
Reboot directement sur la clé B, succès
les infos de boot sont à jour sur la clé
root@cleusb:~# cd /boot
root@cleusb:/boot# ls
config-3.16.0-4-amd64 memtest86+.bin vmlinuz-3.16.0-4-amd64
grub memtest86+_multiboot.bin
initrd.img-3.16.0-4-amd64 System.map-3.16.0-4-amd64
root@cleusb:/boot# cd grub
root@cleusb:/boot/grub# ls -alrt
total 2392
-rw-r--r-- 1 root root 2400500 févr. 26 08:13 unicode.pf2
drwxr-xr-x 3 root root 4096 févr. 26 08:16 ..
drwxr-xr-x 2 root root 4096 févr. 26 09:01 locale
drwxr-xr-x 2 root root 4096 févr. 26 09:01 fonts
-rw-r--r-- 1 root root 1024 févr. 26 09:01 grubenv
drwxr-xr-x 2 root root 12288 févr. 26 09:01 i386-pc
-r--r--r-- 1 root root 8287 févr. 26 09:02 grub.cfg
drwxr-xr-x 5 root root 4096 févr. 26 09:02 .
Enfin je peux dire, Enjoy
j’ai une Debian qui fonctionne sur ma clé et je vais pouvoir faire mon nid de coucou sur le pc des autres