如何使用终端创建具有BIOS持久性的实时Ubuntu USB驱动器?

我希望能够从现场Ubuntu USB记忆棒启动,然后在该USB记忆棒上永久使用rsync脚本,将我的主Debian系统的增量快照(备份)转换为第二个硬盘。

有人会认为制作一个持久的Ubuntu UBA棒是如此容易,但大多数现场USB制造商不允许持久性,而那些做到的,却没有用。 这包括UNetBootin,即使我在本地编译和调试缺少的依赖项之后。 所以我想要一个简单的,仅限终端的解决方案,我可以在必要时理解和调试。

来自iso的简单dd,然后添加casper-rw文件方法存在分区工具被非标准efi分区图像混淆的问题。 ( 参考 )

一些解决方案,如UNetBootin接近工作,但当我尝试使用sudo -s获取root shell时,它们会崩溃并转储,并破坏我的实时USB映像。

大多数解决方案(下面)来自这篇很棒的文章,它接近于工作,但并不完全,因为它需要一些更新的地方。 但我建议你看看它,因为它在解释步骤时更完整。

这是我的基于BIOS的笔记本电脑。 我猜这可能不适用于EUFI启动机器。

提示:

  • 不要像上面的那篇文章那样制作grub配置文件,而是如下所示。

  • 一旦你最终在下面工作,你会发现随着时间的推移,文件系统会意外地变满。 我终于发现这是因为Ubuntu默默地进行apt-get update ,这将填满你所有的文件空间,然后你会得到一条警告信息。 (我花了几年的时间才弄明白发生了什么。)

最初的修复是使用apt-get clean来转储apt缓存,但这并没有真正解决潜在的问题。 然后我尝试简单地禁用Wi-Fi,因此它无法进行自动更新。 这对我很有用! 现在我的棒子持续很长时间没有问题。


经过仔细测试的步骤:

1. 在此处 下载 Ubuntu 16.04 ISO映像。

2.设置一些变量使用如下:

 iso=/path/to/isoimage #eg iso=~/Downloads/ubuntu-16.04-desktop-amd64.iso s=/mnt/isoimage #Source mount point for ISO files (via loop file system) t=/media/USBRoot #Target mount point for USB files in partition #1 

接下来,非常小心正确地指向USB记忆棒,而不是硬盘驱动器,下一步,因为您可能会意外覆盖您的硬盘。 (提示:使用lsblk等查找并确认)

 dev=/dev/sd? #set the "?" to your USB drive letter, eg /dev/sdb 

3.插件和可选擦除 如果分区失败,则建议擦除。 (在我将USB映像写入USB设备之前,我必须将其归零,然后才能使fdisk再次正常工作。)

 sudo dd if=/dev/zero of=$dev #bs=2048 is optional and doesn't seem to matter 

完成后你会收到这样的消息:

 dd: writing to '/dev/sdb': No space left on device 30326785+0 records in 30326784+0 records out 15527313408 bytes (16 GB) copied, 4099.2 s, 3.8 MB/s 

擦除步骤是因为我发现有时快速格式不起作用。 我不确定,但我怀疑正在找到分区映射的第二个副本,或者正在混淆分区软件。 因此,在我们开始之前将全零写入USB记忆棒似乎可以确保您重新开始。 但是,是的,我知道,需要很长时间才能完成。

4.制作分区。 使用分区工具在usb棒上放置一个msdos类型的分区映射,并将其分为两个分区,如下所示:

分区1)通过casper-rw文件的内核,ramdisk,grub和持久性的VFAT32分区。 使用所有剩余空间。

分区2) linux iso映像的可引导分区。 使其大小约为2G(因为这是.iso文件的大小)。

#2分区的大小需要大约2g,因此从驱动器的大小中减去它,然后除以512以获得扇区中#1分区的大小。 在我的情况下,16gb – 2gb = 14gb / 512 =约27343750个扇区。

提示:如果已安装设备,请立即卸载设备,否则在完成fdisk后将出现错误。 不要使用图形卸载按钮,因为它似乎使设备无法找到(直到USB驱动器被拔出然后重新插入),而是使用终端命令,如下所示:

