Announcement

Collapse
No announcement yet.

format USB drive trouble

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    format USB drive trouble

    Hi all,

    I've been trying to format my flash drive, but I cannot get fdisk to write to the drive without it complaining about "error 22 invalid argument"

    Code:
    root@dv8000:/media# df
    Filesystem      1K-blocks   Used Available Use% Mounted on
    /dev/hda3       39774220 11296968 26472744 30% /
    varrun         1031000    152  1030848  1% /var/run
    varlock        1031000     0  1031000  0% /var/lock
    udev          1031000    64  1030936  1% /dev
    devshm         1031000     0  1031000  0% /dev/shm
    lrm          1031000   45040  985960  5% /lib/modules/2.6.24-19-generic/volatile
    /dev/sda1        985380   1288  934432  1% /media/disk
    root@dv8000:/media# /sbin/fdisk /dev/sda1
    
    Command (m for help): p
    
    Disk /dev/sda1: 1017 MB, 1017101312 bytes
    32 heads, 61 sectors/track, 1017 cylinders
    Units = cylinders of 1952 * 512 = 999424 bytes
    Disk identifier: 0x00000000
    
       Device Boot   Start     End   Blocks  Id System
    /dev/sda1p1        1    1017   992561+ 83 Linux
    
    Command (m for help): d
    Selected partition 1
    
    Command (m for help): 1
    1: unknown command
    Command action
      a  toggle a bootable flag
      b  edit bsd disklabel
      c  toggle the dos compatibility flag
      d  delete a partition
      l  list known partition types
      m  print this menu
      n  add a new partition
      o  create a new empty DOS partition table
      p  print the partition table
      q  quit without saving changes
      s  create a new empty Sun disklabel
      t  change a partition's system id
      u  change display/entry units
      v  verify the partition table
      w  write table to disk and exit
      x  extra functionality (experts only)
    
    Command (m for help): n
    Command action
      e  extended
      p  primary partition (1-4)
    p
    Partition number (1-4): 1
    First cylinder (1-1017, default 1):
    Using default value 1
    Last cylinder or +size or +sizeM or +sizeK (1-1017, default 1017):
    Using default value 1017
    
    Command (m for help): t
    Selected partition 1
    Hex code (type L to list codes): 83
    
    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 22: Invalid argument.
    The kernel still uses the old table.
    The new table will be used at the next reboot.
    Syncing disks.
    root@dv8000:/media#


    #2
    Re: format USB drive trouble

    Use GParted Live CD

    GParted: http://gparted.sourceforge.net/
    An intellectual says a simple thing in a hard way. An artist says a hard thing in a simple way. Charles Bukowski

    Comment


      #3
      Re: format USB drive trouble

      I used
      Code:
      apt-get install gparted
      After running the partition editor it ID it as lock fat32 and wont let me change it. When I went back to try it through konsole it only created a small partition

      Code:
      root@dv8000:~# cd /media
      root@dv8000:/media# df -k
      Filesystem      1K-blocks   Used Available Use% Mounted on
      /dev/hda3       39774220 11309444 26460268 30% /
      varrun         1031000    152  1030848  1% /var/run
      varlock        1031000     0  1031000  0% /var/lock
      udev          1031000    64  1030936  1% /dev
      devshm         1031000     0  1031000  0% /dev/shm
      lrm          1031000   45040  985960  5% /lib/modules/2.6.24-19-generic/volatile
      /dev/sda1        986020     4  986016  1% /media/disk
      root@dv8000:/media# /sbin/fdisk /dev/sda1
      
      Command (m for help): p
      
      Disk /dev/sda1: 1011 MB, 1011677184 bytes
      255 heads, 63 sectors/track, 122 cylinders
      Units = cylinders of 16065 * 512 = 8225280 bytes
      Disk identifier: 0x6f20736b
      
      This doesn't look like a partition table
      Probably you selected the wrong device.
      
         Device Boot   Start     End   Blocks  Id System
      /dev/sda1p1  ?    48437   119493  570754815+ 72 Unknown
      Partition 1 has different physical/logical beginnings (non-Linux?):
         phys=(357, 116, 40) logical=(48436, 183, 40)
      Partition 1 has different physical/logical endings:
         phys=(357, 32, 45) logical=(119492, 104, 7)
      Partition 1 does not end on cylinder boundary.
      /dev/sda1p2  ?    10501   131013  968014120  65 Novell Netware 386
      Partition 2 has different physical/logical beginnings (non-Linux?):
         phys=(288, 115, 43) logical=(10500, 111, 30)
      Partition 2 has different physical/logical endings:
         phys=(367, 114, 50) logical=(131012, 158, 28)
      Partition 2 does not end on cylinder boundary.
      /dev/sda1p3  ?   116395   236907  968014096  79 Unknown
      Partition 3 has different physical/logical beginnings (non-Linux?):
         phys=(366, 32, 33) logical=(116394, 188, 12)
      Partition 3 has different physical/logical endings:
         phys=(357, 32, 43) logical=(236906, 234, 25)
      Partition 3 does not end on cylinder boundary.
      /dev/sda1p4  ?   179626   179629    27749+  d Unknown
      Partition 4 has different physical/logical beginnings (non-Linux?):
         phys=(372, 97, 50) logical=(179625, 87, 47)
      Partition 4 has different physical/logical endings:
         phys=(0, 10, 0) logical=(179628, 203, 42)
      Partition 4 does not end on cylinder boundary.
      
      Partition table entries are not in disk order
      
      Command (m for help): d
      Partition number (1-4): 1
      
      Command (m for help): d
      Partition number (1-4): 2
      
      Command (m for help): d
      Partition number (1-4): 3
      
      Command (m for help): d
      Selected partition 4
      
      Command (m for help): p
      
      Disk /dev/sda1: 1011 MB, 1011677184 bytes
      255 heads, 63 sectors/track, 122 cylinders
      Units = cylinders of 16065 * 512 = 8225280 bytes
      Disk identifier: 0x6f20736b
      
         Device Boot   Start     End   Blocks  Id System
      
      Command (m for help): n
      Command action
        e  extended
        p  primary partition (1-4)
      p
      Partition number (1-4): 1
      First cylinder (1-122, default 1):
      Using default value 1
      Last cylinder or +size or +sizeM or +sizeK (1-122, default 122):
      Using default value 122
      
      Command (m for help): t
      Selected partition 1
      Hex code (type L to list codes): 83
      
      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 22: Invalid argument.
      The kernel still uses the old table.
      The new table will be used at the next reboot.
      Syncing disks.
      root@dv8000:/media# p
      -su: p: command not found
      root@dv8000:/media# /sbin/fdisk /dev/sda1
      
      Command (m for help): p
      
      Disk /dev/sda1: 1011 MB, 1011677184 bytes
      255 heads, 63 sectors/track, 122 cylinders
      Units = cylinders of 16065 * 512 = 8225280 bytes
      Disk identifier: 0x6f20736b
      
         Device Boot   Start     End   Blocks  Id System
      /dev/sda1p1        1     122   979933+ 83 Linux
      
      Command (m for help): q
      Any other ideas?

      Comment


        #4
        Re: format USB drive trouble

        Maybe someone else will pipe in here.
        I would use GParted Live CD, and have done so many, many times with UFDs, with no problems. You might even try the GUI through K > System > Partition Editor (in 8.04).
        At Konsole
        sudo fdisk -lu
        might shed some light on this, too.
        An intellectual says a simple thing in a hard way. An artist says a hard thing in a simple way. Charles Bukowski

        Comment


          #5
          Re: format USB drive trouble

          I had to resort to Partition Commander... It worked, but I would of rather worked it out through the Konsole. Thanks for the the advice anyway.

          Comment

          Working...
          X