web-dev-qa-db-ja.com

UEFIのUSBライブペン永続ブートディスク

LTS Ubuntuバージョン16.04を使用して、必要な情報を割り当ててUEFI永続ブートを可能にし、3.0 USB 128GBフラッシュディスクの全容量を満たすためにセカンダリcasper-rwパーティションを拡張しようとしました。

それに応じて手順が行われましたが、現在はレガシーのみのUEFIに投稿されませんが、再起動後も永続性は保持されません。

これを成功させた人のためのガイドラインは大歓迎です。

3
Alex Lozano

UEFIおよびBIOSモードで永続的なライブシステムを起動する

mkusbは、UbuntuおよびDebian(Ubuntuコミュニティフレーバーと、すべてではないがいくつかの(すべてではない)ディストリビューションを含む)で永続的なライブシステムを作成できますUbuntuおよびDebian。

これらの永続的なライブシステムを、64ビットと32ビットの両方のisoファイルからBIOSモードとUEFIモードの両方で起動することができます。

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

リンク集

help.ubuntu.com/community/mkusb

help.ubuntu.com/community/mkusb/persistent

デモ例

USB 3 128 GBペンドライブで buntu 16.04.1 LTS 永続ライブドライブを作成しました。このペンドライブは頻繁に使用されており、遅くなっていますが、まだ機能しています。 (すぐに再び高速化するために、すぐに「デバイス全体をワイプ」すると思います。)

これが「コンソール出力」です。

$ 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

ハードドライブのようにUSBにインストールするだけです

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

はるかにシンプルで信頼性の高い

1