Porteus on a Win 8 Recovery flash drive

Post here if you are a new Porteus member and you're looking for some help.
Post Reply
User avatar
Ed_P
Contributor
Contributor
Posts: 3316
Joined: 06 Feb 2013, 22:12
Distribution: Cinnamon 3.2.2 64-bit ISO
Location: Western NY, USA

Porteus on a Win 8 Recovery flash drive

Post#1 by Ed_P » 27 Oct 2013, 13:56

@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?
Ed

User avatar
brokenman
Site Admin
Site Admin
Posts: 5555
Joined: 27 Dec 2010, 03:50
Distribution: Porteus v3.2rcX all desktops
Location: Brazil
Contact:

Re: Porteus on a Win 8 Recovery flash drive

Post#2 by brokenman » 27 Oct 2013, 18:51

Initially I would like the flash drive to boot to Porteus on UEFI machines
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.
ideally I would like it to support booting Win 8 Recovery or Porteus on the flash drive. Can you help?
This is probably doable by using the refind boot loader and adding an entry for the win8 rescue part.
How do i become super user?
Wear your underpants on the outside and put on a cape.

User avatar
Ed_P
Contributor
Contributor
Posts: 3316
Joined: 06 Feb 2013, 22:12
Distribution: Cinnamon 3.2.2 64-bit ISO
Location: Western NY, USA

Re: Porteus on a Win 8 Recovery flash drive

Post#3 by Ed_P » 27 Oct 2013, 21:05

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
Ed

User avatar
brokenman
Site Admin
Site Admin
Posts: 5555
Joined: 27 Dec 2010, 03:50
Distribution: Porteus v3.2rcX all desktops
Location: Brazil
Contact:

Re: Porteus on a Win 8 Recovery flash drive

Post#4 by brokenman » 28 Oct 2013, 00:24

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
How do i become super user?
Wear your underpants on the outside and put on a cape.

User avatar
Ed_P
Contributor
Contributor
Posts: 3316
Joined: 06 Feb 2013, 22:12
Distribution: Cinnamon 3.2.2 64-bit ISO
Location: Western NY, USA

Re: Porteus on a Win 8 Recovery flash drive

Post#5 by Ed_P » 28 Oct 2013, 01:39

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.
Per your request:

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:~# 
At this point the flash drive is a single partition. I can use gParted to partition it once I get it to boot is kinda the plan but if needed I can do it before hand.
brokenman wrote:
EdP wrote:ideally I would like it to support booting Win 8 Recovery or Porteus on the flash drive. Can you help?
This is probably doable by using the refind boot loader and adding an entry for the win8 rescue part.
I do like the sound of this answer. :Yahoo!:
Ed

User avatar
Ed_P
Contributor
Contributor
Posts: 3316
Joined: 06 Feb 2013, 22:12
Distribution: Cinnamon 3.2.2 64-bit ISO
Location: Western NY, USA

Re: Porteus on a Win 8 Recovery flash drive

Post#6 by Ed_P » 28 Oct 2013, 01:47

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
Thank you. :beer:

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?
Ed

User avatar
brokenman
Site Admin
Site Admin
Posts: 5555
Joined: 27 Dec 2010, 03:50
Distribution: Porteus v3.2rcX all desktops
Location: Brazil
Contact:

Re: Porteus on a Win 8 Recovery flash drive

Post#7 by brokenman » 28 Oct 2013, 10:51

guest@porteus:~$ blkid
bash: blkid: command not found
guest@porteus:~$ %$@#
bash: fg: %#: no such job
I especially like the command %$@#. I think I understand that one.

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.

User avatar
Ed_P
Contributor
Contributor
Posts: 3316
Joined: 06 Feb 2013, 22:12
Distribution: Cinnamon 3.2.2 64-bit ISO
Location: Western NY, USA

Re: Porteus on a Win 8 Recovery flash drive

Post#8 by Ed_P » 29 Oct 2013, 03:55

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
What about the MBR and GUID?
Ed

User avatar
brokenman
Site Admin
Site Admin
Posts: 5555
Joined: 27 Dec 2010, 03:50
Distribution: Porteus v3.2rcX all desktops
Location: Brazil
Contact:

Re: Porteus on a Win 8 Recovery flash drive

Post#9 by brokenman » 29 Oct 2013, 12:25

How do i become super user?
Wear your underpants on the outside and put on a cape.

User avatar
Ed_P
Contributor
Contributor
Posts: 3316
Joined: 06 Feb 2013, 22:12
Distribution: Cinnamon 3.2.2 64-bit ISO
Location: Western NY, USA

Re: Porteus on a Win 8 Recovery flash drive

Post#10 by Ed_P » 20 Mar 2014, 18:43

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.
Ed

User avatar
Ed_P
Contributor
Contributor
Posts: 3316
Joined: 06 Feb 2013, 22:12
Distribution: Cinnamon 3.2.2 64-bit ISO
Location: Western NY, USA

Re: Porteus on a Win 8 Recovery flash drive

Post#11 by Ed_P » 22 Mar 2014, 03:19

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.
Ed

Post Reply