f



WARNING: Re-reading the partition table failed with error 16: Device or resource busy.

just bought a new 1TB WD Elements external disk.

the factory default fs is vfat and for obvious reasons I wanted to
format it to ext3 (leaving a 15GB fat partition for emergency).
I proceeded the following way:
- 'sudo fdisk /dev/sdc'
- 'd' to delete the only partition
- 'n' to create the two partitions mentioned above
- 'w' to write the changes to disk
and here I got the problem, this is the message:
--------------------------------------------------------------------------------------
Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.

WARNING: Re-reading the partition table failed with error 16: Device
or resource busy.
The kernel still uses the old table.
The new table will be used at the next reboot.
Syncing disks.
--------------------------------------------------------------------------------------
if I commit the 'w' command with the disk unmounted: he immediately
says "Calling ioctl()..." and then before saying "warning..." he
mounts the device.

anyway, if I call the 'p' command in fdisk I get the new partition
table:
-----------------------------------------------------------------------
   Device Boot      Start         End      Blocks   Id  System
/dev/sdc1               1      120000   963899968+  83  Linux
/dev/sdc2          120001      121601    12860032+   c  W95 FAT32
(LBA)
-----------------------------------------------------------------------

but if I explore the disk it's the same as before (default data in the
disk is still there and I can read and write)...also after reboot.

What has happened?is this normal and can I proceed formatting the two
partitions? or is there any risk to damage something?

thanks.

Christian
0
fuser
8/16/2009 8:26:29 AM
comp.os.linux.setup 9104 articles. 1 followers. Post Follow

4 Replies
3276 Views

Similar Articles

[PageSpeed] 8

fuser wrote:
> 
> [snip]
> 
> I proceeded the following way:
> - 'sudo fdisk /dev/sdc'
> - 'd' to delete the only partition
> - 'n' to create the two partitions mentioned above
> - 'w' to write the changes to disk
> and here I got the problem, this is the message:
> --------------------------------------------------------------------------------------
> Command (m for help): w
> The partition table has been altered!
> 
> Calling ioctl() to re-read partition table.
> 
> WARNING: Re-reading the partition table failed with error 16: Device
> or resource busy.
> The kernel still uses the old table.
> The new table will be used at the next reboot.
> Syncing disks.
> --------------------------------------------------------------------------------------
> if I commit the 'w' command with the disk unmounted: he immediately
> says "Calling ioctl()..." and then before saying "warning..." he
> mounts the device.

So you're saying the you did the operations without mounted partitions 
on the new disk?  Or are you saying hypothetically, based on other disks 
you've partitioned, that that's what you expect?

> anyway, if I call the 'p' command in fdisk I get the new partition
> table:
> 
> [snip]
> 
> but if I explore the disk it's the same as before (default data in the
> disk is still there and I can read and write)...also after reboot.

So to summarize what you appear to have said, with several contradictions:

1. You didn't have any mounted partitions.
2. You repartitoned the drive and committed.
3. The OS magically mounted to old, previously unmounted partitions,
    although you show the output of the format command, which doesn't say
    anything of the kind.
4. You rebooted.
5. fdisk lists the new partitions, but mounting the first partition
    results in accessing the previous filesystem (vfat)

> What has happened?is this normal and can I proceed formatting the two
> partitions? or is there any risk to damage something?

First:
I doubt that you didn't have mounted partitions.  I think you did. 
However, at this point, it doesn't matter, but I'll explain, anyway.

The kernel had an in-memory copy of the partition table.  Because there 
was a mounted partition when you changed the copy on disk, fdisk was 
just letting you know that the in-memory copy hadn't changed.

Because you had the vfat partition mounted when you ran fdisk, the 
kernel still considered it mounted when you exited fdisk.  It didn't 
magically mount upon exiting fdisk.  You mounted it before you ran fdisk 
and left it mounted.

For future reference, if you have partprobe (part of parted), you can 
use it to force the kernel to update its in-memory copy of the partition 
table under most conditions, doing away with the need to reboot.  Think 
very carefully before using force, though.  Force is rarely a cure for 
lack of knowledge.

