Re: Setting a USB for multi usages

2019-05-19 Thread Andrei POPESCU
On Vi, 11 ian 19, 21:48:06, MENGUAL Jean-Philippe wrote:
> Hi,
> 
> My purpose is having a USB stick splitted in 2 parts:
> 1. MBR + partitions: a Debian installer from an ISO
> 2. A blank partition to install data or whatver
> 
> While I know to "burn" an iso on a key via dd, how can I do to have a clean
> installer but using key for other usages?

Instead of "burning" the iso image you can manually create a bootable 
stick and regular-copy an iso of your choice (and anything else you 
want) to it.

https://www.debian.org/releases/stable/amd64/ch04s03.html.en#usb-copy-flexible

Kind regards,
Andrei
-- 
http://wiki.debian.org/FAQsFromDebianUser


signature.asc
Description: PGP signature


Re: Setting a USB for multi usages

2019-01-12 Thread Richard Owlett

On 01/12/2019 05:58 AM, Thomas Schmitt wrote:

Hi,


Now at mounting, I have a strange behavior: polki requires a root password
to mount both the Debian partition and the data partition. I use Debian sid
with MATE desktop.


If the partitions are recognized by the Linux kernel (i.e. show up as
/dev/sdb1, sdb2, sdb3) then the partition table is ok.

Password questions for mounting USB sticks seem to be normal.
Google "polkit mount password" yields plenty of discussions and proposals.
Maybe one of our fellow group members can shorten your search for the
right one.



As one who has had many problems with privileges/permissions/etc issues, 
"polkit" is the keyword.


I did the suggested search and found:
   http://smcv.pseudorandom.co.uk/2015/why_polkit/
and
   https://wiki.archlinux.org/index.php/Polkit#For_specific_actions

They briefly summarize the problem system designers faced and hint at 
how a user could approach solving the problems in particular use case.


Wish someone had pointed me to polkit a long time ago.






Re: Setting a USB for multi usages

2019-01-12 Thread Thomas Schmitt
Hi,

> Now at mounting, I have a strange behavior: polki requires a root password
> to mount both the Debian partition and the data partition. I use Debian sid
> with MATE desktop.

If the partitions are recognized by the Linux kernel (i.e. show up as
/dev/sdb1, sdb2, sdb3) then the partition table is ok.

Password questions for mounting USB sticks seem to be normal.
Google "polkit mount password" yields plenty of discussions and proposals.
Maybe one of our fellow group members can shorten your search for the
right one.


Have a nice day :)

Thomas



Re: Setting a USB for multi usages

2019-01-12 Thread MENGUAL Jean-Philippe

Hi,

Thanks for your reply. As I want debian 8 installer, I am not sure about 
EFI so I use this method, I could not have creatd it myself.


Le 11/01/2019 à 23:03, Thomas Schmitt a écrit :

Hi,

MENGUAL Jean-Philippe wrote:

My purpose is having a USB stick splitted in 2 parts:
1. MBR + partitions: a Debian installer from an ISO
2. A blank partition to install data or whatver

While I know to "burn" an iso on a key via dd, how can I do to have a clean
installer but using key for other usages?


Put the ISO onto the stick, completely deface its pseudo-GPT,
and use program fdisk to add one or more partitions.

1. I issue dd if=/dev/zero of=/dev/sdb
2. Then: dd if=my-iso of=/dev/sdb
3. I ran the command you suggest below.

dd if=/dev/zero bs=512 seek=1 count=1 of=/dev/sdb
dd if=/dev/zero bs=512 seek=$n count=1 of=/dev/sdb

Now at mounting, I have a strange behavior: polki requires a root 
password to mount both the Debian partition and the data partition. I 
use Debian sid with MATE desktop.


Why? Is it a misbehavior I should report to polkit or semething else? 
How can I mount the partitions, in particular the data one, to let the 
user write and read?


Thanks

Regards



The partition situation in a Debian ISO for x86 is not as nice
as it should/could be:

   $ /sbin/fdisk -lu debian-9.3.0-amd64-netinst.iso
   ...
   Device  Boot StartEnd Sectors  Size Id Type
   debian-9.3.0-amd64-netinst.iso1 *0 593919  593920  290M  0 Empty
   debian-9.3.0-amd64-netinst.iso2   3760   4591 832  416K ef EFI 
