Re: [gentoo-user] Strange partition on USB stick

2011-10-07 Thread Klaus Müller
Am 04.10.11 00:15, Mick wrote:
 I can't recall if I asked this before, but I am looking at a partition on a 
 USB stick which seems to have a FAT16 fs on it and in parted says:
 
 ==
 Model: Crucial Gizmo! overdrive (scsi)
 Disk /dev/sdb: 1023MB
 Sector size (logical/physical): 512B/512B
 Partition Table: loop
 
 Number  Start  End SizeFile system  Flags
  1  0.00B  1023MB  1023MB  fat16
 ==
 
 What does Partition Table: loop mean?
 

http://www.mail-archive.com/parted-devel@lists.alioth.debian.org/msg02423.html



Re: [gentoo-user] Strange partition on USB stick

2011-10-04 Thread Alan McKinnon
On Tue, 4 Oct 2011 00:27:50 -0500
Paul Hartman paul.hartman+gen...@gmail.com wrote:

 On Tue, Oct 4, 2011 at 12:18 AM, Mick michaelkintz...@gmail.com
 wrote:
  On Tuesday 04 Oct 2011 04:39:45 Adam Carter wrote:
  If the data is important, I'd use ddrescue to create an image of
  the drive, then run testdisk over that image to see if it can
  untangle the partition table mess. Both are in portage.
 
  Well, that's the thing:  I'm not sure that there is a mess.  At
  least not as far as parted is concerned, which can read the
  partition table properly.
 
  I suspect that fdisk (unlike parted) is not capable of reading the
  device correctly.
 
  I forgot to say that when mounted the USB stick shows not
  partitions (i.e. there is no sdb1, sdb2, etc.)  To access the fs I
  must do something like:
 
  pmount /dev/sdb
 
  and then all is lists under /media/sdb.  It is like a big floppy.
 
 I think that's your answer. The partition table looks funny because
 it isn't one. :) It is somewhat common. I've had some myself that are
 like that.
 

I have a 4G Sandisk that does that too. It does everything a regular
USB stick does except a) create a proper partition table and b) be
booted from

-- 
Alan McKinnnon
alan.mckin...@gmail.com



Re: [gentoo-user] Strange partition on USB stick

2011-10-04 Thread Mick
On Tuesday 04 Oct 2011 06:27:50 Paul Hartman wrote:
 On Tue, Oct 4, 2011 at 12:18 AM, Mick michaelkintz...@gmail.com wrote:
  On Tuesday 04 Oct 2011 04:39:45 Adam Carter wrote:
  If the data is important, I'd use ddrescue to create an image of the
  drive, then run testdisk over that image to see if it can untangle the
  partition table mess. Both are in portage.
  
  Well, that's the thing:  I'm not sure that there is a mess.  At least not
  as far as parted is concerned, which can read the partition table
  properly.
  
  I suspect that fdisk (unlike parted) is not capable of reading the device
  correctly.
  
  I forgot to say that when mounted the USB stick shows not partitions
  (i.e. there is no sdb1, sdb2, etc.)  To access the fs I must do
  something like:
  
  pmount /dev/sdb
  
  and then all is lists under /media/sdb.  It is like a big floppy.
 
 I think that's your answer. The partition table looks funny because
 it isn't one. :) It is somewhat common. I've had some myself that are
 like that.

If there isn't a partition table, then why fdisk sees /dev/sdb1-4 with 
somewhat strange ID types?
-- 
Regards,
Mick


signature.asc
Description: This is a digitally signed message part.


Re: [gentoo-user] Strange partition on USB stick

2011-10-04 Thread Mick
On Tuesday 04 Oct 2011 07:53:47 Alan McKinnon wrote:
 On Tue, 4 Oct 2011 00:27:50 -0500
 
 Paul Hartman paul.hartman+gen...@gmail.com wrote:
  On Tue, Oct 4, 2011 at 12:18 AM, Mick michaelkintz...@gmail.com
  
  wrote:
   On Tuesday 04 Oct 2011 04:39:45 Adam Carter wrote:
   If the data is important, I'd use ddrescue to create an image of
   the drive, then run testdisk over that image to see if it can
   untangle the partition table mess. Both are in portage.
   
   Well, that's the thing:  I'm not sure that there is a mess.  At
   least not as far as parted is concerned, which can read the
   partition table properly.
   
   I suspect that fdisk (unlike parted) is not capable of reading the
   device correctly.
   
   I forgot to say that when mounted the USB stick shows not
   partitions (i.e. there is no sdb1, sdb2, etc.)  To access the fs I
   must do something like:
   
   pmount /dev/sdb
   
   and then all is lists under /media/sdb.  It is like a big floppy.
  
  I think that's your answer. The partition table looks funny because
  it isn't one. :) It is somewhat common. I've had some myself that are
  like that.
 
 I have a 4G Sandisk that does that too. It does everything a regular
 USB stick does except a) create a proper partition table and b) be
 booted from