Since you rebooted, none of that matters, like I said.  The explanation 
above was just for general education.

Second:
vfat puts all its filesystem information at the start of the partition. 
  Since you haven't touched any of the data, most (if not all) of the 
old filesystem info is still there.  Since the new first partition 
starts at the same place as the old, single partition, you can access 
whatever old data existed within the new partition boundaries.  In your 
case, that's most of the old partition.

Bottom line:
Since you rebooted and since fdisk shows the new partition table, format 
the new *unmounted* partitions to your heart's content.  Nothing will be 
damaged as long as they're not mounted.  Make sure they're unmounted, 
though.  Like, really unmounted.  All the way unmounted.
0
Allen
8/16/2009 9:25:10 AM
On Sun, 16 Aug 2009 01:26:29 -0700 (PDT), fuser <rader@inwind.it> wrote:

>just bought a new 1TB WD Elements external disk.
>
>the factory default fs is vfat and for obvious reasons I wanted to
>format it to ext3 (leaving a 15GB fat partition for emergency).
>I proceeded the following way:
>- 'sudo fdisk /dev/sdc'
>- 'd' to delete the only partition
>- 'n' to create the two partitions mentioned above
>- 'w' to write the changes to disk
>and here I got the problem, this is the message:
>--------------------------------------------------------------------------------------
>Command (m for help): w
>The partition table has been altered!
>
>Calling ioctl() to re-read partition table.
>
>WARNING: Re-reading the partition table failed with error 16: Device
>or resource busy.
>The kernel still uses the old table.
>The new table will be used at the next reboot.
>Syncing disks.
>--------------------------------------------------------------------------------------
>if I commit the 'w' command with the disk unmounted: he immediately
>says "Calling ioctl()..." and then before saying "warning..." he
>mounts the device.
>
>anyway, if I call the 'p' command in fdisk I get the new partition
>table:
>-----------------------------------------------------------------------
>   Device Boot      Start         End      Blocks   Id  System
>/dev/sdc1               1      120000   963899968+  83  Linux
>/dev/sdc2          120001      121601    12860032+   c  W95 FAT32
>(LBA)
>-----------------------------------------------------------------------
>
>but if I explore the disk it's the same as before (default data in the
>disk is still there and I can read and write)...also after reboot.
>
>What has happened?is this normal and can I proceed formatting the two
>partitions? or is there any risk to damage something?

This is normal, reboot the machine before formatting the new partitions.

Grant.
-- 
http://bugsplatter.id.au
0
Grant
8/16/2009 9:28:27 AM
Thanks to everybody.

I formatted the two partition. everything is fine now excluding label
in the fat partition.
is mtools the only way to change label of a fat partition?

another little question: I googled for permission issues with ext3
partitions and found out that the solution is calling 'sudo chown -R
username /dev/sdc'. I tried this but nothing has changed; to have
write permission to my ext3 partition I had to call also 'sudo chown -
R user /media/Elements'. Is this last command enough to do the trick
or is it necessary to change owner to both the device and the mount
point?


thanks again
Christian
0
fuser
8/18/2009 1:56:29 PM
On Tue, 18 Aug 2009 09:56:29 -0400, fuser <rader@inwind.it> wrote:

> Thanks to everybody.
>
> I formatted the two partition. everything is fine now excluding label
> in the fat partition.
> is mtools the only way to change label of a fat partition?

Currently, yes.  See
https://qa.mandriva.com/show_bug.cgi?id=52853

> username /dev/sdc'. I tried this but nothing has changed; to have
> write permission to my ext3 partition I had to call also 'sudo chown -

Add the options noauto,users to the entry in /etc/fstab, and then
mount the filesystem as a regular user.

Regards, Dave Hodgins

-- 
Change nomail.afraid.org to ody.ca to reply by email.
(nomail.afraid.org has been set up specifically for
use in usenet. Feel free to use it yourself.)
0
David
8/19/2009 1:02:41 AM
Reply: