Can you dd fossapup64 to a USB drive? My partial attempt [SOLVED] it worked :)

Issues and / or general discussion relating to Puppy

Moderator: Forum moderators

Post Reply
s243a
Posts: 501
Joined: Mon Dec 09, 2019 7:29 pm
Has thanked: 90 times
Been thanked: 37 times

Can you dd fossapup64 to a USB drive? My partial attempt [SOLVED] it worked :)

Post by s243a »

I thought I would try to apply the fatdog64 usb install instructions to fossapup64 and see what happens. This of course will only work if fossapup64 is created by isohybird and I think it is.

The first step is the dd command:

Code: Select all

dd if=./fossapup64-9.5.iso of=/dev/sdc1 bs=4M

This seems to take quite a while. I wonder if it stops once the end of the iso data is reached or it stops when the end of the drive is reached. Also not sure if I should just have "sdc" or "sdc1"

Next the fatdog64 instructions say that I should be able to use the extra space at the end of the drive be using the fix-usb.sh command. This script doesn't work as expected on fossapup. I think the utility on fossapup outputs a different format that fatdog64. For instance I get:

Code: Select all

sfdisk -uS -l /dev/sdc
Disk /dev/sdc: 28.9 GiB, 31042043904 bytes, 60628992 sectors
Disk model: USB DISK 3.0    
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: 0xf404eeaa

The script apears to be looking for the sector field so I want field 7 but the fix-usb.sh script has the following command:

Code: Select all

ACTUAL_USED=$(sfdisk -uS -l $1 2>/dev/null | awk '/^\/.*\*/ {print $4}')

so I can modify it per my output:

Code: Select all

ACTUAL_USED=$(sfdisk -uS -l $1 2>/dev/null | awk '/^Disk \/.*/ {print $7}')

but the size given apears to be the whole usb drive. Maybe I should have formatted the drive first? If so how? Should I specify a partition table and if so what type?

Anyway, rather than using the above function. I realized that the fosspup64 iso is only 409 MB so if I reserve 500MB I should have more than enough.

Code: Select all

#RESERVED_SPACE=262144 #128 MB
RESERVED_SPACE=1024000 #500 MB

and the code to calculate space actually used was commented out. The resevered space is the sector (or block size 512 bytes). Here is a link for a calculator that coverts block size to magabytes:
http://www.unitconversion.org/data-stor ... rsion.html

but the actual steps are first to multiply 512 by the number of sectors to get the number of bytes and then devide the number of bytes by "1048576" to get the number of megabytes. See:

https://www.techspot.com/news/68482-qui ... kb-mb.html

Or in reverse we multiple the 500MB we want to reserve by 1048576 to get the number of bytes and then divide by 512 to get the number of sectors.

Anyway, after making my changes to the script it tells me that there is no space on the device. This makes me think that I should have formatted the device first.

s243a
Posts: 501
Joined: Mon Dec 09, 2019 7:29 pm
Has thanked: 90 times
Been thanked: 37 times

Re: Can you dd fossapup64 to a USB drive? My partial attempt [SOLVED] it worked :)

Post by s243a »

I formatted the drive by creating a dos partition table in gparted.

I ran the dd command without the partion suffix:

Code: Select all

dd if=./fossapup64-9.5.iso of=/dev/sdc bs=4M

the fix-usb.sh script worked with my modificaitons, although it was a bit of a hack. Here is the output:

Code: Select all

[root@Dpupbuster ~/Downloads] $ fix-usb.sh /dev/sdc
Specify filesystem type (in hex number). These are common ones:
L  - linux (ext2/3/4)
b  - FAT32
7  - NTFS or exFAT
ef - UEFI boot partition
Default is FAT32
L
You choose "L" as the type.
Reserving space for 1024000 sectors.
Last chance to abort - are you sure to you want to fix /dev/sdc [y/N]? y
warning: /dev/sdc: partition 3 is not defined yet
Checking that no-one is using this disk right now ... OK

Disk /dev/sdc: 28.9 GiB, 31042043904 bytes, 60628992 sectors
Disk model: USB DISK 3.0    
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: 0x209e43b1

Old situation:

Device     Boot Start    End Sectors  Size Id Type
/dev/sdc1  *        0 837631  837632  409M  0 Empty
/dev/sdc2         176  18607   18432    9M ef EFI (FAT-12/16/32)

/dev/sdc3: Created a new partition 3 of type 'Linux' and of size 28.4 GiB.

New situation:
Disklabel type: dos
Disk identifier: 0x209e43b1

Device     Boot   Start      End  Sectors  Size Id Type
/dev/sdc1  *          0   837631   837632  409M  0 Empty
/dev/sdc2           176    18607    18432    9M ef EFI (FAT-12/16/32)
/dev/sdc3       1024000 60628991 59604992 28.4G 83 Linux

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

Done. Now you need to make filesystem in it. How to do it depends on the
filesystem you have chosen.
For FAT32, do "mkdosfs /dev/sdc3"
For NTFS,  do "mkntfs /dev/sdc3"
For exFAT, do "mkfs -t exfat /dev/sdc3"
For Linux, do "mkfs -t ext4 /dev/sdc3" (or ext3 or ext2 as you wish)
For other filesystem - I assume you know what you're doing :)

If you already have a previous filesystem there (ie you dd fatdog.iso to 
a USB flash drive that has previously been "fixed"), you may not need to 
format it.

If you need to format it, after formatting type "sfdisk -R /dev/sdc" to refresh
the drive icons.

=== THE END ===

I was able to boot using the USB drive that I created. However, I had to disable secure boot for this to work.

Clarity
Posts: 3682
Joined: Fri Jul 24, 2020 10:59 pm
Has thanked: 1559 times
Been thanked: 496 times

Re: Can you dd fossapup64 to a USB drive? My partial attempt [SOLVED] it worked :)

Post by Clarity »

For writing distro's ISO to create a bootable PUP USB, the proper dd command is this one you used.

Code: Select all

# dd if=./fossapup64-9.5.iso of=/dev/sdc bs=4M

It should produce a drive with 2 partitions; a FAT and a contents partition which usually is a recognized filesystem.

GParted should be used for claiming any unused space.

FATDOG is a special case where it creates a USB that "looks" like a DVD. You claim its unused space using the FATDOG special command for such. If you use GPARTED to look at the drive, it will show an ISO9660 partition.

The PUP hybrid generation and the FATDOG hybrid generations are different beasts.

Hope this is helpful.

User avatar
puddlemoon
Posts: 189
Joined: Sun Sep 06, 2020 9:26 pm
Location: In between
Has thanked: 89 times
Been thanked: 64 times

Re: Can you dd fossapup64 to a USB drive? My partial attempt [SOLVED] it worked :)

Post by puddlemoon »

dd is my go to for writing any iso to USB. I have also been using the fix-usb script, unmodified, with a number of different linux isos, without issue as yet. I got the script from fossadog, and having been made for fatdog, seemed worth trying elswhere.
If I remember correctly, they always show the same. Gparted shows a single iso9660 while pMount shows the individual partitions within it. (of course there is variation on how those partitions are arranged)
Just some trial/observations...

This is after running the fix-usb script on my fossapup remaster. Before was the same without the ext4.

Attachments
Screenshot(5).png
Screenshot(5).png (46.77 KiB) Viewed 574 times
Post Reply

Return to “Users”