Porteus on a Win 8 Recovery flash drive
- Ed_P
- Contributor
- Posts: 8909
- Joined: 06 Feb 2013, 22:12
- Distribution: Cinnamon 5.01 ISO
- Location: Western NY, USA
Porteus on a Win 8 Recovery flash drive
@brokenman
I have a USB flash drive that boots on both UEFI machines and non-UEFI machines. (It's a Windows 8 Recovery flash drive.) I would like to tinker with it to boot Porteus on those machines. How can I create a modified version of your EFI script that would work with the flash drive without formatting or partitioning the drive? Initially I would like the flash drive to boot to Porteus on UEFI machines, ideally I would like it to support booting Win 8 Recovery or Porteus on the flash drive. Can you help?
I have a USB flash drive that boots on both UEFI machines and non-UEFI machines. (It's a Windows 8 Recovery flash drive.) I would like to tinker with it to boot Porteus on those machines. How can I create a modified version of your EFI script that would work with the flash drive without formatting or partitioning the drive? Initially I would like the flash drive to boot to Porteus on UEFI machines, ideally I would like it to support booting Win 8 Recovery or Porteus on the flash drive. Can you help?
- brokenman
- Site Admin
- Posts: 6105
- Joined: 27 Dec 2010, 03:50
- Distribution: Porteus v4 all desktops
- Location: Brazil
Re: Porteus on a Win 8 Recovery flash drive
Can you give me the file structure tree for the usb device?Initially I would like the flash drive to boot to Porteus on UEFI machines
find /mnt/sdxY -maxdepth 3 ## Do this for each partition on the device
blkid
df -Th /dev/sdxY
Substitute sdxY for the path of your win rescue USB.
This is probably doable by using the refind boot loader and adding an entry for the win8 rescue part.ideally I would like it to support booting Win 8 Recovery or Porteus on the flash drive. Can you help?
How do i become super user?
Wear your underpants on the outside and put on a cape.
Wear your underpants on the outside and put on a cape.
- Ed_P
- Contributor
- Posts: 8909
- Joined: 06 Feb 2013, 22:12
- Distribution: Cinnamon 5.01 ISO
- Location: Western NY, USA
Re: Porteus on a Win 8 Recovery flash drive
Can you work with this or do you need the Linux format?
Code: Select all
C:\Users\Ed>dir f: /s
Volume in drive F is RECOVERY
Volume Serial Number is EAE3-809F
Directory of F:\
10/17/2013 09:25 PM <DIR> efi
10/17/2013 09:25 PM <DIR> boot
10/17/2013 09:25 PM <DIR> sources
07/25/2012 11:44 PM 398,156 bootmgr
09/20/2012 04:31 AM 1,350,888 bootmgr.efi
2 File(s) 1,749,044 bytes
Directory of F:\efi
10/17/2013 09:25 PM <DIR> .
10/17/2013 09:25 PM <DIR> ..
10/17/2013 09:25 PM <DIR> boot
10/17/2013 09:25 PM <DIR> microsoft
0 File(s) 0 bytes
Directory of F:\efi\boot
10/17/2013 09:25 PM <DIR> .
10/17/2013 09:25 PM <DIR> ..
09/20/2012 04:31 AM 1,354,472 bootx64.efi
1 File(s) 1,354,472 bytes
Directory of F:\efi\microsoft
10/17/2013 09:25 PM <DIR> .
10/17/2013 09:25 PM <DIR> ..
10/17/2013 09:25 PM <DIR> boot
0 File(s) 0 bytes
Directory of F:\efi\microsoft\boot
10/17/2013 09:25 PM <DIR> .
10/17/2013 09:25 PM <DIR> ..
10/17/2013 09:25 PM <DIR> fonts
10/17/2013 09:25 PM <DIR> resources
06/02/2012 10:32 AM 262,144 BCD
1 File(s) 262,144 bytes
Directory of F:\efi\microsoft\boot\fonts
10/17/2013 09:25 PM <DIR> .
10/17/2013 09:25 PM <DIR> ..
06/02/2012 10:31 AM 3,694,080 chs_boot.ttf
06/02/2012 10:31 AM 3,876,772 cht_boot.ttf
06/02/2012 10:31 AM 1,984,228 jpn_boot.ttf
06/02/2012 10:31 AM 2,371,360 kor_boot.ttf
06/02/2012 10:31 AM 165,764 malgunn_boot.ttf
06/02/2012 10:31 AM 168,212 malgun_boot.ttf
06/02/2012 10:31 AM 132,888 meiryon_boot.ttf
06/02/2012 10:31 AM 134,508 meiryo_boot.ttf
06/02/2012 10:31 AM 152,892 msjhn_boot.ttf
06/02/2012 10:31 AM 154,896 msjh_boot.ttf
06/02/2012 10:31 AM 142,124 msyhn_boot.ttf
06/02/2012 10:31 AM 146,228 msyh_boot.ttf
06/02/2012 10:31 AM 36,020 segmono_boot.ttf
06/02/2012 10:31 AM 77,088 segoen_slboot.ttf
06/02/2012 10:31 AM 77,404 segoe_slboot.ttf
06/02/2012 10:31 AM 47,452 wgl4_boot.ttf
16 File(s) 13,361,916 bytes
Directory of F:\efi\microsoft\boot\resources
10/17/2013 09:25 PM <DIR> .
10/17/2013 09:25 PM <DIR> ..
07/26/2012 12:57 AM 18,160 bootres.dll
1 File(s) 18,160 bytes
Directory of F:\boot
10/17/2013 09:25 PM <DIR> .
10/17/2013 09:25 PM <DIR> ..
10/17/2013 09:25 PM <DIR> resources
10/17/2013 09:25 PM <DIR> fonts
06/02/2012 10:32 AM 262,144 BCD
06/02/2012 10:40 AM 3,170,304 boot.sdi
2 File(s) 3,432,448 bytes
Directory of F:\boot\resources
10/17/2013 09:25 PM <DIR> .
10/17/2013 09:25 PM <DIR> ..
07/26/2012 12:57 AM 18,160 bootres.dll
1 File(s) 18,160 bytes
Directory of F:\boot\fonts
10/17/2013 09:25 PM <DIR> .
10/17/2013 09:25 PM <DIR> ..
06/02/2012 10:31 AM 3,694,080 chs_boot.ttf
06/02/2012 10:31 AM 3,876,772 cht_boot.ttf
06/02/2012 10:31 AM 1,984,228 jpn_boot.ttf
06/02/2012 10:31 AM 2,371,360 kor_boot.ttf
06/02/2012 10:31 AM 165,764 malgunn_boot.ttf
06/02/2012 10:31 AM 168,212 malgun_boot.ttf
06/02/2012 10:31 AM 132,888 meiryon_boot.ttf
06/02/2012 10:31 AM 134,508 meiryo_boot.ttf
06/02/2012 10:31 AM 152,892 msjhn_boot.ttf
06/02/2012 10:31 AM 154,896 msjh_boot.ttf
06/02/2012 10:31 AM 142,124 msyhn_boot.ttf
06/02/2012 10:31 AM 146,228 msyh_boot.ttf
06/02/2012 10:31 AM 36,020 segmono_boot.ttf
06/02/2012 10:31 AM 77,088 segoen_slboot.ttf
06/02/2012 10:31 AM 77,404 segoe_slboot.ttf
06/02/2012 10:31 AM 47,452 wgl4_boot.ttf
16 File(s) 13,361,916 bytes
Directory of F:\sources
10/17/2013 09:25 PM <DIR> .
10/17/2013 09:25 PM <DIR> ..
0 File(s) 0 bytes
Total Files Listed:
40 File(s) 33,558,260 bytes
30 Dir(s) 3,761,119,232 bytes free
- brokenman
- Site Admin
- Posts: 6105
- Joined: 27 Dec 2010, 03:50
- Distribution: Porteus v4 all desktops
- Location: Brazil
Re: Porteus on a Win 8 Recovery flash drive
I was hoping to get an idea of the partition type as when creating the partition in linux you need to set it as ef00. Like when you set a partition type to ext4.
From your output I can see that the default file that is loaded is probably bootmgr.efi which then calls bootx64.efi. This means it may be possible to install the boot loader 'refind' as bootx64.efi and replace the existing one. This could then give you the choice of Porteus or win8 rescue.
I'll probably create the win8 rescue USB and test with it here to save you fussing with it. If you want to play just make a byte for byte backup of the USB.
dd if=/dev/sdxY of=/tmp/mybackup.img
From your output I can see that the default file that is loaded is probably bootmgr.efi which then calls bootx64.efi. This means it may be possible to install the boot loader 'refind' as bootx64.efi and replace the existing one. This could then give you the choice of Porteus or win8 rescue.
I'll probably create the win8 rescue USB and test with it here to save you fussing with it. If you want to play just make a byte for byte backup of the USB.
dd if=/dev/sdxY of=/tmp/mybackup.img
How do i become super user?
Wear your underpants on the outside and put on a cape.
Wear your underpants on the outside and put on a cape.
- Ed_P
- Contributor
- Posts: 8909
- Joined: 06 Feb 2013, 22:12
- Distribution: Cinnamon 5.01 ISO
- Location: Western NY, USA
Re: Porteus on a Win 8 Recovery flash drive
Per your request:brokenman wrote:Can you give me the file structure tree for the usb device?
find /mnt/sdxY -maxdepth 3 ## Do this for each partition on the device
blkid
df -Th /dev/sdxY
Substitute sdxY for the path of your win rescue USB.
Code: Select all
guest@porteus:~$ find /mnt/sdb1 -maxdepth 3
/mnt/sdb1
guest@porteus:~$ blkid
bash: blkid: command not found
guest@porteus:~$ %$@#
bash: fg: %#: no such job
guest@porteus:~$ su
Password:
root@porteus:~# find /mnt/sdb1 -maxdepth 3
/mnt/sdb1
root@porteus:~# blkid
/dev/sda1: LABEL="PQSERVICE" UUID="9894832D94830CC6" TYPE="ntfs"
/dev/sda2: LABEL="SYSTEM RESERVED" UUID="ECF483DEF483AA02" TYPE="ntfs"
/dev/sda3: LABEL="Acer" UUID="48168114168103E2" TYPE="ntfs"
/dev/sda5: LABEL="Data" UUID="01CD20066B8BF780" TYPE="ntfs"
/dev/sda6: LABEL="BKUPS" UUID="14E65B5EE65B3F64" TYPE="ntfs"
/dev/loop0: LABEL="Porteus" TYPE="iso9660"
/dev/loop1: TYPE="squashfs"
/dev/loop2: TYPE="squashfs"
/dev/loop3: TYPE="squashfs"
/dev/loop4: TYPE="squashfs"
/dev/loop5: TYPE="squashfs"
/dev/sdb1: LABEL="RECOVERY" UUID="EAE3-809F" TYPE="vfat"
root@porteus:~# df -Th /dev/sdb1
Filesystem Type Size Used Avail Use% Mounted on
devtmpfs devtmpfs 868M 0 868M 0% /dev
root@porteus:~#
I do like the sound of this answer.brokenman wrote:This is probably doable by using the refind boot loader and adding an entry for the win8 rescue part.EdP wrote:ideally I would like it to support booting Win 8 Recovery or Porteus on the flash drive. Can you help?

- Ed_P
- Contributor
- Posts: 8909
- Joined: 06 Feb 2013, 22:12
- Distribution: Cinnamon 5.01 ISO
- Location: Western NY, USA
Re: Porteus on a Win 8 Recovery flash drive
Thank you.brokenman wrote:If you want to play just make a byte for byte backup of the USB.
dd if=/dev/sdxY of=/tmp/mybackup.img

I've been debating about buying yet another flash drive to test with.
If I may, what would the restore command look like?
I assume the backup will be saved to my changes= file so I need to expand it. Does dd compress the backup?
- brokenman
- Site Admin
- Posts: 6105
- Joined: 27 Dec 2010, 03:50
- Distribution: Porteus v4 all desktops
- Location: Brazil
Re: Porteus on a Win 8 Recovery flash drive
I especially like the command %$@#. I think I understand that one.guest@porteus:~$ blkid
bash: blkid: command not found
guest@porteus:~$ %$@#
bash: fg: %#: no such job
Please make sure the USB device is mounted before passing these commands (as root):
parted
print all
quit
This will give me the partition type information of the EFS partition.
dd if=/dev/sdxY of=/tmp/mybackup.img ## Make a backup of partition sdxY
dd if=/tmp/mybackup.img of=/dev/sdxY ## Restore backup to partition sdxY
How do i become super user?
Wear your underpants on the outside and put on a cape.
Wear your underpants on the outside and put on a cape.
- Ed_P
- Contributor
- Posts: 8909
- Joined: 06 Feb 2013, 22:12
- Distribution: Cinnamon 5.01 ISO
- Location: Western NY, USA
Re: Porteus on a Win 8 Recovery flash drive
What about the MBR and GUID?brokenman wrote: dd if=/dev/sdxY of=/tmp/mybackup.img ## Make a backup of partition sdxY
dd if=/tmp/mybackup.img of=/dev/sdxY ## Restore backup to partition sdxY
- brokenman
- Site Admin
- Posts: 6105
- Joined: 27 Dec 2010, 03:50
- Distribution: Porteus v4 all desktops
- Location: Brazil
Re: Porteus on a Win 8 Recovery flash drive
A quick google search
shows this:
https://wiki.archlinux.org/index.php/Master_Boot_Record
http://www.rodsbooks.com/gdisk/
http://www.rodsbooks.com/gdisk/repairing.html

https://wiki.archlinux.org/index.php/Master_Boot_Record
http://www.rodsbooks.com/gdisk/
http://www.rodsbooks.com/gdisk/repairing.html
How do i become super user?
Wear your underpants on the outside and put on a cape.
Wear your underpants on the outside and put on a cape.
- Ed_P
- Contributor
- Posts: 8909
- Joined: 06 Feb 2013, 22:12
- Distribution: Cinnamon 5.01 ISO
- Location: Western NY, USA
Re: Porteus on a Win 8 Recovery flash drive
FYI I can now boot the Recovery flash drive on my "Legacy" system and bring up Porteus.
It took modifying the \boot\bcd file to include a menu option for Grub4DOS, which is what I use for all my multi-boot systems. Grub4DOS unfortuately doesn't support UEFI, yet.
It took modifying the \boot\bcd file to include a menu option for Grub4DOS, which is what I use for all my multi-boot systems. Grub4DOS unfortuately doesn't support UEFI, yet.
- Ed_P
- Contributor
- Posts: 8909
- Joined: 06 Feb 2013, 22:12
- Distribution: Cinnamon 5.01 ISO
- Location: Western NY, USA
Re: Porteus on a Win 8 Recovery flash drive
I've used your script to create a EFI bootable Porteus flash drive, do you not have a script to create a normal/legacy bootable flash drive also?machine to Legacy mode.
Where I'm going with this is can the two scripts be combined to create a a flash drive that boots on both legacy and EFI machines? Without changing the EFI machine to Legacy mode. The flash drive your EFI creates isn't even readable in a legacy Windows 7 machine. Most likely due to a missing legacy partition table. The Win 8 Recovery flash drive proves you can have both.
Where I'm going with this is can the two scripts be combined to create a a flash drive that boots on both legacy and EFI machines? Without changing the EFI machine to Legacy mode. The flash drive your EFI creates isn't even readable in a legacy Windows 7 machine. Most likely due to a missing legacy partition table. The Win 8 Recovery flash drive proves you can have both.