(FAT-12/1

Note the EFI partition 2 of type 0xef sitting inside partition 1 which
is of type 0x00.
Nevertheless fdisk will add partition 3 and 4 if you ask it to do so.


There are the data of a GPT, but it is not properly announced by a
protective MBR partition of type 0xee. The GPT shows the same overlapping
partitions, which are explicitely forbidden by the GPT specs.
Thus my advise to remove the GPT header block:

   dd if=/dev/zero bs=512 seek=1 count=1 conv=notrunc of=/dev/sdX

where /dev/sdX is the device file of your USB stick.
(Option conv=notrunc is just for the case your of= target is an .iso file
  and not a disk device file.)


On a USB stick, the GPT backup header will probably not be recognized
because it will be misplaced. But an overly smart partition editor might
still find it and propose to replace your MBR partition table by that
GPT.

To kill the backup GPT header, you need to compute the last 512-byte
block number n of the ISO (in case of the 9.3.0 ISO n is 593919):

   n=$(expr $(ls -l debian-9.3.0-amd64-netinst.iso | awk '{print $5}') / 512 - 
1)

and zeroize that block:

   dd if=/dev/zero bs=512 seek=$n count=1 conv=notrunc of=/dev/sdX

After this, programs like gdisk will not try to overwrite the MBR
partition table by the GPT.


Have a nice day :)

Thomas





Re: Setting a USB for multi usages

2019-01-11 Thread Thomas Schmitt
Hi,

MENGUAL Jean-Philippe wrote:
> My purpose is having a USB stick splitted in 2 parts:
> 1. MBR + partitions: a Debian installer from an ISO
> 2. A blank partition to install data or whatver
>
> While I know to "burn" an iso on a key via dd, how can I do to have a clean
> installer but using key for other usages?

Put the ISO onto the stick, completely deface its pseudo-GPT,
and use program fdisk to add one or more partitions.

The partition situation in a Debian ISO for x86 is not as nice
as it should/could be:

  $ /sbin/fdisk -lu debian-9.3.0-amd64-netinst.iso
  ...
  Device  Boot StartEnd Sectors  Size Id Type
  debian-9.3.0-amd64-netinst.iso1 *0 593919  593920  290M  0 Empty
  debian-9.3.0-amd64-netinst.iso2   3760   4591 832  416K ef EFI 
(FAT-12/1

Note the EFI partition 2 of type 0xef sitting inside partition 1 which
is of type 0x00.
Nevertheless fdisk will add partition 3 and 4 if you ask it to do so.


There are the data of a GPT, but it is not properly announced by a
protective MBR partition of type 0xee. The GPT shows the same overlapping
partitions, which are explicitely forbidden by the GPT specs.
Thus my advise to remove the GPT header block:

  dd if=/dev/zero bs=512 seek=1 count=1 conv=notrunc of=/dev/sdX

where /dev/sdX is the device file of your USB stick.
(Option conv=notrunc is just for the case your of= target is an .iso file
 and not a disk device file.)


On a USB stick, the GPT backup header will probably not be recognized
because it will be misplaced. But an overly smart partition editor might
still find it and propose to replace your MBR partition table by that
GPT.

To kill the backup GPT header, you need to compute the last 512-byte
block number n of the ISO (in case of the 9.3.0 ISO n is 593919):

  n=$(expr $(ls -l debian-9.3.0-amd64-netinst.iso | awk '{print $5}') / 512 - 1)

and zeroize that block:

  dd if=/dev/zero bs=512 seek=$n count=1 conv=notrunc of=/dev/sdX

After this, programs like gdisk will not try to overwrite the MBR
partition table by the GPT.


Have a nice day :)

Thomas



Re: Setting a USB for multi usages

2019-01-11 Thread Joel Wirāmu Pauling
If using Uefi installs you only need to have a vfat formated first
partition with a folder called efi and the appropriate efi
binary/substructure. You can use the rest of the disk as you like.

BIOS installers on the same can be achieved with syslinux in addition to
uefi. However I find that just having uefi seems to go better these days
(at least if installing onto recent hardware). Due to varying levels of
vendor write as around CSM (compatibility BIOS/system mode) breaking dual
BIOS/eufi media installers.

-Joel

On Sat., 12 Jan. 2019, 09:48 MENGUAL Jean-Philippe  Hi,
>
> My purpose is having a USB stick splitted in 2 parts:
> 1. MBR + partitions: a Debian installer from an ISO
> 2. A blank partition to install data or whatver
>
> While I know to "burn" an iso on a key via dd, how can I do to have a
> clean installer but using key for other usages?
>
> Thanks very much
>
> regards
>
> --
> [image: Logo Hypra] JEAN-PHILIPPE MENGUAL
> DIRECTEUR TECHNIQUE ET QUALITÉ
> 102, rue des poissonniers, 75018, Paris
> Tel : +331 84 73 06 61 <+33184730661> Mob : +336 76 34 93 37
> <+33676349337>
> jpmeng...@hypra.fr
> www.hypra.fr
> [image: Facebook Hypra]  [image:
> Twitter Hypra]  [image: Linkedin
> Jean-Philippe]
> 
>
>