刚买了一个4G的TF卡,居然在我的智能山寨机coolo818上不能使用,因为coolo818最大支持2G的卡。于是,就想把高容量的SD卡格成两个2G的盘片来用。

在 Fedora 8下,将一张4G的TF卡(MicroSD),格成两个2G的分区,一个主分区,一个逻辑分区。

ps:SD卡有TF卡(现在通称MicroSD),SD卡,MiniSD卡,SDHC等多种,长的不一样;除此之外,还有一种MMC卡。

指令:fdisk

用途:观察硬盘之实体使用情形与分割硬盘用。

使用方法:

一、在 console 上输入 fdisk -l /dev/sdb ,观察硬盘之实体使用情形。

二、在 console 上输入 fdisk /dev/sdb,可进入分割硬盘模式。

1. 输入 m 显示所有命令列示。

2. 输入 p 显示硬盘分割情形。

3. 输入 a 设定硬盘启动区。

4. 输入 n 设定新的硬盘分割区。

4.1. 输入 e 硬盘为[延伸]分割区(extend)。

4.2. 输入 p 硬盘为[主要]分割区(primary)。

5. 输入 t 改变硬盘分割区属性。

6. 输入 d 删除硬盘分割区属性。

7. 输入 q 结束不存入硬盘分割区属性。

8. 输入 w 结束并写入硬盘分割区属性。

[root@localhost ~]# fdisk /dev/sdb      #插入读卡器,在我电脑上显示是sdb,以下黑字为键入部分

The number of cylinders for this disk is set to 189513.

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       #help

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/sdb: 4075 MB, 4075290624 bytes

7 heads, 6 sectors/track, 189513 cylinders

Units = cylinders of 42 * 512 = 21504 bytes

Disk identifier: 0x00000000

Device Boot      Start         End      Blocks   Id System

/dev/sdb1               1       93007     1953144    c W95 FAT32 (LBA)

/dev/sdb2           93008      189513     2026626    f W95 Ext'd (LBA)

/dev/sdb5           93008      189513     2026623    c W95 FAT32 (LBA)

Command (m for help):dPartition number (1-5):1 #删除1分区,因为之前我已经分成两个区了,所以现在演示时显示有两个分区,总之,先删掉

Command (m for help): dPartition number (1-5):2 #删除2分区

Command (m for help): dNo partition is defined yet!

Command (m for help):p

Disk /dev/sdb: 4075 MB, 4075290624 bytes

7 heads, 6 sectors/track, 189513 cylinders

Units = cylinders of 42 * 512 = 21504 bytes

Disk identifier: 0x00000000

#以上为删除原有的分区

Device Boot      Start         End      Blocks   Id System

Command (m for help):nCommand action

e   extended

p   primary partition (1-4)

p

Partition number (1-4):1First cylinder (1-189513, default 1):

Using default value 1

Last cylinder or +size or +sizeM or +sizeK (1-189513, default 189513):+2048M

Command (m for help): tSelected partition 1

Hex code (type L to list codes): L

0 Empty           1e Hidden W95 FAT1 80 Old Minix       be Solaris boot

1 FAT12           24 NEC DOS         81 Minix / old Lin bf Solaris

