Linux Format Udisk As Ext3 format

Linux Format Udisk As Ext3 format

Table of Contents

  • 1. show u-disk info
  • 2. format entire u-disk
  • 3. show format result
  • 4. solve "Disk /dev/sdb doesn‘t contain a valid partition table" problem
  • 5. create filesystem for u-disk partion 1 (/dev/sdb1)
  • 6. test format result

1 show u-disk info

$ sudo fdisk -l
Disk /dev/sdb: 7948 MB, 7948206080 bytes
245 heads, 62 sectors/track, 1021 cylinders, total 15523840 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/sdb1            4096      524287      260096   83  Linux
/dev/sdb2          524288    15523839     7499776   83  Linux

there are two partitions. /dev/sdb1, /dev/sdb2

2 format entire u-disk

$ sudo mkfs.ext3 /dev/sdb
mke2fs 1.42.9 (4-Feb-2014)
/dev/sdb is entire device, not just one partition!
Proceed anyway? (y,n) y
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
Stride=0 blocks, Stripe width=0 blocks
485760 inodes, 1940480 blocks
97024 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=1988100096
60 block groups
32768 blocks per group, 32768 fragments per group
8096 inodes per group
Superblock backups stored on blocks:
    32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632

Allocating group tables: done
Writing inode tables: done
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: done

3 show format result

$ sudo fdisk -l
Disk /dev/sdb: 7948 MB, 7948206080 bytes
245 heads, 62 sectors/track, 1021 cylinders, total 15523840 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

Disk /dev/sdb doesn‘t contain a valid partition table

4 solve "Disk /dev/sdb doesn‘t contain a valid partition table" problem

$ sudo fdisk /dev/sdb
Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
Building a new DOS disklabel with disk identifier 0xd1b6e499.
Changes will remain in memory only, until you decide to write them.
After that, of course, the previous content won‘t be recoverable.

Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)

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): 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-15523839, default 2048):
Using default value 2048
Last sector, +sectors or +size{K,M,G} (2048-15523839, default 15523839):
Using default value 15523839

Command (m for help): p

Disk /dev/sdb: 7948 MB, 7948206080 bytes
245 heads, 62 sectors/track, 1021 cylinders, total 15523840 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: 0xd1b6e499

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1            2048    15523839     7760896   83  Linux

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

Calling ioctl() to re-read partition table.
Syncing disks.

5 create filesystem for u-disk partion 1 (/dev/sdb1)

$ sudo mkfs.ext3 /dev/sdb1

6 test format result

$ sudo mount /dev/sdb1  /mnt/
$ sudo touch /mnt/aa
$ ls /mnt/
aa  lost+found
时间: 2024-10-21 10:33:58

Linux Format Udisk As Ext3 format的相关文章

图解Linux中EXT4与EXT3的区别

图解Linux中EXT4与EXT3文件系统的详细区别, 包括: 与EXT3文件系统兼容 更大的文件系统和更大的文件 无限数量的子目录 扩展存储范围 多块分配 快速fsck 日志校验 无日志模式 在线碎片整理 inode相关特性 持久预分配 默认启动障碍点

【SAS BASE】FORMAT Statement及PROC FORMAT

1 FORMAT Profit Loss DOLLAR8.2 Saledate MMDDYY8.; 2 PUT Profit DOLLAR8.2 LOSS DOLLAR8.2 Saledate MMDDYY8.; FORMAT语句指定每个变量具体的格式;这里特别要注意的是,FORMAT语句中,指定Profit和Loss同一个格式,为DOLLAR8.2. 1 DATA Carsurvey; 2 INFILE 'c:\myrawdata\cars.dat'; 3 INPUT Age Sex Inco

sas高级编程(3)format过程,管理format、永久使用format给指定variable、控制format搜索顺序、fmterr、利用数据集创建format,由format创建数据集、制表过程

/***************************************************格式过程************************************************/ PROC FORMAT <option(s)>; EXCLUDE entry(s); INVALUE <$>name <(informat-option(s))>value-range-set(s); PICTURE name <(format-optio

linux分区之ext2,ext3,ext4,gpt

2013-07-10 12:00:24 标签:ext3 gpt 原创作品,允许转载,转载时请务必以超链接形式标明文章 原始出处 .作者信息和本声明.否则将追究法律责任.http://wushank.blog.51cto.com/3489095/1244191 一.各分区简单介绍: 1.EXT是Linux系统下的一种磁盘分区格式,等同于XP下的FAT/FAT16/FAT32,大家知道安卓是基于Linux系统开发的手机系统,那么同样的就有这些分区格式,平时我们所说的开启a2sd功能,就是在SD卡中分

dnSpy PE format ( Portable Executable File Format)

Portable Executable File Format PE Format  微软官方的 What is a .PE file in the .NET framework? [closed] The PE file you are talking about is the "Portable Executable" format. Almost every EXE and DLL on the Windows platform is formatted in PE format

clang format 官方文档自定义参数介绍(中英文)

英文 Configuring Style in Code When using clang::format::reformat(...) functions, the format is specified by supplying the clang::format::FormatStyle structure. Configurable Format Style Options This section lists the supported style options. Value typ

对hadoop namenode -format执行过程的探究

  引言 本文出于一个疑问:hadoop namenode -format到底在我的linux系统里面做了些什么? 步骤 第1个文件bin/hadoop Hadoop脚本位于hadoop根目录下的bin目录下, 打开之后阅读源代码: 在这里$1即为参数namenode 将COMMAND赋值为$1,那么COMMAND=namenode 条件判断语句的执行流到达#hdfs下的一行: 因为这一行判断COMMAND是否等于namenode secondarynamenode等之一: 接着往下读: 判断"

VMWare File Format Learning &amp;&amp; Use VHD File To Boot VMWare

目录 1. Virtual Machine Introduce 2. Vmware Image File Format 3. VHD File Format 4. Convert VHD File Into VMDK 5. Run Virtual PC virtual machine in VMware Workstation 1. Virtual Machine Introduce A virtual machine (VM) shares physical hardware resource

Create and format Word documents using R software and Reporters package

http://www.sthda.com/english/wiki/create-and-format-word-documents-using-r-software-and-reporters-package Install and load the ReporteRs R package Create a simple Word document Add texts : title and paragraphs of texts Format the text of a Word docum