- # fdisk /dev/sda
- The number of cylinders for this disk is set to 35560.
- There is nothing wrong with that, but this is larger than 1024,
- and could in certain setups cause problems with:
- 1) software that runs at boot time (e.g., old versions of LILO)
- 2) booting and partitioning software from other OSs
- (e.g., DOS FDISK, OS/2 FDISK)
- Command (m for help): m #<------------顯示fdisk菜單
- 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): p #<--------------------打印分區表
- Disk /dev/sda: 2002 MB, 2002780160 bytes
- 11 heads, 10 sectors/track, 35560 cylinders
- Units = cylinders of 110 * 512 = 56320 bytes
- Device Boot Start End Blocks Id System
- /dev/sda1 2 35561 1955775+ b W95 FAT32 #原有的FAT32分區
- Command (m for help): d #<-------------刪除一個分區
- Selected partition 1
- Command (m for help): n #<-------------新建一個分區
- Command action
- e extended
- p primary partition (1-4)
- p #<--------------選擇創建 primary 首要分區
- Partition number (1-4): 1 #<---------第一個首要分區
- First cylinder (1-35560, default 1): #<---------起始位置,直接回車用缺省值
- Using default value 1
- Last cylinder or +size or +sizeM or +sizeK (1-35560, default 35560): 300M
- #<---- 第一個分區使用 300M空間
- Command (m for help): p
- Disk /dev/sda: 2002 MB, 2002780160 bytes
- 11 heads, 10 sectors/track, 35560 cylinders
- Units = cylinders of 110 * 512 = 56320 bytes
- Device Boot Start End Blocks Id System
- /dev/sda1 1 300 16495 83 Linux
- Command (m for help): n #<----建第二個分區
- Command action
- e extended
- p primary partition (1-4)
- p #<--------------選擇創建 primary 首要分區
- Partition number (1-4): 2 #<---------第二個首要分區
- First cylinder (301-35560, default 301):
- Using default value 301
- Last cylinder or +size or +sizeM or +sizeK (301-35560, default 35560):
- Using default value 35560 #直接回車表示缺省值,即把剩下所有空間都歸入這個分區
- Command (m for help): p
- Disk /dev/sda: 2002 MB, 2002780160 bytes
- 11 heads, 10 sectors/track, 35560 cylinders
- Units = cylinders of 110 * 512 = 56320 bytes
- Device Boot Start End Blocks Id System
- /dev/sda1 1 300 16495 83 Linux
- /dev/sda2 301 35560 1939300 83 Linux
- Command (m for help): w #<-------將分區表寫入SD卡,至此才真正生效
- The partition table has been altered!
- Calling ioctl() to re-read partition table.
- Syncing disks.
- # mkfs.vfat /dev/sda1 #<----------格式化命令
- mkfs.vfat 2.11 (12 Mar 2005)
- [root@tch u-boot-1.1.6_hxy6410]# mkfs.ext3 /dev/sda2 #<------格式化命令
- mke2fs 1.39 (29-May-2006)
- Filesystem label=
- OS type: Linux
- Block size=4096 (log=2)
- Fragment size=4096 (log=2)
- 242880 inodes, 484825 blocks
- 24241 blocks (5.00%) reserved for the super user
- First data block=0
- Maximum filesystem blocks=499122176
- 15 block groups
- 32768 blocks per group, 32768 fragments per group
- 16192 inodes per group
- Superblock backups stored on blocks:
- 32768, 98304, 163840, 229376, 294912
- Writing inode tables: done
- Creating journal (8192 blocks): done
- Writing superblocks and filesystem accounting information:
- done
- This filesystem will be automatically checked every 33 mounts or
- 180 days, whichever comes first. Use tune2fs -c or -i to override.
1. 輸入 m 顯示所有命令列示。
2. 輸入 p 顯示硬盤分割情形。
3. 輸入 a 設定硬盤啓動區。
4. 輸入 n 設定新的硬盤分割區。
4.1. 輸入 e 硬盤爲[擴展]分割區(extend)。
4.2. 輸入 p 硬盤爲[首要]分割區(primary)。
5. 輸入 t 改變硬盤分割區屬性。
6. 輸入 d 刪除硬盤分割區屬性。
7. 輸入 q 結束不存入硬盤分割區屬性。
8. 輸入 w 結束並寫入硬盤分割區屬性如果以前U盤有分區,需要輸入d命令來依次刪除分區,以下執行兩次n命令創建一個 400M的FAT分區,以及把剩下的分區設爲ext3,最後用w命令把結果保存下來.
Command (m for help): n Command action Command (m for help): n Command (m for help): p Disk /dev/sdb: 2041 MB, 2041577472 bytes Device Boot Start End Blocks Id System Command (m for help): w Calling ioctl() to re-read partition table. WARNING: Re-reading the partition table failed with error 16: 設備或資源忙. WARNING: If you have created or modified any DOS 6.x |
<*> Ext3 journalling file system support [*] Ext3 extended attributes [*] Ext3 POSIX Access Control Lists [*] Ext3 Security Labels |
--- MMC/SD/SDIO card support [*] MMC debugging [ ] Allow unsafe resume (DANGEROUS) *** MMC/SD/SDIO Card Drivers *** <*> MMC block device driver [*] Use bounce buffer for simple hosts <*> SDIO UART/GPS class support <*> MMC host test driver *** MMC/SD/SDIO Host Controller Drivers *** <*> Secure Digital Host Controller Interface support <*> Samsung S3C SD/MMC Card Interface support |
[root: /]# s3c2440-sdi s3c2440-sdi: running at 0kHz (requested: 0kHz). s3c2440-sdi s3c2440-sdi: running at 198kHz (requested: 197kHz). s3c2440-sdi s3c2440-sdi: running at 198kHz (requested: 197kHz). s3c2440-sdi s3c2440-sdi: running at 198kHz (requested: 197kHz). s3c2440-sdi s3c2440-sdi: running at 198kHz (requested: 197kHz). s3c2440-sdi s3c2440-sdi: running at 198kHz (requested: 197kHz). s3c2440-sdi s3c2440-sdi: running at 198kHz (requested: 197kHz). s3c2440-sdi s3c2440-sdi: running at 198kHz (requested: 197kHz). s3c2440-sdi s3c2440-sdi: running at 16875kHz (requested: 25000kHz). s3c2440-sdi s3c2440-sdi: running at 16875kHz (requested: 25000kHz). mmc0: new SD card at address 0002 mmcblk0: mmc0:0002 00000 1.90 GiB mmcblk0: p1 p2 FAT: utf8 is not a recommended IO charset for FAT filesystems, filesystem will be case sensitive! |
brw-rw---- 1 root root 179, 0 Sep 22 10:48 /dev/mmcblk0
brw-rw---- 1 root root 179, 2 Sep 22 10:48 /dev/mmcblk0p2