? 问题:我不确定为什么这些分区无法交换,启动分区作为第一个分区。 但是对于它的价值,我试过了,但却无法让它发挥作用。

 sudo umount ${dev}1 sudo umount ${dev}2 

方法如下:您可以使用fdisk,parted,gparted或cfdisk,但我喜欢fdisk。

 sudo fdisk $dev o [create partition map], and then n (p) (1) (2048) 27343750 [new partition #1] tc [change partition type to type c, or W95 FAT32], and n (p) (2) (default) (default) [new partition #2] t 2 83 [type 83 or linux], then a (2) [set [toggle] the bootable flag], and p [check new table], and finally 

它应该看起来像这样:

 Disk /dev/sdb: 14.5 GiB, 15527313408 bytes, 30326784 sectors Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disklabel type: dos Disk identifier: 0xa42995f9 Device Boot Start End Sectors Size Id Type /dev/sdb1 2048 27343750 27341703 13G c W95 FAT32 (LBA) /dev/sdb2 * 27344896 30326783 2981888 1.4G 83 Linux 

然后这样做:

 w [write the partition table to the usb drive] 

您应该得到这样的回复:

 The partition table has been altered. Calling ioctl() to re-read partition table. Syncing disks. 

或者如果你先忘了卸下它,你会得到这个:

 The partition table has been altered. Calling ioctl() to re-read partition table. Re-reading the partition table failed.: Device or resource busy The kernel still uses the old table. The new table will be used at the next reboot or after you run partprobe(8) or kpartx(8). 

在这种情况下,你只需返回,如上所述卸载它,然后再次运行fdisk,只打w ,你就完成了。

5.将iso映像写入第二个分区。 我在这里是否要包括块大小参数(例如bs = 2048),并且最终看起来无关紧要或影响不大。 另请注意,此分区不需要格式化,因为ISO会在直接复制到分区时对其进行有效格式化。

 sudo dd if=$iso of=${dev}2 

6.格式化第一个分区。 注意,他用VFAT32格式化它(即FAT32的长文件名版本)。 我猜这是为了便于在任何机器上读取该分区(即可移植性)。 [我打算看看ext3是否也可以工作,并且稍后将更新该测试]。

 sudo mkfs.vfat -F 32 -c ${dev}1 # for vFAT32 file system 

7.挂载分区#1以便能够将文件安装到其中。

 sudo mkdir -p $t sudo mount ${dev}1 $t 

8.将grub安装到usb棒的第一个扇区并进入分区#1的根目录。

 sudo grub-install --no-floppy --root-directory=$t $dev 

9.复制内核和ram磁盘文件。 (注意,这是从文章中修改的。内核现在是* .efi版本,(但它仍然只是一个内核),而initrd(包含所有软件包的ram磁盘)现在用lz而不是gz压缩)。 首先我们安装图像文件(作为循环设备),我们将从这里获取这两个文件:

 sudo mkdir -p $s sudo mount -o loop $iso $s sudo cp $s/casper/{vmlinuz.efi,initrd.lz} $t/boot/ 

10.创建一个文件来保存持久文件系统。 根据需要resize。 设置为1024x1mb = 1gb。 请注意,在casper-rw文件中,它是一个ext3文件系统。 casper-rw这个名字很神奇,所以不要改变它。

 sudo dd if=/dev/zero of=$t/casper-rw bs=1M count=1024 sudo mkfs.ext3 -F $t/casper-rw #takes a long time 

11.创建一个简单的grub配置文件。 一定要给它一个(可能更新的?)cfg而不是conf文件扩展名,以便grub可以找到它( ref )。 使用您喜欢的编辑器,或使用:

 sudo nano $t/boot/grub/grub.cfg 

12.粘贴以下grub命令。

*注意:如有必要,您可以使用echo并在此处阅读以进行更多调试。 “ro”“splash”和“quiet”也是可选的(但建议的)内核选项,主要是自解释行为。 如有必要,请参阅这篇关于如何使用GRUB>提示的非常有用的post。 我猜他有一个.conf文件,因为这可能是针对GRUB 1.0而不是GRUB 2.0,这也可能解释了他没有工作的命令。 另请注意,根是分区1(即msdos1)。

 echo LOADING USB DRIVE echo echo To continue press any key echo To abort press ^-alt-delete echo read echo Proceeding... set default=0 set timeout=10 set title="Ubuntu (Live)" set root=(hd0,msdos1) linux /boot/vmlinuz.efi boot=casper file=/preseed/ubuntu.seed persistent ro splash quiet echo vmlinuz.efi loaded initrd /boot/initrd.lz echo initrd.lz loaded echo echo Grub done. Booting... boot 

13.同步(推荐)和清理(可选):

 sync sudo umount $s; sudo rmdir $s sudo umount $t; sudo rmdir $t 

14.备份新的USB驱动器。

dd if = $ dev of = / your / backup / location #takes很长一段时间

要稍后恢复它使用反向:

dd if = / your / backup / location of = $ dev #takes很长一段时间

15.重新启动并按一个键以启动Ubuntu USB记忆棒。

16.将备份脚本添加到其中。 这是我的增量脚本,它处理两台笔记本电脑。 首先要仔细检查您的系统并根据需要调整它。 将它命名为mybackup并将myrestore硬链接到它( ln mybackup myrestore )。 使用chmod u+x my{backup,restore}设置执行权限。 用./mybackup运行它

 #!/bin/bash #Usage: # # mybackup - show list of current backups # myrestore - '' # # mybackup   - machine: love2d or sharon-pc # myrestore   - by convention name is 'nn-descriptiveName' (so it sorts by date) ################################################################# ################################################################# ### PARTITIONS ###################### #Partition labels (also used for mount point folder names): # Note: use labels rather than UUID as they might be more controllable. BackupDrive='Linux backup' # USB backup drive (I removed space from 'name' & it removed it from 'label') BackupBase="$BackupDrive/Backups" # Backup base folder directory & name SubDir="files" ### PARTITIONS LABEL HELP: #lsblk -o +label gives (note older method was blkid, but this suggests we use lsblk): #NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT LABEL #sda 8:0 0 465.8G 0 disk #├─sda1 8:1 0 199M 0 part SYSTEM #├─sda2 8:2 0 288.1G 0 part #├─sda3 8:3 0 1K 0 part #├─sda4 8:4 0 29.3G 0 part Shared #├─sda5 8:5 0 23.3G 0 part d8root #├─sda6 8:6 0 119.5G 0 part d8home #└─sda7 8:7 0 5.4G 0 part [SWAP] #sdc 8:32 0 3.7T 0 disk #├─sdc1 8:33 0 128M 0 part #├─sdc2 8:34 0 2.7T 0 part /media/ubuntu/Seagate Backup Plus Drive Seagate Backup Plus Drive #└─sdc3 8:35 0 976.6G 0 part Linux backup ### MOUNTING 1of2 ###################### sudo umount "/mnt/$BackupDrive">& /dev/null # --- cleanup from prior failed attempt: sudo mkdir "/mnt/$BackupDrive">& /dev/null; sudo mount -L "$BackupDrive" "/mnt/$BackupDrive" -o defaults,suid >& /dev/null #Allow to set user owner of files ######################################################################## ### FUNCTIONS ################################################################# #################### function usage { echo; echo "Usage: ${0##*/} [machine name: Love2d|Sharon-pc] [BackupFolderName]";echo;} #################### #################### #If parameter just show dirs for that machine, else show for both function myls { echo -n "'$1' existing backups:" if [ -d "$2" ]; then echo; ls -lFgG "$2" |grep -v ^total |grep ' [0-9][0-9]-' |sed 's/..................//'; else echo ' (none)'; fi; } ################## function currentbackups { if [ "$1" ]; then myls "$1" "/mnt/$BackupBase/$1/$SubDir" else myls 'Love2d' "/mnt/$BackupBase/Love2d/$SubDir" echo myls 'Sharon-pc' "/mnt/$BackupBase/Sharon-pc/$SubDir" echo fi } ################### function badmachine { echo "Machine type '$1' is invalid.";} ################### function cleanup { # echo "--- cleaning up --------------------------------------" sudo umount "/mnt/$BackupDrive" } ######################################################################## ######################################################################## ### CHECK INPUTS ####################################################### #Check if backup name paramter exists: if [ $# = 0 ]; then usage; cleanup; exit; fi if [ $# = 1 ]; then if [ "$1" != "Love2d" -a "$1" != "Sharon-pc" ]; then badmachine "$1"; usage; else usage; currentbackups "$1"; fi; cleanup; exit; fi if [ $# = 2 ]; then if [ "$1" != "Love2d" -a "$1" != "Sharon-pc" ]; then badmachine "$1"; usage; cleanup; exit; fi; fi ### MOUNTING 2of2 ###################### if [ "$1" = 'Love2d' ]; then MyHome='d8home' # Love2 Debian /home partition name MyRoot='d8root' # Love2 Debian / (root) partition name MyShared='Shared' # Love2 Debian Shared partition name sudo umount "/mnt/$MyRoot" >& /dev/null # --- cleanup from prior failed attempt: sudo umount "/mnt/$MyHome" >& /dev/null # sudo umount "/mnt/$MyShared" >& /dev/null # sudo mkdir "/mnt/$MyRoot" >& /dev/null; sudo mount -L "$MyRoot" "/mnt/$MyRoot" >& /dev/null sudo mkdir "/mnt/$MyHome" >& /dev/null; sudo mount -L "$MyHome" "/mnt/$MyHome" >& /dev/null sudo mkdir "/mnt/$MyShared" >& /dev/null; sudo mount -L "$MyShared" "/mnt/$MyShared" >& /dev/null else # MyHome='uhome' # Love2 Ubuntu /home partition name # MyRoot='uroot' # Love2 Ubuntu / (root) partition name MyHome='a41eaa3e-bd31-4ebc-86d4-cf8ed5f3e779' # Love2 Ubuntu /home partition name MyRoot='f3b7424c-0144-42a6-8488-62fbee94d245' # Love2 Ubuntu / (root) partition name sudo umount "/mnt/$MyRoot" >& /dev/null # --- cleanup from prior failed attempt: sudo umount "/mnt/$MyHome" >& /dev/null # #sudo mkdir "/mnt/$MyRoot" >& /dev/null; sudo mount -L "$MyRoot" "/mnt/$MyRoot" >& /dev/null #sudo mkdir "/mnt/$MyHome" >& /dev/null; sudo mount -L "$MyHome" "/mnt/$MyHome" >& /dev/null sudo mkdir "/mnt/$MyRoot" >& /dev/null; sudo mount -U "$MyRoot" "/mnt/$MyRoot" >& /dev/null sudo mkdir "/mnt/$MyHome" >& /dev/null; sudo mount -U "$MyHome" "/mnt/$MyHome" >& /dev/null fi #================================================================= BackupDir="$BackupBase/$1/$SubDir/$2" # /dir/BackupFolderName #rSync stuff: MyRsync="sudo rsync -aAXv --delete" RootExclude=" --exclude={\"/dev/*\",\"/lost+found\",\"/media/*\",\"/mnt/*\",\"/proc/*\",\"/run/*\",\"/sys/*\",\"/tmp/*\"}" HomeExclude=" --exclude='*cache*'" #this does not work if [ "${0##*/}" = "mybackup" ]; then echo backing up... sudo mkdir -p "/mnt/$BackupDir/root" # Making directories to save backup to sudo mkdir -p "/mnt/$BackupDir/home" echo "--- Backing up: / -----------------------------------" $MyRsync $RootExclude "/mnt/$MyRoot/" "/mnt/$BackupDir/root/" echo "--- Backing up: /home -------------------------------" $MyRsync $HomeExclude "/mnt/$MyHome/" "/mnt/$BackupDir/home/" if [ "$MyShared" ]; then #no shared partion on Sharon's machine sudo mkdir -p "/mnt/$BackupDir/shared" echo "--- Backing up: Shared ------------------------------" $MyRsync "/mnt/$MyShared/" "/mnt/$BackupDir/shared/" fi else # Confirm read -p "YOU ARE ABOUT TO OVERWRITE YOUR PARTITIONS - CONFIRM (y/N)?" -n 1 -r; echo if [[ ! $REPLY =~ ^[Yy]$ ]]; then echo "Aborting.";exit; fi echo; read -p "DANGER! Really overwrite your hard disk partitions? (y/N)?" -n 1 -r; echo if [[ ! $REPLY =~ ^[Yy]$ ]]; then echo "Aborting.";exit; fi echo "--- Restoring: / -----------------------------------" $MyRsync "/mnt/$BackupDir/root/" "/mnt/$MyRoot" echo "--- Restoring: /home -------------------------------" $MyRsync "/mnt/$BackupDir/home/" "/mnt/$MyHome" if [ "$MyShared" ]; then #no shared partion on Sharon's machine echo "--- Restoring: Shared ------------------------------" $MyRsync "/mnt/$BackupDir/shared/" "/mnt/$MyShared" fi fi cleanup sudo umount "/mnt/$MyRoot" ;sudo rmdir "/mnt/$MyRoot" sudo umount "/mnt/$MyHome" ;sudo rmdir "/mnt/$MyHome" if [ "$MyShared" ]; then #no shared partion on Sharon's machine sudo umount "/mnt/$MyShared" ;sudo rmdir "/mnt/$MyShared" fi echo "=== DONE. ============================================" exit 0 

我想我们正在做同样的事情。 让我们交换意见,互相帮助:-)

