Partitioning A USB Thumb Drive with Parted Solved

Alexzee

Well-Known Member
Joined
Jun 1, 2019
Messages
3,679
Reaction score
1,961
Credits
21,883
I'm trying to partition my USB thumb drive with parted in the konsole/terminal.
This way I can continue with the rest of the instructions to run Clonezilla Live.

Parted wants the percentage % and not a number, See the screenshot:-

I've tried for hours using Google to find the percentage of 500 megabytes taken up of a 16 gigabyte drive.

Here's the tutorial I'm following to partition my thumb drive using parted.
Parted.png
 


500/16,000 x 100/1=3.125 No?
No but thanks for trying.

I need the exact percentage amount of 500 MiB's takes up on a 16 GB drive.
If I give the wrong percentage to parted it may not equal to 500 MiB's.

@KGIII was a mathematician I think, wonder if he knows?
 
I may be barking up the wrong tree, but I think mebibyte and gibibyte make the same answer:
512/16384 x 100/1 = 3.125

Or maybe it's mebibytes of gigabytes:
512/16,000 x 100/1 = 3.2 ?
 
I may be barking up the wrong tree, but I think mebibyte and gibibyte make the same answer:
512/16384 x 100/1 = 3.125

Or maybe it's mebibytes of gigabytes:
512/16,000 x 100/1 = 3.2 ?
Maybe the decimal to percentage calculator is the answer?
I'm confused-

 
Closing the terminal and shutting down my pc.....got things to tend to.
bb later-
 
500 / 16000 0.03125 and just move the decimal point two places to the right and you've got 3.125%
 
Easier to go with the numbers, it won't accept decimal points and fractions.

Alex try this, and substitute your own device ID, mine is /dev/sdd

Code:
sudo parted /dev/sdd

(parted) mklabel
msdos
Y

mkpart
primary
fat32

Start? 1049kB

End? 512MB

(parted) print #and I get

Model: SanDisk Cruzer Glide (scsi)
Disk /dev/sdd: 15.7GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Disk Flags:

Number  Start   End    Size   Type     File system  Flags
 1      1049kB  512MB  511MB  primary  fat32        lba
 
 
 (parted) align-check
alignment type(min/opt)  [optimal]/minimal? minimal                       
Partition number? 1                                                       
1 aligned

(parted) quit

I take it you want to use the rest of the stick for other uses, attend to them later, so go for the Clonezilla Live first and test it works OK.

You're on UEFI, Yes? Or MBR?

I'm on UEFI, and on Linux Mint Vera, so I downloaded

clonezilla-live-20230212-kinetic-amd64.zip

With their stuff about

pmount

that's an old package (2004) I wouldn't bother with it and just substitute

mount and umount

that are already on your system.

Sing out if you need more help.

Chris
 
A little more because of the disparate timezones.

With the Clonezilla instructions, using

sudo mount /dev/sxyz /media/disk

returns a can't find/doesn't exist error (which I expected, maybe pmount works)

so I used

sudo mount /dev/sdd1 /media/chris/

and worked from there.

Rebooting and going to the stick as first choice worked fine, and I only went as far as

iUIVzqu.jpg


to be confident it should work OK. Takes too long in my environment, with having to identify 84 distros, lol.

Wiz
BTW you can also create more partitions, ext4 or otherwise, without compromising the stick's ability to be booted from.
 
Easier to go with the numbers, it won't accept decimal points and fractions.

Alex try this, and substitute your own device ID, mine is /dev/sdd

Code:
sudo parted /dev/sdd

(parted) mklabel
msdos
Y

mkpart
primary
fat32

Start? 1049kB

End? 512MB

(parted) print #and I get

Model: SanDisk Cruzer Glide (scsi)
Disk /dev/sdd: 15.7GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Disk Flags:

Number  Start   End    Size   Type     File system  Flags
 1      1049kB  512MB  511MB  primary  fat32        lba
 
 
 (parted) align-check
alignment type(min/opt)  [optimal]/minimal? minimal                      
Partition number? 1                                                      
1 aligned

(parted) quit

I take it you want to use the rest of the stick for other uses, attend to them later, so go for the Clonezilla Live first and test it works OK.

You're on UEFI, Yes? Or MBR?

I'm on UEFI, and on Linux Mint Vera, so I downloaded

clonezilla-live-20230212-kinetic-amd64.zip

With their stuff about

pmount

that's an old package (2004) I wouldn't bother with it and just substitute

mount and umount

that are already on your system.

Sing out if you need more help.

Chris
Yes this is a UEFI Asus BIOS desktop.
Yeah, I'm just trying to create a 500 MB partition to put Clonezilla on the usb thumb drive to clone my Slackware install.
pmount wasn't installed in the Linux Mint distro that I'm using to do this operation.
Like you said it's an old pkg so I'll use mount and umount, thanks!

If I have any more trouble I'll see if gparted can do this for me instead of using parted in the command-line.
 
It worked!
Code:
GNU Parted 3.4
Using /dev/sdc
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) print                                                           
Model: SMI USB DISK (scsi)
Disk /dev/sdc: 15.7GB
Sector size (logical/physical): 512B/512B
Partition Table: loop
Disk Flags:

Number  Start  End     Size    File system  Flags
 1      0.00B  15.7GB  15.7GB  fat32

