2

I have imaged 64Gb usb stick with kali linux iso as explained in official documentation.

Then I have created persistence partition with parted in accordance with official docs as well.

But even after doing this gparted shows the whole drive with no partitions: enter image description here Why does not it show all of the partitions? Is it an expected behaviour? Is there any way to make it understand and show all the partitions?

here is the lsblk output: lsblk output

I want to use all remaining space as a normal ExFAT storage. What is the proper way to do it?

3

Please see gparted not detecting USB drive partitions in Fedora 27 only for explanation from gparted developer. I had similar issue and asked that.

Latter I found newer versions of the software have this issue. So you may uninstall the current version gparted installed. Download source code of gparted 25 compile and use that. I'm using gparted 25 and it's working fine with the situation you're mentioned.

NOTE You may need to run gparted 25 as root from Terminal only. If you want to launch it from GUI edit menu button corresponding to the software, pick run in terminal option and append sudo before starting command.

| improve this answer | |
  • You are treating the symptoms, not the cause. Downgrading to an older version seems to make the error messages go away, but does not fix what's wrong with the disk. The message you linked to leads you to the real fix. – Johan Myréen Dec 27 '17 at 3:55
  • I know. But if I wipe the iso signature from the usb drive using wipefs (as mentioned in the link given in that answer), the usb drive loosing the bootable property. I'm really not an expert in this. May you please explain me how you've fixed it with newer version of gparted? It'll help me. Thanks. – Abhik Bose Dec 27 '17 at 8:02
  • I know the real fix would be using wipefs -o 0x8001 /dev/sdX. But I have marked this because this answer lead me to the correct answer... Ideally @Abhik Bose would post the correct workflow of the solution here... – Drew Dec 28 '17 at 2:26
  • The only problem seems to be the explanation: wipefs does not remove iso partition table, but does the opposite - removes any partition tables (gpt and dos in my case lol) before the iso partition table.. – Drew Dec 28 '17 at 5:27
  • @Drew You can instruct wipefs to remove the iso9660 signature selectively. First list all file system and partition table using wipefs /dev/sdX then from the output you can selectively remove iso9660 like sudo wipefs -o 0x8001 /dev/sdX if 0x8001 is iso9660 offsel. This will keep gpt intact. But after doing do the usb drive concerned loosing it's bootable property. – Abhik Bose Dec 28 '17 at 9:08
1

Posting this here just to clarify @Abhik Bose's answer.

After imaging iso using dd the USB drive has multiple partition tables at the beginning of the disk.

gparted versions below v0.28 have ISO Partition Map Bugs and the bug fix resulted in another issue stated above.

So using old versions of gparted (before v0.28), for example v0.25, will fix this problem. But there is a better way to do it.

Attach USB to another Linux machine (Like another Kali or Ubuntu VM) Check it's name with lsblk

Then see all partition tables with wipefs /dev/sdb

enter image description here

As we can see there are two other partition table signatures in the beginning of the drive: gpt and dos (I guess it is the same as mbr)

Do:

wipefs -o 0x8001 /dev/sdX  # X - letter of the drive

This will surgically write zeros over 5 bytes of the ISO signature without touching the GPT (Or at least that is what this post says...)

Now run gparted /dev/sdb and see the result as expected:

enter image description here

That's it.

| improve this answer | |
0

You can access the persistence partition with gparted from the command line but not change it with

gparted /dev/sdb3

Otherwise you can change the filesystem from the command line the same way you created it with

mkfs.exfat -L myPartitionName /dev/sdb3

Best to do this from whichever distro you used to create the live usb from and not from within the live boot of Kali since the persistence partition contains any updates or packages you may have installed.

Edit

The obvious bit

Since the dd'copies the iso image to the usb it also copies the signature that your system needs to identify this as an iso image and boot appropriately. Without this information it won't boot, as you have found.

The interesting bit

Although you modified the partition table when you created /dev/sdb3 and you can detect and mount the persistence FS you created gparted sees this as a single iso volume for the reasons given here.

The behaviour to report whole disk file systems before partition tables was changed in GParted 0.28.0 as part of bug 771244. This was so that kernel reported partitions embedded within ISO images on whole disks aren't displayed so the user doesn't try to manipulate those ISO embedded partitions, which is impossible.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.