Linux Format Udisk as Ext3 formattable 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
1Show U-disk Info
$ sudo fdisk-l
disk/dev/sdb:7948 MB, 7948206080 bytes245 heads, sectors/track, 1021 cylinders, total 15523840 sectorsunits = sectors of 1 * bytessector size (logical/physical): bytes/512 bytesi/o size (minimum/optimal): bytes/512 by Tesdisk identifier:0x00000000 Device Boot Start End Blocks Id system/dev/sdb1 4096 524287 260096 linux/dev/sdb2 524288 15523839 7499776 Linux
There is and partitions. /DEV/SDB1,/DEV/SDB2
2Format 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) Yfilesystem label=os type:linuxblock size=4096 (log=2) Fragment size=4096 (log=2) stride=0 blocks, Stripe width=0 blo cks485760 inodes, 1940480 blocks97024 blocks (5.00%) reserved for the Super Userfirst data block=0maximum filesystem block s=198810009660 block groups32768 blocks per group, 32768 fragments per group8096 inodes per groupsuperblock backups stored On blocks: 32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632Allocating group Tables:done Writing Ino De Tables:done Creating Journal (32768 blocks): donewriting superblocks and filesystem accounting Information:done
3Show format result
$ sudo fdisk-l
disk/dev/sdb:7948 MB, 7948206080 bytes245 heads, sectors/track, 1021 cylinders, total 15523840 sectorsunits = sectors of 1 * bytessector size (logical/physical): bytes/512 bytesi/o size (minimum/optimal): bytes/512 by Tesdisk Identifier:0x00000000disk/dev/sdb doesn ' t contain a valid partition table
4Solve "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 disklabelbuilding a new DOS disklabel with disk I Dentifier 0xd1b6e499. Changes'll remain in memory only, until the decide to write them. After that, of course, the previous content won ' t is recoverable. Warning:invalid flag 0x0000 of partition Table 4 would be the corrected by W (rite) Command (M-help): Mcommand Action A Toggle a bootable Flag B edit BSD Disklabel c toggle the DOS compatibility flag D Delete a partition L LIS T 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 partiti On ' 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-help): Npartition Type:p Primary (0 primary, 0 extended, 4 frEE) e extendedselect (default p): Ppartition number (1-4, default 1): 1First sector (2048-15523839, default 2048): Usi Ng default value 2048Last sector, +sectors or +size{k,m,g} (2048-15523839, default 15523839): Using default Value 15523839 Command (M for help): pdisk/dev/sdb:7948 MB, 7948206080 bytes245 heads, a sectors/track, 1021 cylinders, Total 15523840 Sectorsunits = sectors of 1 * bytessector size (logical/physical): bytes/512 bytesi/o Size (minimum/optim AL): bytes/512 bytesdisk identifier:0xd1b6e499 Device Boot Start End Blocks Id system/dev/sd B1 2048 15523839 7760896 Linuxcommand (M for help): Wthe partition table have been altered! Calling IOCTL () to re-read partition table. Syncing disks.
5Create filesystem for U-disk partion 1 (/DEV/SDB1)
$ sudo mkfs.ext3/dev/sdb1
6Test format result
$ sudo mount/dev/sdb1 /mnt/$ sudo touch/mnt/aa$ ls/mnt/
AA Lost+found
Linux format Udisk as EXT3 format