If you are getting the following error while trying to change the default fat32 partition on a new drive to another linux partition type, I might have the answer for you.

This is the error that you keep getting:

WARNING: Re-reading the partition table failed with error 22: Invalid argument.
The kernel still uses the old table.
The new table will be used at the next reboot.
Syncing disks.

Here’s the way to fix it, noting that this will wipe your drive. Start up fdisk for the appropriate drive (may not be /dev/sde for you)

fdisk /dev/sde

Then use the “o” option, which according to the menu is:

   o   create a new empty DOS partition table

Now write the changes to disk with “w”, and then open up fdisk again. Now you can create your partition.

Don’t forget to actually create the filesystem for your new partition, which can be done with “mkfs”. You can also use the shortcut method like this:

mkfs.reiserfs /dev/sde1

The nice thing is that the shortcut is easy to type with command line completion.

Profile Photo for Lowell Heddings Lowell Heddings
Lowell is the founder and CEO of How-To Geek. Heโ€™s been running the show since creating the site back in 2006. Over the last decade, Lowell has personally written more than 1000 articles which have been viewed by over 250 million people. Prior to starting How-To Geek, Lowell spent 15 years working in IT doing consulting, cybersecurity, database management, and programming work.
Read Full Bio ยป

The above article may contain affiliate links, which help support How-To Geek.