• Linux command parted


    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
  • 相关阅读:
    url末尾的斜杠作用
    awk 工具可以很灵活地对文本进行处理,这里的 awk '{print $2}'是指第二列的内容,是运行的程序 ID。 杀死指定进程
    nil和空切片
    WaitGroup源码设计,
    2
    t
    Go内置的定时器
    分布式定时器
    1 2 交换
    order by 1 DESC 2 desc
  • 原文地址:https://www.cnblogs.com/lianghong881018/p/10518145.html
Copyright © 2020-2023  润新知