Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

formatting USB thumbdrive under linux - Error re-reading the partition table failed with error 22:

Posted on 2007-11-26
11
Medium Priority
?
5,010 Views
Last Modified: 2013-12-16
Linux - Redhat Fedora
Thumb Drive - Sandisk 4GB micro
Error: 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.

Steps:
fdisk -l  (shows thumbdrive as /dev/sdb1)
Created 3 partitions - Part 1 = 50M, Part 2 = 512MB, Part 3 = 3.456GB
fdisk /dev/sdb1  (/dev/sdb1 boot=*, start=1, end = 7965, blocks=4013865, ID=6, system=W95 fat32)
n [enter], P [enter], 1 [enter], [enter], +50M [enter], n [enter], p [enter], 2 [enter], [enter] (default =14), +512M [enter], n [enter], p [enter],  3 [enter] (default 42),  [enter] (last cyl - 1019), A, 1, t, 2 , 82, p, w
After I press p - it prints the following configuration:
/dev/sdb1p1 boot *, start = 1, end = 13, blocks = 51150, ID = 83, Linux
 /dev/sdb1p2 boot , start = 14, end = 141, blocks = 503936, ID = 82, Linux  swap / solaris
/dev/sdb1p3 boot , start = 142, end = 1019, blocks = 3456686, ID = 83, Linux

After I press w - to write to the partitioh it gives me the error:
Error: 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.

When I reboot and try to format I get the following error: The device apparently does not exist ...
mkfs.ext3 /dev/sda1p1 (gives the above error)
mkfs.ext3 /dev/sda1 - seems to work, but I can't access the individual partitions.
also, if I do an fdisk -l it still shows the drive as w95 fat 32. What am I doing wrong.
0
Comment
Question by:auditnet22
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
11 Comments
 
LVL 88

Expert Comment

by:rindi
ID: 20352433
Try fdisk again to delete the partitions then reboot.
0
 

Author Comment

by:auditnet22
ID: 20352550
Thanks for the quick response rindi. I tried deleting the partition twice and rebooting.
I can't seem to format the following partitions, and everytime I try to repartition the usb thumb drive, I get the error 22. I reboot after the error since I want the tables to be updated.


dev/sdb1p1 boot *, start = 1, end = 13, blocks = 51150, ID = 83, Linux
 /dev/sdb1p2 boot , start = 14, end = 141, blocks = 503936, ID = 82, Linux  swap / solaris
/dev/sdb1p3 boot , start = 142, end = 1019, blocks = 3456686, ID = 83, Linux
0
 
LVL 35

Expert Comment

by:Duncan Roe
ID: 20352849
Error 22 is EINVAL (Invalid argument). What do you see if you try "fdisk /dev/sdb"?
0
Migrating Your Company's PCs

To keep pace with competitors, businesses must keep employees productive, and that means providing them with the latest technology. This document provides the tips and tricks you need to help you migrate an outdated PC fleet to new desktops, laptops, and tablets.

 
LVL 88

Accepted Solution

by:
rindi earned 500 total points
ID: 20354029
Is a GUI setup on that PC? If yes, have you tried using GParted or QtParted to delete the partitions?
0
 
LVL 3

Expert Comment

by:amirs80
ID: 20356066
if u have windows xp system, attach your thumb drive on that and then try to format it and then again use it on linux
0
 

Author Comment

by:auditnet22
ID: 20362849
I humbly thank you guys for all of your help. I don't know much about linux.
One other question. If I boot from a linux livecd, what is the CD designation. Is it /boot ?
0
 
LVL 88

Expert Comment

by:rindi
ID: 20363756
No. It'll look just as if you have booted from HD. /boot is just the folder where the kernel and boot loader normally is. The CD is often mounted on /cdrom.
0
 

Author Comment

by:auditnet22
ID: 20367797
Thank you all for your help. Rindi, I was able to download a livecd with Gparted, deleted the partitions and recreated them via gparted. My partitions finally took. It took me 2 days to fix, but it would have taken me a lot longer without your help.

Have a great day!
0
 
LVL 88

Expert Comment

by:rindi
ID: 20367881
your welcome
0
 
LVL 3

Expert Comment

by:Luqman Shantal
ID: 20857252
You can also use the text based parted since it's already available out of the box.
0
 

Expert Comment

by:Alphawolve
ID: 25619065
What was the solution?
0

Featured Post

The Eight Noble Truths of Backup and Recovery

How can IT departments tackle the challenges of a Big Data world? This white paper provides a roadmap to success and helps companies ensure that all their data is safe and secure, no matter if it resides on-premise with physical or virtual machines or in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The purpose of this article is to demonstrate how we can use conditional statements using Python.
It’s 2016. Password authentication should be dead — or at least close to dying. But, unfortunately, it has not traversed Quagga stage yet. Using password authentication is like laundering hotel guest linens with a washboard — it’s Passé.
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
Suggested Courses

715 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question