LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 12-06-2015, 03:26 PM   #1
cg132
LQ Newbie
 
Registered: Sep 2004
Distribution: Slackware
Posts: 22

Rep: Reputation: Disabled
Question disappearing partition trick, formatting micro sd, and random space consumed


First off I'd like to say sorry for starting a thread in General. I was thinking about starting it under hardware since its related to an SD card, then I was thinking I should put it under software since its related to mkfs. I was also thinking about going under the slackware area because I'm slacking. But hey....general seemed good.

Maybe someone can help me understand what I'm doing wrong, or at least sympathize and confirm the problem is real and not just in my head.

So I fdisk a new partition and it shows up. Then I mkfs.vfat mmcblk0p1 and it vanishes.
Code:
cg132@laptop:~$ sudo dd if=/dev/zero of=/dev/mmcblk0 bs=1M count=1
1+0 records in
1+0 records out
1048576 bytes (1.0 MB) copied, 0.0925948 s, 11.3 MB/s
cg132@laptop:~$ sudo /sbin/fdisk -l /dev/mmcblk0

Disk /dev/mmcblk0: 67.1 GB, 67108864000 bytes
4 heads, 16 sectors/track, 2048000 cylinders, total 131072000 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

cg132@laptop:~$ sudo /sbin/fdisk /dev/mmcblk0 
Welcome to fdisk (util-linux 2.21.2).

Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.

Device does not contain a recognized partition table
Building a new DOS disklabel with disk identifier 0xd48f9117.

Command (m for help): n
Partition type:
   p   primary (0 primary, 0 extended, 4 free)
   e   extended
Select (default p): p
Partition number (1-4, default 1): 
Using default value 1
First sector (2048-131071999, default 2048): 
Using default value 2048
Last sector, +sectors or +size{K,M,G} (2048-131071999, default 131071999): 
Using default value 131071999
Partition 1 of type Linux and of size 62.5 GiB is set

Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.
Syncing disks.
cg132@laptop:~$ sudo /sbin/fdisk -l /dev/mmcblk0

Disk /dev/mmcblk0: 67.1 GB, 67108864000 bytes
4 heads, 16 sectors/track, 2048000 cylinders, total 131072000 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: 0xd48f9117

        Device Boot      Start         End      Blocks   Id  System
/dev/mmcblk0p1            2048   131071999    65534976   83  Linux
cg132@laptop:~$ sudo /sbin/mkfs.vfat /dev/mmcblk0p1 
mkfs.fat 3.0.22 (2013-07-19)
cg132@laptop:~$ sudo /sbin/fdisk -l /dev/mmcblk0

Disk /dev/mmcblk0: 67.1 GB, 67108864000 bytes
4 heads, 16 sectors/track, 2048000 cylinders, total 131072000 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

cg132@laptop:~$ ?
What the heck? So I tried again with 10M block size

Code:
cg132@laptop:~$ sudo dd if=/dev/zero of=/dev/mmcblk0 bs=10M count=1
1+0 records in
1+0 records out
10485760 bytes (10 MB) copied, 2.53113 s, 4.1 MB/s
cg132@laptop:~$ sudo /sbin/fdisk /dev/mmcblk0 
Welcome to fdisk (util-linux 2.21.2).

Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.

Device does not contain a recognized partition table
Building a new DOS disklabel with disk identifier 0x48d894ce.

Command (m for help): n
Partition type:
   p   primary (0 primary, 0 extended, 4 free)
   e   extended
Select (default p): p
Partition number (1-4, default 1): 1
First sector (2048-131071999, default 2048): 
Using default value 2048
Last sector, +sectors or +size{K,M,G} (2048-131071999, default 131071999): 
Using default value 131071999
Partition 1 of type Linux and of size 62.5 GiB is set

Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.
Syncing disks.
cg132@laptop:~$ sudo /sbin/fdisk -l /dev/mmcblk0

Disk /dev/mmcblk0: 67.1 GB, 67108864000 bytes
4 heads, 16 sectors/track, 2048000 cylinders, total 131072000 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: 0x48d894ce

        Device Boot      Start         End      Blocks   Id  System