I guess what I'm asking is:

If there isn't a partition table, then why fdisk sees /dev/sdb1-4 with 
somewhat strange ID types?  What is it that it interprets as 4 partitions?
-- 
Regards,
Mick


signature.asc
Description: This is a digitally signed message part.


Re: [gentoo-user] Strange partition on USB stick

2011-10-04 Thread Paul Hartman
On Tue, Oct 4, 2011 at 1:58 AM, Mick michaelkintz...@gmail.com wrote:
 On Tuesday 04 Oct 2011 06:27:50 Paul Hartman wrote:
 On Tue, Oct 4, 2011 at 12:18 AM, Mick michaelkintz...@gmail.com wrote:
  On Tuesday 04 Oct 2011 04:39:45 Adam Carter wrote:
  If the data is important, I'd use ddrescue to create an image of the
  drive, then run testdisk over that image to see if it can untangle the
  partition table mess. Both are in portage.
 
  Well, that's the thing:  I'm not sure that there is a mess.  At least not
  as far as parted is concerned, which can read the partition table
  properly.
 
  I suspect that fdisk (unlike parted) is not capable of reading the device
  correctly.
 
  I forgot to say that when mounted the USB stick shows not partitions
  (i.e. there is no sdb1, sdb2, etc.)  To access the fs I must do
  something like:
 
  pmount /dev/sdb
 
  and then all is lists under /media/sdb.  It is like a big floppy.

 I think that's your answer. The partition table looks funny because
 it isn't one. :) It is somewhat common. I've had some myself that are
 like that.

 If there isn't a partition table, then why fdisk sees /dev/sdb1-4 with
 somewhat strange ID types?

It's misinterpreting the data that happens to be there because it
makes the assumption that it's a partition table even though it's not.

You can create a real partition table on that device and reformat, if
you want. (Note that some flash-based devices suffer degraded
performance if you repartition or reformat them because they come with
specially-aligned FAT tables from the factory)



Re: [gentoo-user] Strange partition on USB stick

2011-10-04 Thread Mick
On Tuesday 04 Oct 2011 17:18:18 Paul Hartman wrote:
 On Tue, Oct 4, 2011 at 1:58 AM, Mick michaelkintz...@gmail.com wrote:
  On Tuesday 04 Oct 2011 06:27:50 Paul Hartman wrote:
  On Tue, Oct 4, 2011 at 12:18 AM, Mick michaelkintz...@gmail.com wrote:
   On Tuesday 04 Oct 2011 04:39:45 Adam Carter wrote:
   If the data is important, I'd use ddrescue to create an image of the
   drive, then run testdisk over that image to see if it can untangle
   the partition table mess. Both are in portage.
   
   Well, that's the thing:  I'm not sure that there is a mess.  At least
   not as far as parted is concerned, which can read the partition table
   properly.
   
   I suspect that fdisk (unlike parted) is not capable of reading the
   device correctly.
   
   I forgot to say that when mounted the USB stick shows not partitions
   (i.e. there is no sdb1, sdb2, etc.)  To access the fs I must do
   something like:
   
   pmount /dev/sdb
   
   and then all is lists under /media/sdb.  It is like a big floppy.
  
  I think that's your answer. The partition table looks funny because
  it isn't one. :) It is somewhat common. I've had some myself that are
  like that.
  
  If there isn't a partition table, then why fdisk sees /dev/sdb1-4 with
  somewhat strange ID types?
 
 It's misinterpreting the data that happens to be there because it
 makes the assumption that it's a partition table even though it's not.
 
 You can create a real partition table on that device and reformat, if
 you want. (Note that some flash-based devices suffer degraded
 performance if you repartition or reformat them because they come with
 specially-aligned FAT tables from the factory)

Interesting!  I didn't know that.

I have repartitioned USB sticks in the past, but did not notice any change in 
performance - to be honest I didn't measure it.  I assume then that if I were 
to re-partition for any reason I would need to stick to exactly the same start 
 finish shown by parted.

Re-formatting it ought to be OK though, as long as the fat16 shown by parted 
is correct. 
-- 
Regards,
Mick


signature.asc
Description: This is a digitally signed message part.


Re: [gentoo-user] Strange partition on USB stick

2011-10-04 Thread Paul Hartman
On Tue, Oct 4, 2011 at 1:39 PM, Mick michaelkintz...@gmail.com wrote:
 On Tuesday 04 Oct 2011 17:18:18 Paul Hartman wrote:
 You can create a real partition table on that device and reformat, if
 you want. (Note that some flash-based devices suffer degraded
 performance if you repartition or reformat them because they come with
 specially-aligned FAT tables from the factory)

 Interesting!  I didn't know that.

 I have repartitioned USB sticks in the past, but did not notice any change in
 performance - to be honest I didn't measure it.  I assume then that if I were
 to re-partition for any reason I would need to stick to exactly the same start
  finish shown by parted.

 Re-formatting it ought to be OK though, as long as the fat16 shown by parted
 is correct.

