Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Author Message
ikeinthaiOffline
15 Post subject: usbthumbdrive crashes partitionmanager (solved)  PostPosted: 18.01.2011, 09:44



Joined: 2010-09-22
Posts: 119
Location: bigannastybkk
Status: Offline
i was given a new apacer 4g thumbdrive as a gift. when i start either gparted or partitionmanager with this drive plugged in, they crash/fail to start:

      Code:
# gparted
======================
libparted : 2.3
======================
Backtrace has 16 calls on stack:
  16: /lib/libparted.so.0(ped_assert+0x2a) [0xb775ddba]
  15: /lib/libparted.so.0(+0x43ae7) [0xb7794ae7]
  14: /lib/libparted.so.0(+0x44907) [0xb7795907]
  13: /lib/libparted.so.0(+0x45bfc) [0xb7796bfc]
  12: /lib/libparted.so.0(+0x11631) [0xb7762631]
  11: /lib/libparted.so.0(ped_disk_add_partition+0x262) [0xb7765ec2]
  10: /lib/libparted.so.0(+0x47bb5) [0xb7798bb5]
  9: /lib/libparted.so.0(+0x47dbf) [0xb7798dbf]
  8: /lib/libparted.so.0(ped_disk_new+0x75) [0xb7766c95]
  7: /usr/sbin/gpartedbin() [0x8091e96]
  6: /usr/sbin/gpartedbin() [0x80a1bf5]
  5: /usr/sbin/gpartedbin() [0x80c30f2]
  4: /usr/lib/libglibmm-2.4.so.1(+0x320c2) [0xb6f3e0c2]
  3: /lib/libglib-2.0.so.0(+0x656cf) [0xb6dc86cf]
  2: /lib/i686/cmov/libpthread.so.0(+0x5955) [0xb6c15955]
  1: /lib/i686/cmov/libc.so.6(clone+0x5e) [0xb6b95e7e]
Assertion (head_size <= 63) at ../../../libparted/labels/dos.c:662 in function probe_partition_for_geom() failed.


      Code:
# partitionmanager
Backtrace has 17 calls on stack:
  17: /lib/libparted.so.0(ped_assert+0x2a) [0xb5f6edba]
  16: /lib/libparted.so.0(+0x43ae7) [0xb5fa5ae7]
  15: /lib/libparted.so.0(+0x44907) [0xb5fa6907]
  14: /lib/libparted.so.0(+0x45bfc) [0xb5fa7bfc]
  13: /lib/libparted.so.0(+0x11631) [0xb5f73631]
  12: /lib/libparted.so.0(ped_disk_add_partition+0x262) [0xb5f76ec2]
  11: /lib/libparted.so.0(+0x47bb5) [0xb5fa9bb5]
  10: /lib/libparted.so.0(+0x47dbf) [0xb5fa9dbf]
  9: /lib/libparted.so.0(ped_disk_new+0x75) [0xb5f77c95]
  8: /usr/lib/libpartitionmanagerprivate.so(+0x2712c) [0xb780b12c]
  7: /usr/lib/libpartitionmanagerprivate.so(_ZN22PartitionManagerWidget11scanDevicesEv+0x10c) [0xb785d2fc]
  6: /usr/lib/libpartitionmanagerprivate.so(_ZN22PartitionManagerWidget4initEP17KActionCollectionRK7QString+0x50) [0xb7861770]
  5: /usr/lib/libpartitionmanagerprivate.so(_ZN10MainWindow4initEv+0xe1) [0xb7869ac1]
  4: /usr/lib/libpartitionmanagerprivate.so(_ZN10MainWindowC1EP7QWidgetP17KActionCollection+0xeb) [0xb7869c9b]
  3: /usr/bin/partitionmanager-bin() [0x8048f79]
  2: /lib/i686/cmov/libc.so.6(__libc_start_main+0xe6) [0xb626cc76]
  1: /usr/bin/partitionmanager-bin() [0x8048d51]
KCrash: Application 'partitionmanager-bin' crashing...
sock_file=/root/.kde/socket-aptosidbox3/kdeinit4__0
Warning: connect() failed: : No such file or directory
KCrash cannot reach kdeinit, launching directly.
drkonqi(4082): Unable to find an internal debugger that can work with the KCrash backend


i'd like to use this drive, but it gives me the creeps that i can't format it.

any help appreciated.

thanks, ike

_________________
aptosid: magic in action, the point of the spear. bleedin pearls before swine? lets hope not. freesoftware/freedomsoftware=a chance at freedom. participants, engage your vehicle. . . avatar by zenren
 
 View user's profile Send private message Visit poster's website  
