码迷,mamicode.com
首页 > 系统相关 > 详细

Linux command parted

时间:2019-03-12 18:34:57      阅读:327      评论:0      收藏:0      [点我收藏+]

标签:type   tmp   flags   str   rootfs   terminal   fat32   mkf   list   

Linux command parted

Purpose

       Learning linux command parted to manipulate disk partitions

 

Eevironment

       Ubuntu 16.04 terminal

 

Procdeure

       example:

parted -s $DRIVE mklabel msdos
parted -s $DRIVE unit cyl mkpart primary fat32 -- 0 9
parted -s $DRIVE set 1 boot on
parted -s $DRIVE unit cyl mkpart primary ext2 -- 9 -2

mkfs.vfat -F 32 -n "boot" ${DRIVE}1
mkfs.ext3 -L "rootfs" ${DRIVE}2  << EOM
y
EOM
sync
sync

mount -t vfat ${DRIVE}1 tmp_boot
mount -t ext3 ${DRIVE}2 tmp_rootfs

   and cyl size is 8225kB, we can find from:

root@IoTP:~# parted 
GNU Parted 3.2
Using /dev/mmcblk0
Welcome to GNU Parted! Type help to view a list of commands.
(parted) unit cyl print
Model: SD SD16G (sd/mmc)
Disk /dev/mmcblk0: 1904cyl
Sector size (logical/physical): 512B/512B
BIOS cylinder,head,sector geometry: 1904,255,63.  Each cylinder is 8225kB.
Partition Table: msdos
Disk Flags: 

Number  Start  End      Size     Type     File system  Flags
 1      0cyl   9cyl     8cyl     primary  fat32        boot, lba
 2      9cyl   1902cyl  1893cyl  primary  ext3

 

Linux command parted

标签:type   tmp   flags   str   rootfs   terminal   fat32   mkf   list   

原文地址:https://www.cnblogs.com/lianghong881018/p/10518145.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!