/dev/mmcblk0p1            2048   131071999    65534976   83  Linux
cg132@laptop:~$ sudo /sbin/mkfs.vfat /dev/mmcblk0p1 
mkfs.fat 3.0.22 (2013-07-19)
cg132@laptop:~$ sudo /sbin/fdisk -l /dev/mmcblk0

Disk /dev/mmcblk0: 67.1 GB, 67108864000 bytes
4 heads, 16 sectors/track, 2048000 cylinders, total 131072000 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: 0x48d894ce

        Device Boot      Start         End      Blocks   Id  System
/dev/mmcblk0p1            2048   131071999    65534976   83  Linux
cg132@laptop:~$ sudo mount /dev/mmcblk0p1 /mnt/floppy/
cg132@laptop:~$ df -h
Filesystem      Size  Used Avail Use Mounted on
/dev/sda3        22G   18G  2.9G  86% /
/dev/sda1       976M   17M  892M   2% /boot
tmpfs           3.8G     0  3.8G   0% /dev/shm
/dev/mmcblk0p1   63G   20G   44G  31% /mnt/floppy
cg132@laptop:~$ D-:
Wow! Now my partition is there after mkfs but 20gb has been eaten by gremlins. Now what? Should I skeet shoot this card and be done with it? I used it to store a video game install. The card was always readable and reinstalled the game without a problem so I don't think the card is bad.

How do I get my 20gb back? The card is blank as far as I can tell. Any suggestions?

Cheers
132

Last edited by cg132; 12-06-2015 at 04:00 PM. Reason: spelling error
 
Old 12-06-2015, 05:14 PM   #2
berndbausch
LQ Addict
 
Registered: Nov 2013
Location: Tokyo
Distribution: Mostly Ubuntu and Centos
Posts: 6,316

Rep: Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002
I don't see you doing anything wrong. Perhaps the card is broken: http://forums.anandtech.com/showthread.php?t=2335234 (and many more links when you google for "check sd card").
 
Old 12-07-2015, 03:32 AM   #3
cg132
LQ Newbie
 
Registered: Sep 2004
Distribution: Slackware
Posts: 22

Original Poster
Rep: Reputation: Disabled
The card is not bad. I've been using it to store a very large video game install, about 30gb, and the data always came back clean. Just to be sure I formatted the card in windows without issue. Trying not to advocate windows here but it seems to handle the card just fine. I flip over to *nix and the card acts normal now that windows molested it. I use SD cards frequently, and I've thrown out quite a few over the years, but I've never seen this before. Well I've seen all kinds of hocus pocus including the disappearing partition table, file system corruption, and dead cards that take data and comes back with gibberish. However I've never seen 20gb of gremlins consuming the card without any files being present. Thought I'd bring it up here to see if there was a solution. Figured there must be a better way to do things. I must admit this is the only SDXC(64gb) card I have. I haven't seen this problem on any SDHC(32gb) cards. I was saying I should skeet shoot it just to prevent the gremlins from spreading across my network, the internet, and possibly take over the world! :-P
 
Old 12-07-2015, 03:47 AM   #4
cg132
LQ Newbie
 
Registered: Sep 2004
Distribution: Slackware
Posts: 22

Original Poster
Rep: Reputation: Disabled
Found my problem. EXFat. You can slap me with a rotten fish now. Guess SDXC requires exfat. vfat, ext2, ext3, ext4, reiserfs, jfs....none of them work. But exfat does. <sigh>
 
1 members found this post helpful.
Old 12-07-2015, 04:23 AM   #5
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,128

Rep: Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121
Thanks for the postback. That is seriously twisted.
 
Old 12-07-2015, 06:56 AM   #6
oldtechaa
Member
 
Registered: May 2015
Location: US
Distribution: Fedora
Posts: 364

Rep: Reputation: 83
Another thing I noticed is that in fdisk, you are not changing the partition type label to FAT. You're leaving it on "Linux". It really should be on one of the FAT options instead. That can be done with a "t" command in fdisk.
 
Old 12-08-2015, 11:39 AM   #7
cg132
LQ Newbie
 
Registered: Sep 2004
Distribution: Slackware
Posts: 22

Original Poster
Rep: Reputation: Disabled
Checked....didn't help.
Code:
cg132@laptop:~$ sudo /sbin/fdisk -l /dev/mmcblk0