Reply with quote Back to top
devilOffline
Post subject: RE: usbthumbdrive crashes partitionmanager  PostPosted: 18.01.2011, 09:55



Joined: 2010-08-26
Posts: 491
Location: Berlin
Status: Offline
http://www.mail-archive.com/bug-parted@ ... 03216.html

greetz
devil
 
 View user's profile Send private message  
Reply with quote Back to top
finottiOffline
Post subject: RE: usbthumbdrive crashes partitionmanager  PostPosted: 18.01.2011, 11:59



Joined: 2010-09-12
Posts: 293

Status: Offline
This is similar to the problem I had... http://www.aptosid.com/index.php?name=PNphpBB2&file=viewtopic&t=505. For me it worked all of a sudden with no apparent reason for the change...
 
 View user's profile Send private message  
Reply with quote Back to top
ikeinthaiOffline
Post subject: fdisk? how to proceed.  PostPosted: 19.01.2011, 06:55



Joined: 2010-09-22
Posts: 119
Location: bigannastybkk
Status: Offline
thank you devil and finotti for your replies.

devil's tells me forget gparted.

cfdisk gives me:
      Code:
FATAL ERROR: Bad primary partition 0: Partition ends in the final partial cylinder     
                               Press any key to exit cfdisk


from links piper provided in finotti's post i got this:
      Quote:
"Manipulating these table values manually is extremely high risk. If Linux and Windows are all able to read the partition table and write to their partitions, you are probably fine."


and this:
      Quote:
"fdisk: Partition 1 does not start on cylinder boundary

The version of fdisk that comes with many Linux systems creates
partitions that fail its own validity checking. Unfortunately, if
you've already installed your system, there's not much you can do
about this, apart from copying the data off the partition, deleting
and remaking it, and copying the data back.

You can avoid the problem by getting the latest version of fdisk, from
Rik Faith's util-linux package (available on all the usual FTP sites).
Alternatively, if you are creating a new partition 1 that starts in
the first cylinder, you can do the following to get a partition that
fdisk likes.

