Find the answer to your Linux question:
Page 1 of 2 1 2 LastLast
Results 1 to 10 of 14
I run fdisk, create partitions (that list properly with p), exit using w yet nothing is written to the card as evidenced by fdisk -l. No errors are reported and ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Jan 2005
    Posts
    13

    Unable to partition sd card


    I run fdisk, create partitions (that list properly with p), exit using w yet nothing is written to the card as evidenced by fdisk -l.

    No errors are reported and everything *appears* to go correctly but nothing is written to the card. And yes, I am sure the "lock" isn't on. Oh, and it is readable and writable on a Win 7 machine (after reformatting of course)

    CentOS 4.8 final with 2.6.9-89.0.25.plus.c4 kernel

    Oh and I'm using an IDE > sd card adapter and the system IS seeing it as /dev/hdc

  2. #2
    Administrator MikeTbob's Avatar
    Join Date
    Apr 2006
    Location
    Texas
    Posts
    7,864
    Quote Originally Posted by KenHorse View Post
    I run fdisk, create partitions (that list properly with p), exit using w yet nothing is written to the card as evidenced by fdisk -l.

    No errors are reported and everything *appears* to go correctly but nothing is written to the card. And yes, I am sure the "lock" isn't on. Oh, and it is readable and writable on a Win 7 machine (after reformatting of course)

    CentOS 4.8 final with 2.6.9-89.0.25.plus.c4 kernel

    Oh and I'm using an IDE > sd card adapter and the system IS seeing it as /dev/hdc
    My first guess would be that there might be a problem with the IDE > sd card adapter, can you test it elsewhere? Can you boot a LiveCD and get the same results?
    I do not respond to private messages asking for Linux help, Please keep it on the forums only.
    All new users please read this.** Forum FAQS. ** Adopt an unanswered post.

    I'd rather be lost at the lake than found at home.

  3. #3
    Just Joined!
    Join Date
    Jan 2005
    Posts
    13
    Quote Originally Posted by MikeTbob View Post
    My first guess would be that there might be a problem with the IDE > sd card adapter, can you test it elsewhere? Can you boot a LiveCD and get the same results?
    Same results, yep. Perhaps I do have a bad adapter afterall....

  4. $spacer_open
    $spacer_close
  5. #4
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    Location
    I can be found either 40 miles west of Chicago, in Chicago, or in a galaxy far, far away.
    Posts
    11,677
    The other possibility is that the umount command is not flushing the written data to device. I have seen this with SD cards, so I ALWAYS execute as root the "sync" command to make sure all data has been written to the device. Often this will take awhile because of device I/O caching. Anyway, similar issues have burned me in the past, so this I always do before unmounting the device. Once burned, twice wary as the saying goes!
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

  6. #5
    Just Joined!
    Join Date
    Jan 2005
    Posts
    13
    Quote Originally Posted by Rubberman View Post
    The other possibility is that the umount command is not flushing the written data to device. I have seen this with SD cards, so I ALWAYS execute as root the "sync" command to make sure all data has been written to the device. Often this will take awhile because of device I/O caching. Anyway, similar issues have burned me in the past, so this I always do before unmounting the device. Once burned, twice wary as the saying goes!
    Well, I never get to the point of actually being able to mount the card. I do my partitioning immediately after boot and then try to write that to the card but that never happens

    I don't think rsync is going to help with an unmounted device, yes?

  7. #6
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    Location
    I can be found either 40 miles west of Chicago, in Chicago, or in a galaxy far, far away.
    Posts
    11,677
    So, you plug in the card, run fdisk, partition the card, and then exit fdisk, correct? If so, then fdisk should sync the device automatically. Do you then format the partition you created, or do you reboot first?
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

  8. #7
    Just Joined!
    Join Date
    Jan 2005
    Posts
    13
    I'm using an EPIA 5000 mb with 1 gig ram and a 40 gig IDE HD in the IDE #1 slot. I have an IDE to sd card adapter on the #2 IDE slot.

    The computer boots off the HD (obviously) and reports the IDE/sd card as hdc - it has a 2 gig sd card inserted.

    Once up and running, I run fisk /dev/hdc, partition, confirm the partitions (hdc1 as 100 meg partition and hdc2 as the remainder. Both are Linux partitions.

    I double check with the p command, then use w to write the table and then exit. Yes, fdisk reports it is synching it.

    After it exits, I do fdisk -l /dev/hdc1 and it says it isn't partitioned. I try fdisk -l /dev/hdc2 and it also says it isn't partitioned.

    I have also tried partitioning the entire card as one partition but I get the same (failed) results

  9. #8
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    Location
    I can be found either 40 miles west of Chicago, in Chicago, or in a galaxy far, far away.
    Posts
    11,677
    What do you see when you execute the command "ls /dev/hdc*" ?? After partitioning and saving/quitting fdisk...
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

  10. #9
    Just Joined!
    Join Date
    Jan 2005
    Posts
    13
    Quote Originally Posted by Rubberman View Post
    What do you see when you execute the command "ls /dev/hdc*" ?? After partitioning and saving/quitting fdisk...
    After boot but nothing else:

    Code:
    [root@ah6le ~]# fdisk -l /dev/hdc
    
    Disk /dev/hdc: 1967 MB, 1967128576 bytes
    16 heads, 63 sectors/track, 3811 cylinders
    Units = cylinders of 1008 * 512 = 516096 bytes
    
    Disk /dev/hdc doesn't contain a valid partition table
    [root@ah6le ~]#
    Running fdisk:

    Code:
    Command (m for help): p
    
    Disk /dev/hdc: 1967 MB, 1967128576 bytes
    16 heads, 63 sectors/track, 3811 cylinders
    Units = cylinders of 1008 * 512 = 516096 bytes
    
       Device Boot      Start         End      Blocks   Id  System
    /dev/hdc1               1         195       98248+  83  Linux
    /dev/hdc2             196        3811     1822464   83  Linux
    
    Command (m for help):
    Exiting fdisk:
    Code:
    Command (m for help): w
    The partition table has been altered!
    
    Calling ioctl() to re-read partition table.
    Syncing disks.
    [root@ah6le ~]#
    Double check what I just did:
    Code:
    [root@ah6le ~]# fdisk -l /dev/hdc
    
    Disk /dev/hdc: 1967 MB, 1967128576 bytes
    16 heads, 63 sectors/track, 3811 cylinders
    Units = cylinders of 1008 * 512 = 516096 bytes
    
    Disk /dev/hdc doesn't contain a valid partition table
    [root@ah6le ~]# 
    
    [root@ah6le ~]# fdisk -l /dev/hdc1
    [root@ah6le ~]# fdisk -l /dev/hdc2
    [root@ah6le ~]#
    And finally:
    Code:
    [root@ah6le ~]# ls /dev/hdc1
    ls: /dev/hdc1: No such file or directory
    [root@ah6le ~]# ls /dev/hdc2
    ls: /dev/hdc2: No such file or directory
    [root@ah6le ~]#

  11. #10
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    Location
    I can be found either 40 miles west of Chicago, in Chicago, or in a galaxy far, far away.
    Posts
    11,677
    I don't see that you used the 'o' option to create a new partition table first. Have you tried that before creating the partitions?
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

Page 1 of 2 1 2 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •