[parted-devel] freaky loop device handling

Joel Granados jgranado at redhat.com
Mon May 11 11:27:13 UTC 2009


Hey list.

Here is another freaky parted bug from the realms of parted code :)
I just ran into this and my analysis might be wrong, so suggestions and
corrections are appreciated.
Unfortunately this does not work with loop devices...

<snip>
#!/bin/bash
parted="/usr/local/sbin/parted"
dd if=/dev/zero of=/dev/sdc bs=1M count=10
yes | mkfs.ext3 /dev/sdc
$parted /dev/sdc print free
</snip>

And this is the output....
<snip>
[root at parted ~]# /home/parted/Misc/loopscript 
10+0 records in
10+0 records out
10485760 bytes (10 MB) copied, 4.5149 s, 2.3 MB/s
mke2fs 1.41.4 (27-Jan-2009)
/dev/sdc is entire device, not just one partition!
Proceed anyway? (y,n) Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
125184 inodes, 500736 blocks
25036 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=515899392
16 block groups
32768 blocks per group, 32768 fragments per group
7824 inodes per group
Superblock backups stored on blocks: 
32768, 98304, 163840, 229376, 294912

Writing inode tables: done                            
Creating journal (8192 blocks): done
Writing superblocks and filesystem accounting information: done

This filesystem will be automatically checked every 20 mounts or
180 days, whichever comes first.  Use tune2fs -c or -i to
override.
Model: JetFlash TS2GJFV30 (scsi)
Disk /dev/sdc: 2051MB
Sector size (logical/physical): 512B/512B
Partition Table: loop

Number  Start  End     Size    File system  Flags
 1      0.00B  2051MB  2051MB  ext3

[root at parted ~]# 
</snip>


Notice the last part of the output where parted thinks that this has a
loopback label.  I realize that this might have a purpose, unfortunately
I don't see it, can someone pls enlighten me!!


More information about the parted-devel mailing list