Linux (Ubuntu) under Partition and formatted SD card

Source: Internet
Author: User
Tags hex code

My phone SD card needs to be divided into two partitions, under the WINDOWXP.
The main problem is that window only knows the first partition of the SD card.
Someone modified the driver to let Windows recognize the SD card as Hitachi's Microdisk, partitioning and formatting can also be done. But in my notebook, the SD card reader is the notebook, not connected to the USB interface, this method is not feasible.
It is very easy to format the SD card partition under Linux.
The system I installed is ubuntu10.04.
After the SD card is plugged in, it automatically mount.
So, the first step, Umount.
$sudo-I.
Enter your own password to get root privileges.
# mount
You can see the last line of the device number
/dev/mmcblk0 on/media/60c5-3ec0 type VFAT (rw,nosuid,nodev,uhelper=udisks,uid=1000,gid=1000,shortname=mixed,dmask= 0077,utf8=1,flush)
Umount this SD card
# umount/dev/mmcblk0
The following is the Fdisk tool.
# fdisk/dev/mmcblk0
The Fdisk command is very simple.
Warning:dos-compatible mode is deprecated. It ' s strongly recommended to
Switch off the mode (command ' C ') and change display units to
Sectors (Command ' u ').
Command (M for help): M
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)
First p, see the SD card partition status.
Then D, delete the original partition
n, create a partition
Command (M for help): N
Command Action
E Extended
P primary partition (1-4)
P
Partition number (1-4): 1
First cylinder (1-62528, default 1): 1
Last cylinder, +cylinders or +size{k,m,g} (1-62528, default 62528): +1500m
T, specify the partition type,
Command (M for help): t
Selected partition 1
Hex code (Type L to list codes): L
0 Empty NEC DOS bayi minix/old Lin BF Solaris
1 FAT12 Plan 9 swap/so C1 drdos/sec (fat-
2 Xenix root 3c partitionmagic Linux C4 drdos/sec (fat-
3 Xenix usr Venix 80286 os/2 hidden c:c6 drdos/sec (fat-
4 FAT16 <32m PPC PReP Boot-up Linux extended C7 Syrinx
5 Extended SFS, NTFS volume set da non-fs data
6 FAT16 4d qnx4.x NTFS Volume set db cp/m/CTOS/.
7 Hpfs/ntfs 4e qnx4.x 2nd part of the Linux plaintext de Dell Utility
8 AIX 4f qnx4.x 3rd part 8e Linux LVM DF bootit
9 AIX bootable Ontrack DM Amoeba E1 DOS Access
A os/2 Boot manag Wuyi ontrack DM6 Aux 94 Amoeba BBT E3 DOS r/o
b W95 FAT32 cp/m 9f bsd/os e4 speedstor
C W95 FAT32 (LBA) Ontrack DM6 Aux A0 IBM Thinkpad hi EB BeOS FS
E W95 FAT16 (LBA) OnTrackDM6 a5 FreeBSD ee GPT
F W95 Ext ' d (LBA) ez-drive a6 OpenBSD ef EFI (fat-12/16/
Ten OPUS Bow A7 NeXTSTEP f0 linux/pa-risc b
One Hidden FAT12 5c Priam edisk A8 Darwin UFS F1 SpeedStor
Compaq diagnost speedstor A9 NetBSD f4 SpeedStor
Hidden FAT16 <3, GNU HURD or Sys ab Darwin boot F2 DOS Secondary
Hidden FAT16 Novell Netware af hfs/hfs+ fb VMware VMFS
Hidden hpfs/ntf Novell Netware b7 BSDI FS FC VMware Vmkcore
AST smartsleep disksecure Mult b8 BSDI swap fd Linux RAID auto
1b Hidden W95 FAT3 pc/ix bb Boot Wizard hid Fe lanstep
1c Hidden W95 FAT3, Minix be Solaris boot ff BBT
1e Hidden W95 FAT1
Hex code (type L to list codes): 6
Changed system type of partition 1 to 6 (FAT16)
This will divide the first partition and specify the partition as FAT16.
The second one, I try to partition for the Linux partition
Command (M for help): N
Command Action
E Extended
P primary partition (1-4)
P
Partition number (1-4): 2
First cylinder (48002-62528, default 48002):
Using Default Value 48002
Last cylinder, +cylinders or +size{k,m,g} (48002-62528, default 62528):
Using Default Value 62528
Command (M for help): t
Partition number (1-4): 2
Hex code (type L to list codes): 83
Okay, look at the results.
Command (M for help): P
disk/dev/mmcblk0:2048 MB, 2048917504 bytes
4 heads, Sectors/track, 62528 cylinders
Units = Cylinders of * 32768 bytes
Sector size (logical/physical): bytes/512 bytes
I/O size (minimum/optimal): bytes/512 bytes
Disk identifier:0x6f20736b
Device Boot Start End Blocks Id System
/DEV/MMCBLK0P1 1 48001 1536024 6 FAT16
/DEV/MMCBLK0P2 48002 62528 464864-up Linux
OK, write the partition information to disk.
Command (M for help): W
The partition table has been altered!
Calling IOCTL () to re-read partition table.
Warning:if you has created or modified any DOS 6.x
partitions, please see the Fdisk manual page for additional
Information.
Syncing disks.
The following is the beginning of formatting.
First, the FAT16 partition.
#mkdosfs/DEV/MMCBLK0P1
Then the Linux partition
#mkfs. ext3/dev/mmcblk0p2
After the completion, remove the SD card, and then install it, the Linux system has automatically identified two partitions, can be used.
Put it in the phone.

Linux (Ubuntu) under Partition and formatted SD card

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.