I think filesystems other than FAT are aligned well already, assuming
your partitions are aligned, but with FAT there are some hoops you
must jump through.

There is a tool called flashbench that can test your drive
(destructively!) and figure out the most optimal block sizes. Here's a
great article about it and optimizing USB flash drives in general:
https://lwn.net/Articles/428584/

And here is a forum thread about figuring out the FAT alignment:
http://www.patriotmemory.com/forums/showthread.php?3696

The SD council makes a tool for MS Windows that optimally formats and
securely erases SD cards. Might be interesting to compare the results
of its format to a standard fdisk and mkfs.vfat in linux.

One thing I'm going to do next time I get a new SD card or flash drive
is take a snapshot of the boot sector/partition tables/FAT tables so
if I ever want to reformat it to FAT, I can restore the -- presumably
optimal -- factory layout.



Re: [gentoo-user] Strange partition on USB stick

2011-10-04 Thread Mick
On Tuesday 04 Oct 2011 20:36:06 Paul Hartman wrote:
 On Tue, Oct 4, 2011 at 1:39 PM, Mick michaelkintz...@gmail.com wrote:
  On Tuesday 04 Oct 2011 17:18:18 Paul Hartman wrote:
  You can create a real partition table on that device and reformat, if
  you want. (Note that some flash-based devices suffer degraded
  performance if you repartition or reformat them because they come with
  specially-aligned FAT tables from the factory)
  
  Interesting!  I didn't know that.
  
  I have repartitioned USB sticks in the past, but did not notice any
  change in performance - to be honest I didn't measure it.  I assume then
  that if I were to re-partition for any reason I would need to stick to
  exactly the same start  finish shown by parted.
  
  Re-formatting it ought to be OK though, as long as the fat16 shown by
  parted is correct.
 
 I think filesystems other than FAT are aligned well already, assuming
 your partitions are aligned, but with FAT there are some hoops you
 must jump through.
 
 There is a tool called flashbench that can test your drive
 (destructively!) and figure out the most optimal block sizes. Here's a
 great article about it and optimizing USB flash drives in general:
 https://lwn.net/Articles/428584/
 
 And here is a forum thread about figuring out the FAT alignment:
 http://www.patriotmemory.com/forums/showthread.php?3696
 
 The SD council makes a tool for MS Windows that optimally formats and
 securely erases SD cards. Might be interesting to compare the results
 of its format to a standard fdisk and mkfs.vfat in linux.
 
 One thing I'm going to do next time I get a new SD card or flash drive
 is take a snapshot of the boot sector/partition tables/FAT tables so
 if I ever want to reformat it to FAT, I can restore the -- presumably
 optimal -- factory layout.

Excellent find!  I've got some studying to do. 

Thanks for sharing.  :-)
-- 
Regards,
Mick


signature.asc
Description: This is a digitally signed message part.


Re: [gentoo-user] Strange partition on USB stick

2011-10-03 Thread Adam Carter
If the data is important, I'd use ddrescue to create an image of the
drive, then run testdisk over that image to see if it can untangle the
partition table mess. Both are in portage.



Re: [gentoo-user] Strange partition on USB stick

2011-10-03 Thread Mick
On Tuesday 04 Oct 2011 04:39:45 Adam Carter wrote:
 If the data is important, I'd use ddrescue to create an image of the
 drive, then run testdisk over that image to see if it can untangle the
 partition table mess. Both are in portage.

Well, that's the thing:  I'm not sure that there is a mess.  At least not as 
far as parted is concerned, which can read the partition table properly.  

I suspect that fdisk (unlike parted) is not capable of reading the device 
correctly.

I forgot to say that when mounted the USB stick shows not partitions (i.e. 
there is no sdb1, sdb2, etc.)  To access the fs I must do something like:

pmount /dev/sdb

and then all is lists under /media/sdb.  It is like a big floppy.
-- 
Regards,
Mick


signature.asc
Description: This is a digitally signed message part.


Re: [gentoo-user] Strange partition on USB stick

2011-10-03 Thread Paul Hartman
On Tue, Oct 4, 2011 at 12:18 AM, Mick michaelkintz...@gmail.com wrote:
 On Tuesday 04 Oct 2011 04:39:45 Adam Carter wrote:
 If the data is important, I'd use ddrescue to create an image of the
 drive, then run testdisk over that image to see if it can untangle the
 partition table mess. Both are in portage.

 Well, that's the thing:  I'm not sure that there is a mess.  At least not as
 far as parted is concerned, which can read the partition table properly.

 I suspect that fdisk (unlike parted) is not capable of reading the device
 correctly.

 I forgot to say that when mounted the USB stick shows not partitions (i.e.
 there is no sdb1, sdb2, etc.)  To access the fs I must do something like:

 pmount /dev/sdb

 and then all is lists under /media/sdb.  It is like a big floppy.

I think that's your answer. The partition table looks funny because
it isn't one. :) It is somewhat common. I've had some myself that are
like that.