Unable to Re-read Partition Table Without Rebooting Debian

Getting your soundcard to work, using Debian on non-i386 hardware, etc

Unable to Re-read Partition Table Without Rebooting Debian

Postby 4joeyirosh1 » 2020-04-08 02:29

Hi!I have Debian 10.3 installed on my machine.

I normally write the Debian 10.3 iso file onto a flash disk to be bootable with the Debian but once a while I need to covert the flash disk into NTFS filesystem to save files on the disk to be viewable on Windows OS.

I normally use gparted to convert the flash disk into NTFS but once the filesystem conversion is done,I am forced to reboot my machine for the flash disk to be mounted and viewed as an NTFS disk.As expected,its cumbersome to keep rebooting my machine to effect his change and have been exploring the workaround of using partprobe and kpart commands to re-read the partition table but I am still forced to reboot machine.I have run the commands above as shown with no effect

Code: Select all
# partprobe

#partprobe /dev/sdb

#kpartx -u /dev/sdb1


Please assist
4joeyirosh1
 
Posts: 89
Joined: 2016-09-11 18:04

Re: Unable to Re-read Partition Table Without Rebooting Deb

Postby p.H » 2020-04-08 06:58

4joeyirosh1 wrote: Unable to Re-read Partition Table

How do you see this ? Any error message when running partprobe or so ?

4joeyirosh1 wrote:I am forced to reboot my machine for the flash disk to be mounted and viewed as an NTFS disk

Why ? What happens if you mount the filesystem without rebooting ?

I advise to wipe all metadata on a media which contains an ISO image before re-using it for other purpose.
Code: Select all
wipefs -a /dev/sdX
p.H
 
Posts: 1363
Joined: 2017-09-17 07:12

Re: Unable to Re-read Partition Table Without Rebooting Deb

Postby 4joeyirosh1 » 2020-04-08 15:14

p.H wrote:
4joeyirosh1 wrote: Unable to Re-read Partition Table

How do you see this ? Any error message when running partprobe or so ?

There is no error when running partprobe

4joeyirosh1 wrote:I am forced to reboot my machine for the flash disk to be mounted and viewed as an NTFS disk

Why ? What happens if you mount the filesystem without rebooting ?

When I plug in the flash disk I cannot view the disk from the files menu though I can see its mounted from gparted.

I advise to wipe all metadata on a media which contains an ISO image before re-using it for other purpose.
Code: Select all
wipefs -a /dev/sdX


I am wiping all metadata using gparted then creating a new NTFS filesystem
4joeyirosh1
 
Posts: 89
Joined: 2016-09-11 18:04

Re: Unable to Re-read Partition Table Without Rebooting Deb

Postby p.H » 2020-04-12 09:04

How do you wipe all metadata using gparted ?
Creating a new partition table or filesystem does not wipe all metadata.
p.H
 
Posts: 1363
Joined: 2017-09-17 07:12

Re: Unable to Re-read Partition Table Without Rebooting Deb

Postby 4joeyirosh1 » 2020-04-12 11:18

p.H wrote:How do you wipe all metadata using gparted ?
Creating a new partition table or filesystem does not wipe all metadata.


I was using gparted to format the partition into cleared before creating new partition table.

I have tried using wipefs as below

Code: Select all
~# wipefs -af /dev/sdb*
/dev/sdb: 2 bytes were erased at offset 0x000001fe (dos): 55 aa
/dev/sdb1: 8 bytes were erased at offset 0x00000003 (ntfs): 4e 54 46 53 20 20 20 20
/dev/sdb1: 2 bytes were erased at offset 0x000001fe (dos): 55 aa


Then I created a new MSDOS partition then created an NTFS partition both using gparted.Next I run partprobe and kpartx.When I unplug then replug the USB,it does not load from files menu and I am still forced to reboot the machine for the USB to load
4joeyirosh1
 
Posts: 89
Joined: 2016-09-11 18:04

Re: Unable to Re-read Partition Table Without Rebooting Deb

Postby p.H » 2020-04-12 11:49

Did you unmount any mounted filesystem on the USB drive before 1) repartitioning and reformating it and 2) before unplugging it ?
Why on earth do you use kpartx ?
p.H
 
Posts: 1363
Joined: 2017-09-17 07:12

Re: Unable to Re-read Partition Table Without Rebooting Deb

Postby 4joeyirosh1 » 2020-04-12 13:00

p.H wrote:Did you unmount any mounted filesystem on the USB drive before 1) repartitioning and reformating it and 2) before unplugging it ?
Why on earth do you use kpartx ?


Surprisingly,When I ran the umount command before running the wipefs command it would state device not mounted yet I can see the device from gparted.

I also noticed that once I formatted and unplugged the USD,its visible when I plug it to a Windows machine but not visible on linux and have to reboot linux for it to be seen.
4joeyirosh1
 
Posts: 89
Joined: 2016-09-11 18:04


Return to Hardware

Who is online

Users browsing this forum: No registered users and 7 guests

fashionable