* Create partition 1 in the normal way. A `p' listing will produce
the mismatch complaint.
* Type u to set sector mode and do p again. Copy down the number
from the End column.
* Delete partition 1.
* While still in sector mode, re-create partition 1. Set the first
sector to match the number of sectors per track. This is the
sector number in the first line of the p output. Set the last
sector to the value you wrote down in the step above.
* Type u to reset cylinder mode and continue with other partitions.

Ignore the message about unallocated sectors. They refer to the
sectors on the first track apart from the Master Boot Record, and they
are not used if you start the first partition in track 2."


fdisk -lu:

      Code:
Disk /dev/sdc: 4009 MB, 4009754624 bytes
23 heads, 23 sectors/track, 14804 cylinders, total 7831552 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0xc3072e18

   Device Boot      Start         End      Blocks   Id  System
/dev/sdc1            8064     7831551     3911744    c  W95 FAT32 (LBA)


what i want to do is delete everything, make 2g fat32 and 2g ext2.

how would i proceed? any help appreciated.
thanks, ike.

_________________
aptosid: magic in action, the point of the spear. bleedin pearls before swine? lets hope not. freesoftware/freedomsoftware=a chance at freedom. participants, engage your vehicle. . . avatar by zenren
 
 View user's profile Send private message Visit poster's website  
Reply with quote Back to top
diblOffline
Post subject:   PostPosted: 19.01.2011, 15:19



Joined: 2010-09-12
Posts: 302
Location: Dayton, Ohio, USA
Status: Offline
Ike I've been playing with partitioning SSDs lately, so I think I have this right (understanding that there are really no such "heads" and "cylinders" on a solid state device):

512 bytes is a sector, 2 sectors make 1KB, so 2,048 sectors make 1MB. You have 7,831,552 sectors, so you really have (7,831,552 / 2048) = 3,824MB, according to my calculator. If you want to split the stick 50/50 between the two partitions, then you will want about 3,915,776 sectors in each partition. The trick is to get the partitions to start on whole cylinder boundaries.

According to your fdisk ouput, each cylinder is (512 bytes * 23 tracks) * 23 heads = 270,848 bytes / 1024 = 264.5KB. As first mentioned, 2 sectors makes 1KB, so 264.5KB (1 cylinder) must be (264.5 * 2) = 529 sectors. You want your partitions to begin on whole cylinders, i.e. at the cylinder boundary. So the sector number for the start of each partition needs to be a sector number that is evenly divisible by 529.

You can't begin a partition at sector #1/cylinder 1, so start the first partition at cylinder #2, which is sector (529 * 2) = 1058. Add 3,915,776 (half of your sectors) to that, and you can see you want the second partition to start at about sector #3,916,834. However, to start it on a cylinder boundary, you need a sector that divides evenly by 529. My calculator says that if you back up to sector 3,916,716, you'll be at a cylinder boundary (529 * 7404). So start your second partition there (i.e. the ending sector for the first partition is #3,916,715, and the ending cylinder is 7403), and you will end up with your USB stick split into two almost equal partitions, which you can format with GParted.

I hope that is helpful.


Last edited by dibl on 19.01.2011, 19:35; edited 1 time in total
 
 View user's profile Send private message Visit poster's website  
Reply with quote Back to top
devilOffline
Post subject:   PostPosted: 19.01.2011, 15:52



Joined: 2010-08-26
Posts: 491
Location: Berlin
Status: Offline
if that does not help, try formatting it under windows. (as that is what it was originaly partitioned with) i have seen really funny sticks these last years with all kinds off 'extras' and goodies' on the first (hidden) partition. some of those behaved similar to yours. you could probably also use dd to blank it. then it can be partitioned with any linux tool.

greetz
devil
 
 View user's profile Send private message  
Reply with quote Back to top
slamOffline
Post subject:   PostPosted: 19.01.2011, 20:45
Team Member


Joined: 1970-01-01
Posts: 607
Location: w3
Status: Offline
There is never ever a need to use Windows - simply completely clean with:
      Code:
dd if=/dev/zero of=/dev/sdX bs=1 count=512

(Replace X with the fitting value). After that, you are free to partition and format with Linux tools.
Greetings,
Chris

_________________
an operating system must operate
development is life
my Debian repo
 
 View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger MSN Messenger ICQ Number 
Reply with quote Back to top
dptOffline
Post subject:   PostPosted: 20.01.2011, 11:20



Joined: 2010-09-11
Posts: 281
Location: New Delhi
Status: Offline
      dibl wrote:
Ike I've been playing with partitioning SSDs lately, so I think I have this right (understanding that there are really no such "heads" and "cylinders" on a solid state device):

512 bytes is a sector, 2 sectors make 1KB, so 2,048 sectors make 1MB. You have 7,831,552 sectors, so you really have (7,831,552 / 2048) = 3,824MB, according to my calculator. If you want to split the stick 50/50 between the two partitions, then you will want about 3,915,776 sectors in each partition. The trick is to get the partitions to start on whole cylinder boundaries.

According to your fdisk ouput, each cylinder is (512 bytes * 23 tracks) * 23 heads = 270,848 bytes / 1024 = 264.5KB. As first mentioned, 2 sectors makes 1KB, so 264.5KB (1 cylinder) must be (264.5 * 2) = 529 sectors. You want your partitions to begin on whole cylinders, i.e. at the cylinder boundary. So the sector number for the start of each partition needs to be a sector number that is evenly divisible by 529.

You can't begin a partition at sector #1/cylinder 1, so start the first partition at cylinder #2, which is sector (529 * 2) = 1058. Add 3,915,776 (half of your sectors) to that, and you can see you want the second partition to start at about sector #3,916,834. However, to start it on a cylinder boundary, you need a sector that divides evenly by 529. My calculator says that if you back up to sector 3,916,716, you'll be at a cylinder boundary (529 * 7404). So start your second partition there (i.e. the ending sector for the first partition is #3,916,715, and the ending cylinder is 7403), and you will end up with your USB stick split into two almost equal partitions, which you can format with GParted.

I hope that is helpful.


Love to see the language I use at times, mostly mentally for myself.

_________________
In a lunatic asylum, everyone thinks that he is the doctor.
 
 View user's profile Send private message AIM Address  
Reply with quote Back to top
ikeinthaiOffline
Post subject: dirty sticks.  PostPosted: 21.01.2011, 05:29



Joined: 2010-09-22
Posts: 119
Location: bigannastybkk
Status: Offline
thank you dibl for the detailed explanation. i'm still wrapping my old head around how disks are actually laid out, and working my way through what you wrote helps a lot.

      devil wrote:
i have seen really funny sticks these last years with all kinds off 'extras' and goodies' on the first (hidden) partition.

greetz
devil


this is exactly what was on my mind. I DON'T WANT THEIR HIDDEN GOODIES. if i wanted hidden goodies i'd do without condoms.

thank you slam for the command to nuke the hidden goodies, and start clean an fresh an virginal as newfallen snow.

gparted has always worked so well for me i never needed anything else, but having the ability to do it at the command line level does seem preferable.

thank you again, all.

ike.

_________________
aptosid: magic in action, the point of the spear. bleedin pearls before swine? lets hope not. freesoftware/freedomsoftware=a chance at freedom. participants, engage your vehicle. . . avatar by zenren
 
 View user's profile Send private message Visit poster's website  
Reply with quote Back to top
ikeinthaiOffline
Post subject: herr doktors, is my stick clean?  PostPosted: 24.01.2011, 13:34



Joined: 2010-09-22
Posts: 119
Location: bigannastybkk
Status: Offline
apologies for being slow to mark this solved.

slam's command worked so quickly i didn't think it had taken, and i tried running it several times with the drive both mounted and unmounted.

after slamnuke i ended up just formatting the whole thing to fat32, but i am taking comfort in the fact that i was able to format it easily with gparted.

fdisk -l gives me:
      Code:
Disk /dev/sdc: 4009 MB, 4009754624 bytes
126 heads, 22 sectors/track, 2825 cylinders
Units = cylinders of 2772 * 512 = 1419264 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x0009ea1d

   Device Boot      Start         End      Blocks   Id  System
/dev/sdc1   *           1        2826     3914752    b  W95 FAT32


is it possible that some firmware crappola was able to hide anywhere? or is my stick really and truly clean of hidden "goodies"/surprises?

thank you for expert consults, ike

_________________
aptosid: magic in action, the point of the spear. bleedin pearls before swine? lets hope not. freesoftware/freedomsoftware=a chance at freedom. participants, engage your vehicle. . . avatar by zenren
 
 View user's profile Send private message Visit poster's website  
Reply with quote Back to top
diblOffline
Post subject: Re: herr doktors, is my stick clean?  PostPosted: 24.01.2011, 20:48



Joined: 2010-09-12
Posts: 302
Location: Dayton, Ohio, USA
Status: Offline
      ikeinthai wrote:


is it possible that some firmware crappola was able to hide anywhere? or is my stick really and truly clean of hidden "goodies"/surprises?



I have 5 Sandisk USB sticks, different ages, all different models. Four of them were "slamnuked" with dd and came out with no residual goodies. The fifth one still has that hidden "U3" faux CD ROM, even after multiple dd applications. So ....

But it works fine on Linux -- I never think about it except if I ever put it in a Windows box.
 
 View user's profile Send private message Visit poster's website  
Reply with quote Back to top
DeepDayzeOffline
Post subject: RE: Re: herr doktors, is my stick clean?  PostPosted: 25.01.2011, 00:48



Joined: 2010-09-11
Posts: 616
Location: USA
Status: Offline
A good reason not to use U3 sticks...look for ones that aren't U3 so it's easy to blast away any garbage hidden on them
 
 View user's profile Send private message  
Reply with quote Back to top
slamOffline
Post subject: RE: Re: herr doktors, is my stick clean?  PostPosted: 25.01.2011, 07:39
Team Member


Joined: 1970-01-01
Posts: 607
Location: w3
Status: Offline
Some of these "U3" sticks can be trained to work as intended via usb-modeswitch, but as a general rule I would avoid them. Side effect: You will pay less for the same hardware, as the extra price comes from the "extra features" (mostly closed source Windows encryption or backup software).
Greetings,
Chris

_________________
an operating system must operate
development is life
my Debian repo
 
 View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger MSN Messenger ICQ Number 
Reply with quote Back to top
ikeinthaiOffline
Post subject: satan's spawn.  PostPosted: 27.01.2011, 09:42



Joined: 2010-09-22
Posts: 119
Location: bigannastybkk
Status: Offline
from wikipedia:
      Quote:
U3 was a company producing a proprietary method of launching Windows applications from special USB flash drives. Flash drives adhering to the U3 specification are termed "U3 smart drives". U3 smart drives come preinstalled with the U3 Launchpad, which looks similar to the Windows OS start menu and controls program installation. Applications that comply with U3 specifications are allowed to write files or registry information to the host computer, but they must remove this information when the flash drive is ejected. Customizations and settings are instead stored with the application on the flash drive.
Microsoft and SanDisk created a successor called StartKey.
SanDisk report the following on its website "The U3 technology has reached end of life. SanDisk began phasing out support for U3 Technology in late 2009." [1]


sounds like satan's own spawn to me. and even the pimpers don't want this ol whore anymore.

thanks for all the help 8D

_________________
aptosid: magic in action, the point of the spear. bleedin pearls before swine? lets hope not. freesoftware/freedomsoftware=a chance at freedom. participants, engage your vehicle. . . avatar by zenren
 
 View user's profile Send private message Visit poster's website  
Reply with quote Back to top
Display posts from previous:     
Jump to:  
All times are GMT - 12 Hours
Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Powered by Zafenio