web-dev-qa-db-fra.com

Disque d'amorçage persistant USB Live Pen - dans UEFI

Utilisation de la version 16.04 de LTS Ubuntu, j’essaie d’allouer les informations nécessaires à l’initialisation persistante d’UEFI, tout en essayant d’étendre la partition secondaire casper-rw pour atteindre la capacité maximale de mon disque Flash 3.0 USB 128 Go.

Les étapes ont été suivies en conséquence cependant, maintenant, il ne publiera pas dans Legacy uniquement l'UEFI, mais ne conservera pas la persistance après le redémarrage.

Toute directive pour quelqu'un qui a réussi à le faire serait très appréciée.

3
Alex Lozano

Amorce des systèmes live persistants en mode UEFI et BIOS

mkusb peut créer des systèmes vivants persistants avec Ubuntu et Debian (y compris des versions de la communauté Ubuntu et plusieurs (mais pas toutes) distributions basées sur Ubuntu et Debian.

Il est possible de faire en sorte que ces systèmes live persistants démarrent à la fois en mode BIOS et UEFI, à partir de fichiers iso 64 bits et 32 ​​bits.

24-persistent-live-system_quick-start-manual.png

Liens

help.ubuntu.com/community/mkusb

help.ubuntu.com/community/mkusb/persistent

Exemple de démonstration

J'ai créé un disque dur permanent persistant --- (Ubuntu 16.04.1 LTS dans une clé USB 128 GB de 3 Go. Cette clé USB a été beaucoup utilisée et ralentit, mais elle fonctionne toujours. (Je pense que je vais bientôt "effacer tout l'appareil" pour le rendre plus rapide à nouveau.)

Voici la "sortie de la console",

$ dus ubuntu-16.04.1-desktop-AMD64.iso
 dus 12.3.0 
live system or temporary superuser permissions
Drive that contains source file: /dev/sdc
Live drive, that is booted from: /dev/sda
Drive with a partition in fstab: /dev/sdb
cands=1
sdd
SanDisk_ExtremePro
119,2G
usb
USB or memory card
p_target: target=/dev/sdd
settings=
percent=90
Prepare  persistent live  system from
'ubuntu-16.04.1-desktop-AMD64.iso'
to the target device (drive) '/dev/sdd'
MODEL            NAME   FSTYPE  LABEL      SIZE
ExtremePro       sdd    iso9660 TinyCore 119,2G
                 └─sdd1 iso9660 TinyCore    14M
ubuntu-16.04.1-desktop-AMD64.iso
/dev/sdd
90
settings=
-----
live system or temporary superuser permissions
ubuntu-16.04.1-desktop-AMD64.iso
/dev/sdd
90
settings=
source=ubuntu-16.04.1-desktop-AMD64.iso
target=/dev/sdd
percent=90
msdos=false
upefi=false
dni=false
source=ubuntu-16.04.1-desktop-AMD64.iso
ls -l  ubuntu-16.04.1-desktop-AMD64.iso
-rw-r--r-- 1 olle olle 1513308160 aug 30  2016 ubuntu-16.04.1-desktop-AMD64.iso
---------------------------------------------------------------------------
start [dus-persistent 12.3.0] @ 2018-04-17 20:14:09
---------------------------------------------------------------------------
Making a USB boot drive or memory card ..........................
running operating system:  ubuntu 
grub_n_iso "$source" "$target" "$result"
grub_n_iso ubuntu-16.04.1-desktop-AMD64.iso /dev/sdd 
***** tu=/dev/sdd ****************************************************
selected target partition table: 'gpt'
dus-persistent wants the program 'usb-pack-efi': wanted in order to install 'persistent live'.
 dus-persistent 12.3.0 wants usb-pack-efi but it is not installed. 
wanted in order to install 'persistent live'.
mount: /dev/loop0 is write-protected, mounting read-only
 Ubuntu 16.04.1 LTS "Xenial Xerus" - Release AMD64 
mount: /dev/loop0 is write-protected, mounting read-only
select_boot_system: usb-pack_efi is available
select_boot_system: usb-pack_efi: using variable 'upefi=false'
item 00
'ubuntu-16.04.1-desktop-AMD64.iso' is identified as the source ISO file
<pre>
MODEL            NAME   FSTYPE  LABEL    MOUNTPOINT   SIZE
ExtremePro       sdd    iso9660 TinyCore            119,2G
                 `-sdd1 iso9660 TinyCore               14M
</pre>
Using the file '/usr/share/mkusb/grub.cfg'
item 10
Clean for a GUID partition table
GPT fdisk (gdisk) version 1.0.1

Partition table scan:
  MBR: MBR only
  BSD: not present
  APM: not present
  GPT: not present


***************************************************************
Found invalid GPT and valid MBR; converting MBR to GPT format
in memory. THIS OPERATION IS POTENTIALLY DESTRUCTIVE! Exit by
typing 'q' if you don't want to convert your MBR partitions
to GPT format!
***************************************************************

Warning! Main partition table overlaps the first partition by 34 blocks!
You will need to delete this partition or resize it in another utility.

Command (? for help): This option deletes all partitions and creates a new protective MBR.
Proceed? (Y/N): 
Command (? for help): 
Final checks complete. About to write GPT data. THIS WILL OVERWRITE EXISTING
PARTITIONS!!

Do you want to proceed? (Y/N): OK; writing new GUID partition table (GPT) to /dev/sdd.
The operation has completed successfully.
Wipe the first megabyte (mibibyte) to get a clean boot area
1024+0 records in
1024+0 records out
1048576 bytes (1,0 MB, 1,0 MiB) copied, 0,150058 s, 7,0 MB/s
Wait 5 seconds and a little more ...
item 20
---------------------------------------------------------------------------
 Selected percentage of remaining space for persistence = 90 
---------------------------------------------------------------------------

partition 1 - ntfs 'usbdata'
Warning: The resulting partition is not properly aligned for best performance.
partition 2 - bios_grub
partition 3 - fat32 boot,efi
partition 4 - iso9660 - cloned system
partition 5 - ext4 - 'casper-rw'
item 30
preparing /dev/sdd3  ------------------------------------------------
1024+0 records in
1024+0 records out
1048576 bytes (1,0 MB, 1,0 MiB) copied, 0,135527 s, 7,7 MB/s
umount: /dev/sdd3: not mounted
mkfs.fat 3.0.28 (2015-05-16)
/dev/sdd3 has 255 heads and 63 sectors per track,
hidden sectors 0x1000;
logical sector size is 512,
using 0xf8 media descriptor, with 499712 sectors;
drive number 0x80;
filesystem has 2 32-bit FATs and 1 sector per cluster.
FAT size is 3844 sectors, and provides 491992 clusters.
There are 32 reserved sectors.
Volume ID is 98e64270, no volume label.

item 40
preparing /dev/sdd1  ------------------------------------------------
1024+0 records in
1024+0 records out
1048576 bytes (1,0 MB, 1,0 MiB) copied, 0,0425365 s, 24,7 MB/s
umount: /dev/sdd1: not mounted
Cluster size has been automatically set to 4096 bytes.
Creating NTFS volume structures.
Creating root directory (mft record 5)
Creating $MFT (mft record 0)
Creating $MFTMirr (mft record 1)
Creating $LogFile (mft record 2)
Creating $AttrDef (mft record 4)
Creating $Bitmap (mft record 6)
Creating $Boot (mft record 7)
Creating backup boot sector.
Creating $Volume (mft record 3)
Creating $BadClus (mft record 8)
Creating $Secure (mft record 9)
Creating $UpCase (mft record 0xa)
Creating $Extend (mft record 11)
Creating system file (mft record 0xc)
Creating system file (mft record 0xd)
Creating system file (mft record 0xe)
Creating system file (mft record 0xf)
Creating $Quota (mft record 24)
Creating $ObjId (mft record 25)
Creating $Reparse (mft record 26)
Syncing root directory index record.
Syncing $Bitmap.
Syncing $MFT.
Updating $MFTMirr.
Syncing device.
mkntfs completed successfully. Have a Nice day.
preparing /dev/sdd5  ------------------------------------------------
1024+0 records in
1024+0 records out
1048576 bytes (1,0 MB, 1,0 MiB) copied, 0,306058 s, 3,4 MB/s
umount: /dev/sdd5: not mounted
mke2fs 1.42.13 (17-May-2015)
Creating filesystem with 27739265 4k blocks and 6938624 inodes
Filesystem UUID: 8ab3dcb4-ef4e-4fce-a7a0-c30ff55e3556
Superblock backups stored on blocks: 
    32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208, 
    4096000, 7962624, 11239424, 20480000, 23887872

Allocating group tables: done                            
Writing inode tables: done                            
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: done   

item 50
mount: /media/multimed-2/CD/ubuntu/16.04/ubuntu-16.04.1-desktop-AMD64.iso is already mounted
fatlabel: warning - lowercase labels might not work properly with DOS or Windows
tune2fs 1.42.13 (17-May-2015)
---------------------------------------------------------------------------
source=ubuntu-16.04.1-desktop-AMD64.iso
---------------------------------------------------------------------------
item 60
umount: /dev/sdd3: not mounted
mount /dev/sdd3 /tmp/dus.9PLDBnyz6K
/dev/sdd3       241M   512  241M   1% /tmp/dus.9PLDBnyz6K
item 65
umount: /dev/sdd1: not mounted
/dev/sdd1        12G   62M   12G   1% /tmp/dus.S1WqEpXLsT
item 70
 UEFI Bootloader:  Installing for i386-pc platform.
Installation finished. No error reported.
item 80
 64-bit bootloader: copy the boot files from the iso file 
looper=/tmp/dus.9TDw3CrMfL
targ1=/tmp/dus.9PLDBnyz6K
rsync: symlink "/tmp/dus.9PLDBnyz6K/ubuntu" -> "." failed: Operation not permitted (1)
rsync: symlink "/tmp/dus.9PLDBnyz6K/dists/stable" -> "xenial" failed: Operation not permitted (1)
rsync: symlink "/tmp/dus.9PLDBnyz6K/dists/unstable" -> "xenial" failed: Operation not permitted (1)
rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1183) [sender=3.1.1]
rsync:  don't worry,  symlink errors are *expected*
because of the target file system.
Using the file '/tmp/dus.9PLDBnyz6K/boot/grub/grub.cfg'
 set security upgrade action to 'Display immediately' 
umount: /dev/sdd4: not mounted
---------------------------------------------------------------------------
do_n_show:
&lt; "ubuntu-16.04.1-desktop-AMD64.iso" pv -ni2 | dd of=/dev/sdd4 bs=4096

( < "ubuntu-16.04.1-desktop-AMD64.iso" pv -ni2 | dd of=/dev/sdd4 bs=4096 && echo 'Done' > /dev/stderr ) 2>&1 || ( echo '# failed';sleep 1 )
Please wait for sync (flushing file system buffers to the device)
until 'Done' is written ...
'pv %'; 'dd final output'
7
12
13
13
13
13
14
15
15
16
17
18
19
20
24
26
26
27
27
27
29
31
34
35
36
37
41
45
49
53
58
62
66
69
71
73
77
81
85
89
94
98
100
369460+0 poster in
369460+0 poster ut
1513308160 byte (1,5 GB, 1,4 GiB) kopierade, 88,7954 s, 17,0 MB/s
Done
do_n_show: Work done
---------------------------------------------------------------------------
Syncing the target device ...
item 90
Wait 5 seconds and a little more ...
<pre>
parted -s "/dev/sdd" print
Model: SanDisk ExtremePro (scsi)
Disk /dev/sdd: 128GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags: 

Number  Start   End     Size    File system  Name     Flags
 2      1049kB  2097kB  1049kB               primary  bios_grub
 3      2097kB  258MB   256MB   fat32        primary  boot, esp
 4      258MB   1791MB  1533MB               primary
 5      1791MB  115GB   114GB   ext2         primary
 1      115GB   128GB   12,6GB  ntfs         primary  msftdata

lsblk -o MODEL,NAME,FSTYPE,LABEL,MOUNTPOINT,SIZE "/dev/sdd"
MODEL            NAME   FSTYPE  LABEL                    MOUNTPOINT   SIZE
ExtremePro       sdd                                                119,2G
                 |-sdd1 ntfs    usbdata                              11,8G
                 |-sdd2                                                 1M
                 |-sdd3 vfat    usbboot                               244M
                 |-sdd4 iso9660 Ubuntu 16.04.1 LTS AMD64              1,4G
                 `-sdd5 ext4    casper-rw                           105,8G
</pre>
 Done :-) 
The target device is ready to use.
'ubuntu-16.04.1-desktop-AMD64.iso'
was installed
item 100
Cleanup after dus-persistent finished :-)
Cleanup after dus-persistent finished :-)
---------------------------------------------------------------------------
Total time used [by dus-persistent] = 204 s; 00:03:24
p_clean:
live system or temporary superuser permissions
clean if necessary and return
$ 

ubuntu-persistent-live-in-bios-mode.png:

enter image description here

ubuntu-persistent-live-in-uefi-mode.png:

enter image description here

4
sudodus

Installez-le simplement sur le périphérique USB comme vous le feriez sur un disque dur.

https://www.chris-shaw.com/blog/install-ubuntu-bionic-beaver-on-a-usus

Beaucoup plus simple et fiable

1
Christopher Shaw