Disk /dev/mmcblk0: 67.1 GB, 67108864000 bytes
252 heads, 59 sectors/track, 8815 cylinders, total 131072000 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: 0x00000000

        Device Boot      Start         End      Blocks   Id  System
/dev/mmcblk0p1            2048   131071999    65534976    b  W95 FAT32
cg132@laptop:~$ sudo /sbin/mount /dev/mmcblk0p1 /mnt/floppy/
cg132@laptop:~$ df -h
Filesystem      Size  Used Avail Use% Mounted on
/dev/sda3        22G   19G  2.4G  89% /
/dev/sda1       976M   17M  892M   2% /boot
tmpfs           3.8G     0  3.8G   0% /dev/shm
/dev/sda2       137G  125G   12G  92% /windows
/dev/mmcblk0p1   63G   20G   44G  31% /mnt/floppy
 
Old 12-08-2015, 12:06 PM   #8
cg132
LQ Newbie
 
Registered: Sep 2004
Distribution: Slackware
Posts: 22

Original Poster
Rep: Reputation: Disabled
Just to be extra sure. I created a linux type partition table and formatted it with exfat. Looks better than the mess windows made of the partition table.
Code:
cg132@laptop:~$ sudo /sbin/fdisk -l /dev/mmcblk0 

Disk /dev/mmcblk0: 67.1 GB, 67108864000 bytes
4 heads, 16 sectors/track, 2048000 cylinders, total 131072000 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

cg132@laptop:~$ sudo /sbin/fdisk /dev/mmcblk0 
Welcome to fdisk (util-linux 2.21.2).

Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.

Device does not contain a recognized partition table
Building a new DOS disklabel with disk identifier 0xf6d89914.

Command (m for help): p

Disk /dev/mmcblk0: 67.1 GB, 67108864000 bytes
4 heads, 16 sectors/track, 2048000 cylinders, total 131072000 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: 0xf6d89914

        Device Boot      Start         End      Blocks   Id  System

Command (m for help): n
Partition type:
   p   primary (0 primary, 0 extended, 4 free)
   e   extended
Select (default p): p
Partition number (1-4, default 1): 
Using default value 1
First sector (2048-131071999, default 2048): 
Using default value 2048
Last sector, +sectors or +size{K,M,G} (2048-131071999, default 131071999): 
Using default value 131071999
Partition 1 of type Linux and of size 62.5 GiB is set

Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.
Syncing disks.
cg132@laptop:~$ sudo /usr/sbin/mkfs.exfat /dev/mmcblk0p1 
mkexfatfs 1.2.1
Creating... done.
Flushing... done.
File system created successfully.
cg132@laptop:~$ sudo /sbin/fdisk -l /dev/mmcblk0 

Disk /dev/mmcblk0: 67.1 GB, 67108864000 bytes
4 heads, 16 sectors/track, 2048000 cylinders, total 131072000 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: 0xf6d89914

        Device Boot      Start         End      Blocks   Id  System
/dev/mmcblk0p1            2048   131071999    65534976   83  Linux
cg132@laptop:~$ sudo mount /dev/mmcblk0p1 /mnt/floppy/
FUSE exfat 1.2.1
cg132@laptop:~$ df -h       
Filesystem      Size  Used Avail Use% Mounted on
/dev/sda3        22G   19G  2.4G  89% /
/dev/sda1       976M   17M  892M   2% /boot
tmpfs           3.8G     0  3.8G   0% /dev/shm
/dev/sda2       137G  125G   12G  92% /windows
/dev/mmcblk0p1   63G  2.8M   63G   1% /mnt/floppy
cg132@laptop:~$
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] consumed space bigger than total disc space? WiseDraco Slackware 6 02-19-2015 01:12 AM
list sub-directories and disk space consumed hugheskc@yahoo.com Linux - Newbie 5 05-18-2013 02:04 AM
how can i find space consumed by this user izrafel Linux - General 3 06-15-2007 04:21 AM
Magic: The disappearing hard drive trick pwaller Linux - Hardware 6 07-20-2006 03:21 PM
my cdrom and its disappearing file trick IceGrill Linux - Hardware 2 12-13-2002 08:11 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 07:28 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration