Code: Select all
umount /dev/sdb1
umount /dev/sdb2
Code: Select all
umount /dev/sdb1
umount /dev/sdb2
Code: Select all
#!/bin/sh
## http://forum.porteus.org/viewtopic.php?f=81&t=3227#p25266
## http://forum.porteus.org/viewtopic.php?f=81&t=3227&p=25308#p25308
if [ `whoami` != "root" ]; then
ktsuss "$0"
exit
fi
if [ ! -d /mnt/sdb1 ]; then
umount /dev/sdb1
umount /dev/sdb2
fi
curl -L https://www.dropbox.com/s/w1i7b2p4viinnq8/porteus-uefi-usb-installer-v3.0.sh -o porteus-uefi-usb-installer-v3.0.sh
sh porteus-uefi-usb-installer-v3.0.sh
Code: Select all
guest@porteus:~$ ./porteus-uefi.sh
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 596 0 596 0 0 1088 0 --:--:-- --:--:-- --:--:-- 1213
100 102k 100 102k 0 0 72229 0 0:00:01 0:00:01 --:--:-- 72229
Checking boot directory
Passed
Checking porteus directory
Passed
Checking internet.
Passed
################## DISCLAIMER #################
This script comes as is with no warranty or guarantee
implied or even otherwise hinted at in any form. This
deniability of any implied warranty or guarantee includes
any voice you may hear in your head telling you otherwise.
Any loss of data, information, sanity or even temper is
hereby NOT the responsibility of the author of this script
and thereby renders all responsibility for the use of this
on you the user.
Essentially if you screw things up, don't blame me!
################## DISCLAIMER #################
THIS SCRIPT WILL DESTROY ALL DATA ON THE TARGET DEVICE!!
As a safety precaution the script will only have access
to removable devices and no internal fixed drives.
Press ctrl+c at any time to exit the script.
Would you like to conitnue? [Yes/No]
### TARGET DEVICE ###
Select the removable device on which you want to
install Porteus.
NAME LABEL MODEL SIZE
sdb USB Flash Memory 7.3G
Choose your target device and press enter:
1) sdb
#? 1
IMPORTANT INFORMATION
Your removable device will be formatted into 2 partitions
This is required for UEFI systems. The first partition
is the UEFI boot partition and must be FAT32.
WARNING: GPT (GUID Partition Table) detected on '/dev/sdb'! The util sfdisk doesn't support GPT. Use GNU Parted.
### FIRST PARTITION ###
Choose a size for the first partition.
Available free space: 7.3G
6G
Enter the partition size.
Example: 200MB or 2GB
> 6BG
Please include either MB or GB.
Enter the partition size.
Example: 200MB or 2GB
> 6GB
### SECOND PARTITION ###
Choose a size for the second partition.
Press ENTER to use remaining free space.
Available free space: 1297 MB
Enter the partition size.
Example: 200MB or 2GB
>
### PARTITION TYPE ###
Choose a partition type for the second parition which will
hold porteus. I recommend choosing a native linux file
system instead of FAT32. If you choose FAT32 and want to
save changes to Porteus you will need to use a savefile.dat
container
Choose a filesytem for porteus to reside on.
Choose ext2 if you are not sure.
1) FAT32
2) ext2
3) ext3
4) ext4
5) reiserfs
6) xfs
#? 2
### FINAL REPORT ###
Target device: /dev/sdb
Partition 1: FAT32 6144MB
Parition 2: ext2 0MB
Please confirm the above information.
Press Y to begin format, any other key to exit.
Creating partition table on:
/dev/sdb
Creating partition 1
Creating partition 2
Setting partition2 name as: porteus
Formatting partition1
Formatting partition2
Downloading refind ...
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
100 2288k 100 2288k 0 0 83915 0 0:00:27 0:00:27 --:--:-- 161k
Decompressing refind ...
Installing refind to device ...
Installing rEFInd on Linux....
UnmountEsp = 1
Copied rEFInd binary files
Notice: Backed up existing icons directory as icons-backup.
Existing refind.conf file found; copying sample file as refind.conf-sample
to avoid overwriting your customizations.
Installation has completed successfully.
Unmounting install dir
Probing target device ...
Mounting partition1 ...
Copying kernel files to device ...
Copying custom icons ...
sed: -e expression #1, char 0: no previous regular expression
Unmounting partition 1
Mounting partition 2
NTFS signature is missing.
Failed to mount '/dev/sdb2': Invalid argument
The device '/dev/sdb2' doesn't seem to have a valid NTFS.
Maybe the wrong device is used? Or the whole disk instead of a
partition (e.g. /dev/sda, not /dev/sda1)? Or the other way around?
Failed to mount /dev/sdb2
guest@porteus:~$ ls /dev/sdb1/
/bin/ls: cannot access /dev/sdb1/: Not a directory
guest@porteus:~$ ls /mnt/sdb1/
EFI/ Guest/ System\ Volume\ Information/
guest@porteus:~$ ls /mnt/sdb2/
/bin/ls: cannot access /mnt/sdb2/: No such file or directory
guest@porteus:~$
Code: Select all
Errors
Run: Mount /dev/sdb2
Status: Finished with error (exit status 1)
Object /org/freedesktop/UDisks2/block_devices/sdb2 is not a mountable filesystem.
Code: Select all
parted /dev/sdb
mklabel msdos
quit
OK. I will give it a shot.brokenman wrote:For now you can nuke the drive yourself before starting and see if ti makes any difference:Code: Select all
parted /dev/sdb mklabel msdos quit
Yes.AFTERTHOUGHT: Are you booting from ISO?
Code: Select all
guest@porteus:~$ su
Password:
root@porteus:/home/guest# ls /dev/sdb1
/dev/sdb1
root@porteus:/home/guest# ls /dev/sdb2
/dev/sdb2
root@porteus:/home/guest# ls /mnt/sdb1
root@porteus:/home/guest# parted /dev/sdb
GNU Parted 3.1
Using /dev/sdb
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) mklabel msdos
Warning: The existing disk label on /dev/sdb will be destroyed and all data on
this disk will be lost. Do you want to continue?
Yes/No? yes
(parted) quit
Information: You may need to update /etc/fstab.
root@porteus:/home/guest# ls /dev/sdb2
/bin/ls: cannot access /dev/sdb2: No such file or directory
root@porteus:/home/guest# ls /dev/sdb1
/bin/ls: cannot access /dev/sdb1: No such file or directory
root@porteus:/home/guest#
Apparently not.brokenman wrote: For the second partition you may simply hit ENTER without entering a size to use the remainder of the device.
Code: Select all
guest@porteus:~$ ./porteus-uefi.sh
umount: /dev/sdb1: not found
umount: /dev/sdb2: not found
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 596 0 596 0 0 1072 0 --:--:-- --:--:-- --:--:-- 1233
100 102k 100 102k 0 0 67674 0 0:00:01 0:00:01 --:--:-- 442k
Checking boot directory
Passed
Checking porteus directory
Passed
Checking internet.
Passed
################## DISCLAIMER #################
This script comes as is with no warranty or guarantee
implied or even otherwise hinted at in any form. This
deniability of any implied warranty or guarantee includes
any voice you may hear in your head telling you otherwise.
Any loss of data, information, sanity or even temper is
hereby NOT the responsibility of the author of this script
and thereby renders all responsibility for the use of this
on you the user.
Essentially if you screw things up, don't blame me!
################## DISCLAIMER #################
THIS SCRIPT WILL DESTROY ALL DATA ON THE TARGET DEVICE!!
As a safety precaution the script will only have access
to removable devices and no internal fixed drives.
Press ctrl+c at any time to exit the script.
Would you like to conitnue? [Yes/No]
### TARGET DEVICE ###
Select the removable device on which you want to
install Porteus.
NAME LABEL MODEL SIZE
sdb USB Flash Memory 7.3G
Choose your target device and press enter:
1) sdb
#? 1
IMPORTANT INFORMATION
Your removable device will be formatted into 2 partitions
This is required for UEFI systems. The first partition
is the UEFI boot partition and must be FAT32.
### FIRST PARTITION ###
Choose a size for the first partition.
Available free space: 7.3G
Enter the partition size.
Example: 200MB or 2GB
> 6GB
### SECOND PARTITION ###
Choose a size for the second partition.
Press ENTER to use remaining free space.
Available free space: 1297 MB
Enter the partition size.
Example: 200MB or 2GB
>
### PARTITION TYPE ###
Choose a partition type for the second parition which will
hold porteus. I recommend choosing a native linux file
system instead of FAT32. If you choose FAT32 and want to
save changes to Porteus you will need to use a savefile.dat
container
Choose a filesytem for porteus to reside on.
Choose ext2 if you are not sure.
1) FAT32
2) ext2
3) ext3
4) ext4
5) reiserfs
6) xfs
#? 2
### FINAL REPORT ###
Target device: /dev/sdb
Partition 1: FAT32 6144MB
Parition 2: ext2 0MB
Please confirm the above information.
Press Y to begin format, any other key to exit.
Code: Select all
guest@porteus:~$ ./porteus-uefi.sh
umount: /dev/sdb1: not found
umount: /dev/sdb2: not found
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 596 0 596 0 0 634 0 --:--:-- --:--:-- --:--:-- 688
100 102k 100 102k 0 0 56627 0 0:00:01 0:00:01 --:--:-- 336k
Checking boot directory
Passed
Checking porteus directory
Passed
Checking internet.
Passed
################## DISCLAIMER #################
This script comes as is with no warranty or guarantee
implied or even otherwise hinted at in any form. This
deniability of any implied warranty or guarantee includes
any voice you may hear in your head telling you otherwise.
Any loss of data, information, sanity or even temper is
hereby NOT the responsibility of the author of this script
and thereby renders all responsibility for the use of this
on you the user.
Essentially if you screw things up, don't blame me!
################## DISCLAIMER #################
THIS SCRIPT WILL DESTROY ALL DATA ON THE TARGET DEVICE!!
As a safety precaution the script will only have access
to removable devices and no internal fixed drives.
Press ctrl+c at any time to exit the script.
Would you like to conitnue? [Yes/No]
### TARGET DEVICE ###
Select the removable device on which you want to
install Porteus.
NAME LABEL MODEL SIZE
sdb USB Flash Memory 7.3G
Choose your target device and press enter:
1) sdb
#? 1
IMPORTANT INFORMATION
Your removable device will be formatted into 2 partitions
This is required for UEFI systems. The first partition
is the UEFI boot partition and must be FAT32.
### FIRST PARTITION ###
Choose a size for the first partition.
Available free space: 7.3G
Enter the partition size.
Example: 200MB or 2GB
> 6GB
### SECOND PARTITION ###
Choose a size for the second partition.
Press ENTER to use remaining free space.
Available free space: 1297 MB
Enter the partition size.
Example: 200MB or 2GB
> 1297MB
### PARTITION TYPE ###
Choose a partition type for the second parition which will
hold porteus. I recommend choosing a native linux file
system instead of FAT32. If you choose FAT32 and want to
save changes to Porteus you will need to use a savefile.dat
container
Choose a filesytem for porteus to reside on.
Choose ext2 if you are not sure.
1) FAT32
2) ext2
3) ext3
4) ext4
5) reiserfs
6) xfs
#? 2
### FINAL REPORT ###
Target device: /dev/sdb
Partition 1: FAT32 6144MB
Parition 2: ext2 1297MB
Please confirm the above information.
Press Y to begin format, any other key to exit.
Creating partition table on:
/dev/sdb
Creating partition 1
Creating partition 2
Setting partition2 name as: porteus
Formatting partition1
Formatting partition2
Downloading refind ...
Decompressing refind ...
Installing refind to device ...
Installing rEFInd on Linux....
UnmountEsp = 1
Copied rEFInd binary files
Copying sample configuration file as refind.conf; edit this file to configure
rEFInd.
Installation has completed successfully.
Unmounting install dir
Probing target device ...
Mounting partition1 ...
Copying kernel files to device ...
Copying custom icons ...
lsblk: /dev/sdb2: not a block device
Unmounting partition 1
Mounting partition 2
ntfs-3g: Failed to access volume '/dev/sdb2': No such file or directory
ntfs-3g 2013.1.13 integrated FUSE 27 - Third Generation NTFS Driver
Configuration type 1, XATTRS are on, POSIX ACLS are off
Copyright (C) 2005-2007 Yura Pakhuchiy
Copyright (C) 2006-2009 Szabolcs Szakacsits
Copyright (C) 2007-2012 Jean-Pierre Andre
Copyright (C) 2009 Erik Larsson
Usage: ntfs-3g [-o option[,...]] <device|image_file> <mount_point>
Options: ro (read-only mount), windows_names, uid=, gid=,
umask=, fmask=, dmask=, streams_interface=.
Please see the details in the manual (type: man ntfs-3g).
Example: ntfs-3g /dev/sda1 /mnt/windows
News, support and information: http://tuxera.com
Failed to mount /dev/sdb2
guest@porteus:~$ ls /dev/sdb1
/dev/sdb1
guest@porteus:~$ ls /mnt/sdb1
guest@porteus:~$ ls /dev/sdb2
/bin/ls: cannot access /dev/sdb2: No such file or directory
guest@porteus:~$
You're sure of that eh?brokenman wrote:PS: Anything in /dev/sda is irrelevant since the script doesn't touch it.
brokenman wrote:It will attempt to search a windows install and add it to the boot options
Code: Select all
guest@porteus:~$ ls /mnt/sdb1
EFI/
guest@porteus:~$ ls /mnt/sdb2
/bin/ls: cannot access /mnt/sdb2: No such file or directory
guest@porteus:~$
Absolutely positive. I wrote the script.You're sure of that eh?
No. Since the windows partition is automatically mounted during Porteus boot, the script has no reason to use ntfs-3g. The script doesn't touch the fixed drive at all, it just searches it (only in the case that it exists). If it finds a fixed drive with an EFI folder it will search that folder for the EFI/Microsoft/Boot/bootmgfw.efi file and add it to the bootloader config file. In any case the EFI folder is located on a FAT32 partition in all scenarios. ntfs partitions don't even enter the story with this script. That's why I find it curious. I don't have high hopes for the script successfully adding the windows option since the functions of refind are relative to the device it is loaded on. This means I have to find the UUID of the windows EFI partition and hope that refind will accept the boot entry.I assume the ntfs-3g app is being used to see if the harddrive has a Windows system
Yes I am well aware of that.However, Windows systems aren't always installed on sda1 anymore so a search will have to include sda2 and sda3 also at this point.
Excellent point oh Master.brokenman wrote:Since the windows partition is automatically mounted during Porteus boot, the script has no reason to use ntfs-3g.
We disagree on the meaning of the word "touch". Accessing, as in reading or searching, in IMO "touching".The script doesn't touch the fixed drive at all, it just searches it
But if you use the UUID the USB drive will only work on a single machine.This means I have to find the UUID of the windows EFI partition and hope that refind will accept the boot entry.
Oops.brokenman wrote:I need it tested on an 'always fresh' mode
It appears we do. So we are understood in the future ... in linux there a program called 'touch' which physically accesses the file and modifies the timestamp. I consider this a touch. The command 'find' modifies nothing. It just looks. I don't consider this touching anything. I also don't consider reading a piece of paper touching it.We disagree on the meaning of the word "touch". Accessing, as in reading or searching, in IMO "touching".
Good point. Porteus will work on any machine since the UUID of the USB partitions go wherever it goes. Booting windows will only work on the machine on which the script was run. I think I will remove this windows option for the script.But if you use the UUID the USB drive will only work on a single machine.
If you leave a finger print on the paper you touched it.brokenman wrote:I also don't consider reading a piece of paper touching it.
An interesting analogy.I consider touch to be contact as in the expression: 'look but don't touch'
Not necessarily. Booting Windows should work on any machine on which Windows is installed. And if you're really good it will boot any version of Windows it finds. But that's a lot to test for, maybe just Windows 7 and 8 would do.Good point. Porteus will work on any machine since the UUID of the USB partitions go wherever it goes. Booting windows will only work on the machine on which the script was run.
Code: Select all
guest@porteus:~$ lsblk /dev/sdb2
lsblk: /dev/sdb2: not a block device
guest@porteus:~$ lsblk /dev/sdb1
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sdb1 8:17 1 6G 0 part
guest@porteus:~$
Code: Select all
guest@porteus:~$ sh /mnt/sda5/porteus/Guest/porteus-uefi.sh
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 596 0 596 0 0 918 0 --:--:-- --:--:-- --:--:-- 980
100 102k 100 102k 0 0 67027 0 0:00:01 0:00:01 --:--:-- 67027
Checking boot directory
Passed
Checking porteus directory
Passed
Checking internet.
Passed
################## DISCLAIMER #################
This script comes as is with no warranty or guarantee
implied or even otherwise hinted at in any form. This
deniability of any implied warranty or guarantee includes
any voice you may hear in your head telling you otherwise.
Any loss of data, information, sanity or even temper is
hereby NOT the responsibility of the author of this script
and thereby renders all responsibility for the use of this
on you the user.
Essentially if you screw things up, don't blame me!
################## DISCLAIMER #################
THIS SCRIPT WILL DESTROY ALL DATA ON THE TARGET DEVICE!!
As a safety precaution the script will only have access
to removable devices and no internal fixed drives.
Press ctrl+c at any time to exit the script.
Would you like to conitnue? [Yes/No]
### TARGET DEVICE ###
Select the removable device on which you want to
install Porteus.
NAME LABEL MODEL SIZE
sdb USB Flash Memory 7.3G
Choose your target device and press enter:
1) sdb
#? 1
IMPORTANT INFORMATION
Your removable device will be formatted into 2 partitions
This is required for UEFI systems. The first partition
is the UEFI boot partition and must be FAT32.
WARNING: GPT (GUID Partition Table) detected on '/dev/sdb'! The util sfdisk doesn't support GPT. Use GNU Parted.
### FIRST PARTITION ###
Choose a size for the first partition.
Available free space: 7.3G
6G
Enter the partition size.
Example: 200MB or 2GB
> 6GB
### SECOND PARTITION ###
Choose a size for the second partition.
Press ENTER to use remaining free space.
Available free space: 1297 MB
Enter the partition size.
Example: 200MB or 2GB
> 1297MB
### PARTITION TYPE ###
Choose a partition type for the second parition which will
hold porteus. I recommend choosing a native linux file
system instead of FAT32. If you choose FAT32 and want to
save changes to Porteus you will need to use a savefile.dat
container
Choose a filesytem for porteus to reside on.
Choose ext2 if you are not sure.
1) FAT32
2) ext2
3) ext3
4) ext4
5) reiserfs
6) xfs
#? 2
### FINAL REPORT ###
Target device: /dev/sdb
Partition 1: FAT32 6144MB
Parition 2: ext2 1297MB
Please confirm the above information.
Press Y to begin format, any other key to exit.
Creating partition table on:
/dev/sdb
Creating partition 1
Creating partition 2
Setting partition2 name as: porteus
Formatting partition1
Formatting partition2
Downloading refind ...
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
100 2288k 100 2288k 0 0 264k 0 0:00:08 0:00:08 --:--:-- 330k
Decompressing refind ...
Installing refind to device ...
Installing rEFInd on Linux....
UnmountEsp = 1
Copied rEFInd binary files
Copying sample configuration file as refind.conf; edit this file to configure
rEFInd.
Installation has completed successfully.
Unmounting install dir
Probing target device ...
Mounting partition1 ...
Copying kernel files to device ...
Copying custom icons ...
lsblk: /dev/sdb2: not a block device
Unmounting partition 1
Mounting partition 2
ntfs-3g: Failed to access volume '/dev/sdb2': No such file or directory
ntfs-3g 2013.1.13 integrated FUSE 27 - Third Generation NTFS Driver
Configuration type 1, XATTRS are on, POSIX ACLS are off
Copyright (C) 2005-2007 Yura Pakhuchiy
Copyright (C) 2006-2009 Szabolcs Szakacsits
Copyright (C) 2007-2012 Jean-Pierre Andre
Copyright (C) 2009 Erik Larsson
Usage: ntfs-3g [-o option[,...]] <device|image_file> <mount_point>
Options: ro (read-only mount), windows_names, uid=, gid=,
umask=, fmask=, dmask=, streams_interface=.
Please see the details in the manual (type: man ntfs-3g).
Example: ntfs-3g /dev/sda1 /mnt/windows
News, support and information: http://tuxera.com
Failed to mount /dev/sdb2
guest@porteus:~$
And the gdisk f option.http://www.rodsbooks.com/gdisk/gdisk.html wrote:enables GPT-unaware OSes, or those that can't boot from a GPT disk, to access up to three of the partitions on the disk by creating MBR entries for them.
http://www.rodsbooks.com/gdisk/gdisk.html wrote:Load MBR and build fresh GPT from it. Use this option if your GPT is corrupt or conflicts with the MBR and you want to use the MBR as the basis for a new set of GPT partitions
Are you sure about that?brokenman wrote:My interest lies in getting this working by nuking the existing partition setup (which it currenttly does)
brokenman wrote:For now you can nuke the drive yourself before starting and see if ti makes any difference:Code: Select all
parted /dev/sdb mklabel msdos quit
Thank you.I will check out those gdisk options. Thanks.
Yes. Check out the gdisk options: x, zAre you sure about that?