(parted) mklabel                                                         
New disk label type? msdos                                               
Warning: Partition(s) on /dev/sdc are being used.
Ignore/Cancel? Ignore                                                     
Warning: The existing disk label on /dev/sdc will be destroyed and all data on
this disk will be lost. Do you want to continue?
Yes/No? Yes                                                               
(parted) mkpart                                                           
Partition type?  primary/extended? primary                               
File system type?  [ext2]? fat32                                         
Start? 1049kb                                                             
End? 512MB                                                               
(parted) print                                                           
Model: SMI USB DISK (scsi)
Disk /dev/sdc: 15.7GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Disk Flags:

Number  Start   End    Size   Type     File system  Flags
 1      1049kB  512MB  511MB  primary  fat32        lba

(parted) align-check                                                     
alignment type(min/opt)  [optimal]/minimal? minimal                       
Partition number? 1                                                       
1 aligned
(parted) print                                                           
Model: SMI USB DISK (scsi)
Disk /dev/sdc: 15.7GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Disk Flags:

Number  Start   End    Size   Type     File system  Flags
 1      1049kB  512MB  511MB  primary  fat32        lba

Now I just have to put the Clonezilla zip on the thumb drive.
 
Well pmount and sudo mount, the mount point doesn't exit-
Not sure what's wrong here?
Code:
Alex:  pmount /dev/sdc1 /media/disk/
Error: '/' must not occur in label name
Alex:  sudo mount /dev/sdc1 /media/disk
[sudo] password for alex:         
mount: /media/disk: mount point does not exist.
Alex:
 
Well pmount and sudo mount, the mount point doesn't exit-

Oh, good - it wasn't just me holding my mouth the wrong way.

That's why I used mount and umount, and it worked OK. :)
 
IF I try to unzip Clonezilla to the usb thumb drive I get errors.
Code:
Alex:  ls
clonezilla-live-20230212-kinetic-amd64.zip
ManjaTrix.tar.tar
Rage-Gothic-Emerald.tar.tar
set_up_grub_as_boot_loader_on_uefi_hardware-1.pdf
set_up_grub_as_boot_loader_on_uefi_hardware.pdf
Alex:  sudo mount /dev/sdc1 /media/alex
[sudo] password for alex:         
mount: /media/alex: wrong fs type, bad option, bad superblock on /dev/sdc1, missing codepage or helper program, or other error.
Alex:  unzip clonezilla-clonezilla-live-20230212-kinetic-amd64.zip -d /media/alex/
Archive:  clonezilla-live-20230212-kinetic-amd64.zip
checkdir error:  cannot create /media/alex/syslinux
                 Permission denied
                 unable to process syslinux/.
checkdir error:  cannot create /media/alex/syslinux
                 Permission denied


Here's what's going on using Gparted to give you information.
Gparted USB.png

Gparted Info.png
 
Alex: sudo mount /dev/sdc1 /media/alex

Syntax error, you need a / after alex, so

sudo mount /dev/sdc1 /media/alex/

Wiz
 
Syntax error, you need a / after alex, so

sudo mount /dev/sdc1 /media/alex/

Wiz
Ok-
I unzipped the Clonezilla live and saw all the files.

Code:
Disk /dev/sdc: 14.65 GiB, 15728640000 bytes, 30720000 sectors
Disk model: USB DISK       
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: 0x12cfc587

Device     Boot Start    End Sectors  Size Id Type
/dev/sdc1        2048 999423  997376  487M  c W95 FAT32 (LBA)
Alex:
How can I be sure that Clonezilla is on the usb thumb drive before I go into the BIOS to boot it?
 
Well, there's File Manager

ZqC2rqJ.png


Or compare your output with mine (I used a 16 GB stick as well)

Yours

Disk /dev/sdc: 14.65 GiB, 15728640000 bytes, 30720000 sectors
Disk model: USB DISK
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: 0x12cfc587

Device Boot Start End Sectors Size Id Type
/dev/sdc1 2048 999423 997376 487M c W95 FAT32 (LBA)
Alex:


and mine

Disk /dev/sdd: 14.59 GiB, 15664676864 bytes, 30595072 sectors
Disk model: Cruzer Glide
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: 0xbf1b0a8c

Device Boot Start End Sectors Size Id Type
/dev/sdd1 2048 999423 997376 487M c W95 FAT32 (LBA)
/dev/sdd2 999424 30595071 29595648 14.1G 83 Linux

487M each, snap.

Wiz
 
Code:
Disk /dev/sdc: 14.65 GiB, 15728640000 bytes, 30720000 sectors
Disk model: USB DISK       
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: 0x12cfc587

Device     Boot Start    End Sectors  Size Id Type
/dev/sdc1        2048 999423  997376  487M  c W95 FAT32 (LBA)

Now I should be able to boot the usb thumb drive and start Clonezilla like you showed in post #9.
I'm headed to YouTube to watch a few videos......as I haven't used Clonezilla before.

Thanks for the help Wizard!
Enjoy the day!
 
.....as I haven't used Clonezilla before.

Oh dear, have fun, Alex. It's a good tool, but too slow for me with 84 distros.

And you are always welcome, my friend.
 
Oh dear, have fun, Alex. It's a good tool, but too slow for me with 84 distros.

And you are always welcome, my friend.
I've watched this video and it was helpful-

I'm just not sure if Clonezilla will copy the distro to the destination drive which is a usb thumb drive?
However; I have to find out by going through the process. This isn't my preferred way of doing things but I won't know unless I try.

Most of the YouTube video's for using Clonezilla are from disk to disk:- OR> partition to disk:-
Anyway.................
I can easily go into the BIOS and select the usb thumb drive and boot the clone that way.

Having 84 distro's has it's advantages and disadvantages I can only imagine.
I'm thinking it's pretty redundant for you to update them all, LOL!

Is this a desktop that you have the 84 distro's on?
 

Members online


Top