Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

Unable to Re-read Partition Table Without Rebooting Debian

Need help with peripherals or devices?
Post Reply
Message
Author
4joeyirosh1
Posts: 157
Joined: 2016-09-11 18:04
Been thanked: 3 times

Unable to Re-read Partition Table Without Rebooting Debian

#1 Post by 4joeyirosh1 »

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

p.H
Global Moderator
Global Moderator
Posts: 3049
Joined: 2017-09-17 07:12
Has thanked: 5 times
Been thanked: 132 times

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

#2 Post by p.H »

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

4joeyirosh1
Posts: 157
Joined: 2016-09-11 18:04
Been thanked: 3 times

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

#3 Post by 4joeyirosh1 »

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

p.H
Global Moderator
Global Moderator
Posts: 3049
Joined: 2017-09-17 07:12
Has thanked: 5 times
Been thanked: 132 times

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

#4 Post by p.H »

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

4joeyirosh1
Posts: 157
Joined: 2016-09-11 18:04
Been thanked: 3 times

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

#5 Post by 4joeyirosh1 »

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

p.H
Global Moderator
Global Moderator
Posts: 3049
Joined: 2017-09-17 07:12
Has thanked: 5 times
Been thanked: 132 times

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

#6 Post by p.H »

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 ?

4joeyirosh1
Posts: 157
Joined: 2016-09-11 18:04
Been thanked: 3 times

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

#7 Post by 4joeyirosh1 »

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.

Post Reply