也许唯一的区别是我早些时候开始。 看看我的新工具dus ,我希望很快将其重命名为’mkusb version 12’。

当有图形桌面环境并且zenity可用时, duszenity菜单一起使用,否则在对话框可用时使用对话框菜单 ,否则使用纯文本用户界面,这是你要求的(并且因为没有提前答复)。

dus由一组bash shell脚本组成,欢迎您阅读它们并了解它们的工作原理。 这些脚本可以通过ppa:mkusb / unstable或phillw.net获得。 有关详细信息,请参阅此链接和此链接 。

以下文本转储是制作持久性实时驱动器时的纯文本对话框 (输入到终端的输出和输出)。 我使用了慢速USB 2 pendrive,写入速度仅为6 MB / s。 在USB 2端口中使用良好的USB 3 pendrive可以提高4-5倍,在USB 3端口中仍然更高。

 $ ssh sudodus@my_server sudodus@my_server's password: Welcome to Ubuntu 16.04.1 LTS (GNU/Linux 4.4.0-45-generic i686) * Documentation: https://help.ubuntu.com * Management: https://landscape.canonical.com * Support: https://ubuntu.com/advantage 0 paket kan uppdateras. 0 uppdateringar är säkerhetsuppdateringar. *** /dev/sda8 will be checked for errors at next reboot *** sudodus@xenial32 ~ $ cd /media/multimed-2/test/mkmkusb/dus sudodus@xenial32 /media/multimed-2/test/mkmkusb/dus $ dus lubuntu-16.04.1-desktop-amd64.iso dus 0.0.0 [sudo] password for sudodus: dus wants the program(s) mkusb-common 'to make a persistent live drive and to get a good GUI experience' usb-pack-efi 'only to make a persistent live drive' Please install the corresponding package(s) Press Enter to continue, or wait 8 seconds dus 0.0.0 - Cloning, live linux, windows / Persistent live ────────────────────────────────────────────────────────────────────────────── ┌──────Move between items with the arrow keys────────┐ │ - Do USB Stuff - │ │ Welcome and Notice about Overwriting │ │ The target device will be completely overwritten │ │ ┌────────────────────────────────────────────────┐ │ │ │c Cloning iso file, [compressed] image file or │ │ │ │l 'Live-only' or linux installer from iso file │ │ │ │p 'Persistent live' - only Debian and Ubuntu │ │ │ │w extracting Windows installer │ │ │ │q Quit │ │ │ └────────────────────────────────────────────────┘ │ │ │ │ │ │ │ │ │ ├────────────────────────────────────────────────────┤ │ < OK >  │ └────────────────────────────────────────────────────┘ ## oops - I have dialog installed - so I had better use the option -t ## ## to make a demo with the plain text interface ## clean if necessary and return sudodus@xenial32 /media/multimed-2/test/mkmkusb/dus $ dus -t lubuntu-16.04.1-desktop-amd64.iso dus 0.0.0 dus wants the program(s) mkusb-common 'to make a persistent live drive and to get a good GUI experience' usb-pack-efi 'only to make a persistent live drive' Please install the corresponding package(s) Press Enter to continue, or wait 8 seconds +------------------------ Do USB Stuff -------------------------+ | Welcome and Notice about Overwriting | | The target device will be completely overwritten | +------------------------ quit with (q) ------------------------+ Cloning,live-only,windows / Persistent-live / Quit (c/l/p/w/q) p Drive that contains source file: /dev/sdc Live drive, that is booted from: /dev/sda ------------------------------------------------------------------------------- Available drives (mass storage devices) Dev Target name/model Size Bus Kind of device sdd SanDisk_Cruzer 15G usb USB or memory card Example: add 'sdx': /dev/sdx Select target device /dev/sdd p_target: target=/dev/sdd Select 'MSDOS' partition table - default GPT? (y/N) Select 'usb-pack-efi' - default grub from iso file? (y/N) Select 'download and install' security update - default NO? (y/N) Enter 'percentage' for persistence - default 50 (enter: 1 - 100) 75 settings= percent=75 Prepare persistent live system from 'lubuntu-16.04.1-desktop-amd64.iso' to the target device (drive) '/dev/sdd' MODEL NAME FSTYPE LABEL SIZE Cruzer sdd 15G ├─sdd1 ntfs usbdata 3,5G ├─sdd2 1M ├─sdd3 vfat lub1604164 122M ├─sdd4 iso9660 Lubuntu 16.04.1 LTS amd64 874M └─sdd5 ext4 casper-rw 10,5G Final checkpoint, go ahead? (g/N) g lubuntu-16.04.1-desktop-amd64.iso /dev/sdd 75 settings= ----- live system or temporary superuser permissions lubuntu-16.04.1-desktop-amd64.iso /dev/sdd 75 settings= source=lubuntu-16.04.1-desktop-amd64.iso target=/dev/sdd percent=75 msdos=false upefi=false dni=false source=lubuntu-16.04.1-desktop-amd64.iso ls -l lubuntu-16.04.1-desktop-amd64.iso lrwxrwxrwx 1 olle olle 67 okt 22 21:44 lubuntu-16.04.1-desktop-amd64.iso -> /media/multimed-2/CD/ubuntu/16.04/lubuntu-16.04.1-desktop-amd64.iso --------------------------------------------------------------------------- start [dus-persistent 0.0.0] @ 2016-11-17 19:15:23 --------------------------------------------------------------------------- Making a USB boot drive or memory card .......................... ubuntu grub_n_iso "$source" "$target" "$result" grub_n_iso lubuntu-16.04.1-desktop-amd64.iso /dev/sdd ***** tu=/dev/sdd **************************************************** selected target partition table: 'gpt' mount: /dev/loop0 is write-protected, mounting read-only Lubuntu 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' 'lubuntu-16.04.1-desktop-amd64.iso' is identified as the source ISO file 
 MODEL NAME FSTYPE LABEL MOUNTPOINT SIZE Cruzer sdd 15G |-sdd1 ntfs usbdata 3,5G |-sdd2 1M |-sdd3 vfat lub1604164 122M |-sdd4 iso9660 Lubuntu 16.04.1 LTS amd64 874M `-sdd5 ext4 casper-rw 10,5G 

Using the file '/usr/share/mkusb/grub.cfg' Clean for a GUID partition table GPT fdisk (gdisk) version 1.0.1 Partition table scan: MBR: protective BSD: not present APM: not present GPT: present Found valid GPT with protective MBR; using GPT. 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,00227566 s, 461 MB/s Wait 5 seconds and a little more ... --------------------------------------------------------------------------- Selected percentage of remaining space for persistence = 75 --------------------------------------------------------------------------- preparing /dev/sdd3 ------------------------------------------------ 1024+0 records in 1024+0 records out 1048576 bytes (1,0 MB, 1,0 MiB) copied, 0,290228 s, 3,6 MB/s umount: /dev/sdd3: not mounted mkfs.fat 3.0.28 (2015-05-16) /dev/sdd3 has 64 heads and 32 sectors per track, hidden sectors 0x1000; logical sector size is 512, using 0xf8 media descriptor, with 249856 sectors; drive number 0x80; filesystem has 2 32-bit FATs and 1 sector per cluster. FAT size is 1922 sectors, and provides 245980 clusters. There are 32 reserved sectors. Volume ID is 3cfbdfa9, no volume label. preparing /dev/sdd1 ------------------------------------------------ 1024+0 records in 1024+0 records out 1048576 bytes (1,0 MB, 1,0 MiB) copied, 0,317438 s, 3,3 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, 1,7128 s, 612 kB/s umount: /dev/sdd5: not mounted mke2fs 1.42.13 (17-May-2015) Creating filesystem with 2743296 4k blocks and 686784 inodes Filesystem UUID: 3c0ee31f-b5f2-4b21-8ac8-bb8941c39697 Superblock backups stored on blocks: 32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208 Allocating group tables: done Writing inode tables: done Creating journal (32768 blocks): done Writing superblocks and filesystem accounting information: done mount: /media/multimed-2/CD/ubuntu/16.04/lubuntu-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=lubuntu-16.04.1-desktop-amd64.iso --------------------------------------------------------------------------- item 60 umount: /dev/sdd3: not mounted mount /dev/sdd3 /tmp/dus.KMlnQuCB3J /dev/sdd3 121M 512 121M 1% /tmp/dus.KMlnQuCB3J item 65 umount: /dev/sdd1: not mounted /dev/sdd1 3,5G 19M 3,5G 1% /tmp/dus.FkiHYIJh2I BIOS Bootloader: Installing for i386-pc platform. Installation finished. No error reported. 64-bit bootloader: copy the boot files from the iso file looper=/tmp/dus.zAxhAauNxN targ1=/tmp/dus.KMlnQuCB3J rsync: symlink "/tmp/dus.KMlnQuCB3J/ubuntu" -> "." failed: Operation not permitted (1) rsync: symlink "/tmp/dus.KMlnQuCB3J/dists/stable" -> "xenial" failed: Operation not permitted (1) rsync: symlink "/tmp/dus.KMlnQuCB3J/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.KMlnQuCB3J/boot/grub/grub.cfg' set security upgrade action to 'Display immediately' umount: /dev/sdd4: not mounted Please wait while copying and syncing until 'Done' is written ... < "lubuntu-16.04.1-desktop-amd64.iso" pv | dd of=/dev/sdd4 bs=4096 855MiB 0:02:15 [6,33MiB/s] [================================>] 100% 218880+0 records in 218880+0 records out 896532480 bytes (897 MB, 855 MiB) copied, 148,466 s, 6,0 MB/s Syncing the target device ... Wait 5 seconds and a little more ...

 parted -s "/dev/sdd" print Model: SanDisk Cruzer (scsi) Disk /dev/sdd: 16,0GB 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 130MB 128MB fat32 primary boot, esp 4 130MB 1046MB 916MB primary 5 1046MB 12,3GB 11,2GB ext2 primary 1 12,3GB 16,0GB 3746MB ntfs primary msftdata lsblk -o MODEL,NAME,FSTYPE,LABEL,MOUNTPOINT,SIZE "/dev/sdd" MODEL NAME FSTYPE LABEL MOUNTPOINT SIZE Cruzer sdd 15G |-sdd1 ntfs usbdata 3,5G |-sdd2 1M |-sdd3 vfat lub1604164 122M |-sdd4 iso9660 Lubuntu 16.04.1 LTS amd64 874M `-sdd5 ext4 casper-rw 10,5G 

Done 🙂 The target device is ready to use. 'lubuntu-16.04.1-desktop-amd64.iso' was installed Cleanup after dus-persistent finished 🙂 Cleanup after dus-persistent finished 🙂 --------------------------------------------------------------------------- Total time used [by dus-persistent] = 276 s; 00:04:36 Check the result (scroll if possible), press Enter to finish p_clean: live system or temporary superuser permissions Cloning,live-only,windows / Persistent-live / Quit (c/l/p/w/q) q clean if necessary and return sudodus@xenial32 /media/multimed-2/test/mkmkusb/dus $