2 XENIX root      39 Plan 9          82 Linux swap / So c1 DRDOS/sec (FAT-

3 XENIX usr       3c PartitionMagic 83 Linux           c4 DRDOS/sec (FAT-

4 FAT16 <32M      40 Venix 80286     84 OS/2 hidden C: c6 DRDOS/sec (FAT-

5 Extended        41 PPC PReP Boot   85 Linux extended c7 Syrinx

6 FAT16           42 SFS             86 NTFS volume set da Non-FS data

7 HPFS/NTFS       4d QNX4.x          87 NTFS volume set db CP/M / CTOS / .

8 AIX             4e QNX4.x 2nd part 88 Linux plaintext de Dell Utility

9 AIX bootable    4f QNX4.x 3rd part 8e Linux LVM       df BootIt

a OS/2 Boot Manag 50 OnTrack DM      93 Amoeba          e1 DOS access

b W95 FAT32       51 OnTrack DM6 Aux 94 Amoeba BBT      e3 DOS R/O

c W95 FAT32 (LBA) 52 CP/M            9f BSD/OS          e4 SpeedStor

e W95 FAT16 (LBA) 53 OnTrack DM6 Aux a0 IBM Thinkpad hi eb BeOS fs

f W95 Ext'd (LBA) 54 OnTrackDM6      a5 FreeBSD         ee EFI GPT

10 OPUS            55 EZ-Drive        a6 OpenBSD         ef EFI (FAT-12/16/

11 Hidden FAT12    56 Golden Bow      a7 NeXTSTEP        f0 Linux/PA-RISC b

12 Compaq diagnost 5c Priam Edisk     a8 Darwin UFS      f1 SpeedStor

14 Hidden FAT16 <3 61 SpeedStor       a9 NetBSD          f4 SpeedStor

16 Hidden FAT16    63 GNU HURD or Sys ab Darwin boot     f2 DOS secondary

17 Hidden HPFS/NTF 64 Novell Netware b7 BSDI fs         fd Linux raid auto

18 AST SmartSleep 65 Novell Netware b8 BSDI swap       fe LANstep

1b Hidden W95 FAT3 70 DiskSecure Mult bb Boot Wizard hid ff BBT

1c Hidden W95 FAT3 75 PC/IX

Command (m for help):nCommand action

e   extended

p   primary partition (1-4)

pPartition number (1-4): 1First cylinder (1-189513, default 1):

Using default value 1

Last cylinder or +size or +sizeM or +sizeK (1-189513, default 189513): +2048M

Command (m for help):tSelected partition 1

Hex code (type L to list codes):L

0 Empty           1e Hidden W95 FAT1 80 Old Minix       be Solaris boot

1 FAT12           24 NEC DOS         81 Minix / old Lin bf Solaris

2 XENIX root      39 Plan 9          82 Linux swap / So c1 DRDOS/sec (FAT-

3 XENIX usr       3c PartitionMagic 83 Linux           c4 DRDOS/sec (FAT-

4 FAT16 <32M      40 Venix 80286     84 OS/2 hidden C: c6 DRDOS/sec (FAT-

5 Extended        41 PPC PReP Boot   85 Linux extended c7 Syrinx

6 FAT16           42 SFS             86 NTFS volume set da Non-FS data

7 HPFS/NTFS       4d QNX4.x          87 NTFS volume set db CP/M / CTOS / .

8 AIX             4e QNX4.x 2nd part 88 Linux plaintext de Dell Utility

9 AIX bootable    4f QNX4.x 3rd part 8e Linux LVM       df BootIt

a OS/2 Boot Manag 50 OnTrack DM      93 Amoeba          e1 DOS access

b W95 FAT32       51 OnTrack DM6 Aux 94 Amoeba BBT      e3 DOS R/O

c W95 FAT32 (LBA) 52 CP/M            9f BSD/OS          e4 SpeedStor

e W95 FAT16 (LBA) 53 OnTrack DM6 Aux a0 IBM Thinkpad hi eb BeOS fs

f W95 Ext'd (LBA) 54 OnTrackDM6      a5 FreeBSD         ee EFI GPT

10 OPUS            55 EZ-Drive        a6 OpenBSD         ef EFI (FAT-12/16/

11 Hidden FAT12    56 Golden Bow      a7 NeXTSTEP        f0 Linux/PA-RISC b

12 Compaq diagnost 5c Priam Edisk     a8 Darwin UFS      f1 SpeedStor

14 Hidden FAT16 <3 61 SpeedStor       a9 NetBSD          f4 SpeedStor

16 Hidden FAT16    63 GNU HURD or Sys ab Darwin boot     f2 DOS secondary

17 Hidden HPFS/NTF 64 Novell Netware b7 BSDI fs         fd Linux raid auto

18 AST SmartSleep 65 Novell Netware b8 BSDI swap       fe LANstep

1b Hidden W95 FAT3 70 DiskSecure Mult bb Boot Wizard hid ff BBT

1c Hidden W95 FAT3 75 PC/IX

Hex code (type L to list codes): cChanged system type of partition 1 to c (W95 FAT32 (LBA))

#以上为建2G的主分区,W95 FAT32 (LBA)类型

Command (m for help): nCommand action

e   extended

p   primary partition (1-4)

e

Partition number (1-4): 2First cylinder (95240-189513, default 95240):

Using default value 95240

Last cylinder or +size or +sizeM or +sizeK (95240-189513, default 189513):

Using default value 189513

Command (m for help): tPartition number (1-5): 2

Hex code (type L to list codes):fChanged system type of partition 2 to f (W95 Ext'd (LBA))

#以上为创建扩展分区,类型为W95 Ext'd (LBA)

Command (m for help): n

Command action

l   logical (5 or over)

p   primary partition (1-4)

lFirst cylinder (95240-189513, default 95240):

Using default value 95240

Last cylinder or +size or +sizeM or +sizeK (95240-189513, default 189513):

Using default value 189513

Command (m for help): tPartition number (1-5): 5Hex code (type L to list codes): cChanged system type of partition 5 to c (W95 FAT32 (LBA))

#以上为创建逻辑驱动器在扩展分区上,类型为W95 FAT32 (LBA)

Command (m for help):p

Disk /dev/sdb: 4075 MB, 4075290624 bytes

7 heads, 6 sectors/track, 189513 cylinders

Units = cylinders of 42 * 512 = 21504 bytes

Disk identifier: 0x00000000

Device Boot      Start         End      Blocks   Id System

/dev/sdb1               1       95239     2000016    c W95 FAT32 (LBA)

/dev/sdb2           95240      189513     1979754    f W95 Ext'd (LBA)

/dev/sdb5           95240      189513     1979751    c W95 FAT32 (LBA)

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 16: 设备或资源忙.

The kernel still uses the old table.

The new table will be used at the next reboot.

WARNING: If you have created or modified any DOS 6.x

partitions, please see the fdisk manual page for additional

information.

Syncing disks.

[root@localhost ~]# find /dev/sdb*

/dev/sdb

/dev/sdb1

/dev/sdb2

/dev/sdb5

mkfs.vfat: /dev/sdb1 contains a mounted file system.

[root@localhost ~]# mkfs.vfat /dev/sdb1mkfs.vfat 2.11 (12 Mar 2005)

[root@localhost ~]# mkfs.vfat /dev/sdb5mkfs.vfat 2.11 (12 Mar 2005)

[root@localhost ~]# cd /mnt

[root@localhost mnt]# mkdir sd1 sd5

[root@localhost mnt]# mount /dev/sdb1 sd1

[root@localhost mnt]# mount /dev/sdb5 sd5

----------------------------------------------------------

#一下是两个2G的分区合并成一个4G的,方法类似,不在累述。

[root@localhost ~]# fdisk /dev/sdb

The number of cylinders for this disk is set to 189513.

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

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/sdb: 4075 MB, 4075290624 bytes

7 heads, 6 sectors/track, 189513 cylinders

Units = cylinders of 42 * 512 = 21504 bytes

Disk identifier: 0x00000000

Device Boot      Start         End      Blocks   Id System

/dev/sdb1               1       95239     2000016    c W95 FAT32 (LBA)

/dev/sdb2           95240      189513     1979754    f W95 Ext'd (LBA)

/dev/sdb5           95240      189513     1979751    c W95 FAT32 (LBA)

Command (m for help): dPartition number (1-5): 1

Command (m for help):d

Partition number (1-5): 2

Command (m for help):dNo partition is defined yet!

Command (m for help): p

Disk /dev/sdb: 4075 MB, 4075290624 bytes

7 heads, 6 sectors/track, 189513 cylinders

Units = cylinders of 42 * 512 = 21504 bytes

Disk identifier: 0x00000000

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-189513, default 1):

Using default value 1

Last cylinder or +size or +sizeM or +sizeK (1-189513, default 189513):

Using default value 189513

Command (m for help):t

Selected partition 1

Hex code (type L to list codes):cChanged system type of partition 1 to c (W95 FAT32 (LBA))

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 16: 设备或资源忙.

The kernel still uses the old table.

The new table will be used at the next reboot.

WARNING: If you have created or modified any DOS 6.x

partitions, please see the fdisk manual page for additional

information.

Syncing disks.

[root@localhost ~]# mkfs.vfat /dev/sdb1

mkfs.vfat 2.11 (12 Mar 2005)

linux sd卡 分区变大,Linux下使用fdisk命令将高容量SD卡(SDHC)格成两个分区相关推荐

  1. linux sd卡 分区变大,Linux 动态调整分区大小

    8种机械键盘轴体对比 本人程序员,要买一个写代码的键盘,请问红轴和茶轴怎么选? Ubuntu根分区空间告急,即将使用完毕 先清理出一定空间 移除不再需要的软件包1sudo apt autoremove ...

  2. SDHC(高容量SD存储卡)

    简介 SDHC是"Secure Digital High Capacity"的缩写,即"高容量SD存储卡".2006年5月SD协会发布了 SD 2.0的系统规范 ...

  3. 联通除腾讯王卡、蚂蚁宝卡、京东强卡,还与互联网企业合作推出了哪些高性价比电话卡/流量卡套餐?...

    联通除腾讯王卡.蚂蚁宝卡.京东强卡,还与互联网企业合作推出了哪些高性价比电话卡/流量卡套餐? 转载于:https://www.cnblogs.com/skullboyer/p/7978055.html

  4. linux命令行变大,Linux命令行下'!'的8大神奇的用法!

    哈,终于收假回来了,各位亲是不是等不及了?这次的文章原创于别的大牛,这里在自己的环境来演示一下这八个神奇的用法,在Linux 系统中,'!' 符号或者操作符通常被用做逻辑否定的操作符,同时也通过一些调 ...

  5. linux下通过fdisk和mkfs.ext4给TF卡建立分区

    TF卡插入后,在系统中的名称为:/dev/mmcblk0 通过fdisk命令在mmcblk0下面创建新的(primary)分区: ps:中途可以通过p命令查看已存在的分区,通过d命令删除多余的分区 应 ...

  6. LINUX如何让内存FREE变大,Linux性能优化(内存:free + top +vmstat )

    转载:https://blog.51cto.com/superpcm/2068843 cat /proc/{pid}/status Valgrind工具检测内存泄漏 3.1内存性能统计信息 3.1.1 ...

  7. linux格式化时设备或资源忙,Linux下使用fdisk命令和partprobe命令,在不重启系统的状况下新建分区并格式化...

    因为工做的须要,最近一段时间一直在学习Linux.学习一门新的知识,我是喜欢根据谋一本书或者某一个学习视频系统的学习,这样能够对学习的新知识有一个系统全面的认识和了解.因此学习以前,没了一本鸟哥的私房 ...

  8. linux格式化时设备或资源忙,Linux下用fdisk命令和partprobe命令不重启系统新建分区并格式化...

    由于工作的需要,最近一段时间一直在学习Linux.学习一门新的知识,我是喜欢根据谋一本书或者某一个学习视频系统的学习,这样可以对学习的新知识有一个系统全面的认识和了解.所以学习之前,买了一本鸟哥的私房 ...

  9. linux下使用fdisk命令进行硬盘分区

    添加一块硬盘 # fdisk -l Disk /dev/vdb: 53.7 GB, 53687091200 bytes 16 heads, 63 sectors/track, 104025 cylin ...

最新文章

  1. Spring Cloud Alibaba到底坑不坑?
  2. Codeforces Round #311 (Div. 2) A. Ilya and Diplomas 水题
  3. Android-Multidex安装流程解析
  4. OpenCASCADE绘制测试线束:数据交换命令之XDE 图层命令
  5. MySql 、Oracle 获取表结构和字段信息
  6. 在webpack和vue-cli上的rem适配终极方案
  7. 《日志管理与分析权威指南》一1.6 人、过程和技术
  8. 对象新增方法 object.is() object.assign()
  9. MySQL 聚合函数(一)聚合(组合)函数概述
  10. $stateParams 详解
  11. 2.9 使用快捷键快速隐藏和显示行列 [原创Excel教程]
  12. urule开源版自定义动作库注意事项
  13. Spring Bean作用域简介
  14. 隆中对,程序员修炼之道,技术学习前进之路
  15. IDEA javadoc快捷键
  16. 4Ps营销理论(The Marketing Theory of 4Ps)
  17. 强化学习笔记-强化学习概述
  18. 5.1/2每日一题——胖胖的牛牛
  19. matlab:寻找峰值(波峰,波谷)
  20. PW7152芯片,一款基于 CMOS 的双节可充电锂电池保护电路

热门文章

  1. (Window环境) curl: (6) Could not resolve host: application curl: (6) Could not resolve host: ‘localhos
  2. 小D的一串数字 (数位DP做法)
  3. linux内核协议栈 TCP层数据发送之发送新数
  4. GalaxyOJ-636 (概率DP)
  5. ssm个人微空间图片相册共享系统
  6. 真的羡慕玉自寒和烈如歌的爱情
  7. oracle怎么从右边截取,Oracle 字符串截取 从后向前截取方法
  8. 阿波罗java_携程Apollo(阿波罗)安装部署以及java整合实现
  9. 电阻的耐功率冲击与耐电压冲击
  10. PMU电池管理配置与io-domain电源域