@fanisfun
2017-03-07T02:12:23.000000Z
字数 4924
阅读 3020
Linux
sudo fdisk -l
Device Boot Start End Blocks Id System/dev/sda1 1 3907029167 1953514583+ ee GPTPartition 1 does not start on physical sector boundary.Disk /dev/mapper/ubuntu--vg-root: 1931.0 GB, 1930973675520 bytes255 heads, 63 sectors/track, 234760 cylinders, total 3771432960 sectorsUnits = sectors of 1 * 512 = 512 bytesSector size (logical/physical): 512 bytes / 4096 bytesI/O size (minimum/optimal): 4096 bytes / 4096 bytesDisk identifier: 0x00000000Disk /dev/mapper/ubuntu--vg-root doesn\'t contain a valid partition tableDisk /dev/mapper/ubuntu--vg-swap_1: 68.6 GB, 68627202048 bytes255 heads, 63 sectors/track, 8343 cylinders, total 134037504 sectorsUnits = sectors of 1 * 512 = 512 bytesSector size (logical/physical): 512 bytes / 4096 bytesI/O size (minimum/optimal): 4096 bytes / 4096 bytesDisk identifier: 0x00000000Disk /dev/mapper/ubuntu--vg-swap_1 doesn\'t contain a valid partition tableDisk /dev/sdb: 31.1 GB, 31104958464 bytes255 heads, 63 sectors/track, 3781 cylinders, total 60751872 sectorsUnits = sectors of 1 * 512 = 512 bytesSector size (logical/physical): 512 bytes / 512 bytesI/O size (minimum/optimal): 512 bytes / 512 bytesDisk identifier: 0x91cd37a8Device Boot Start End Blocks Id System/dev/sdb1 * 784384 60751871 29983744 c W95 FAT32 (LBA) ## <- here!
可以看出U盘分区号是: /dev/sdb1
sudo fdisk /dev/sdb
Command (m for help): m ## 打印命令列表Command actiona toggle a bootable flag # 将分区标记为可启动盘b edit bsd disklabelc toggle the dos compatibility flagd delete a partition # 删除一个分区l list known partition typesm print this menun add a new partitiono create a new empty DOS partition tablep print the partition tableq quit without saving changess create a new empty Sun disklabelt change a partition\'s system idu change display/entry unitsv verify the partition tablew write table to disk and exitx extra functionality (experts only)Command (m for help): p ## 打印U盘分区: /dev/sdb1Disk /dev/sdb: 31.1 GB, 31104958464 bytes255 heads, 63 sectors/track, 3781 cylinders, total 60751872 sectorsUnits = sectors of 1 * 512 = 512 bytesSector size (logical/physical): 512 bytes / 512 bytesI/O size (minimum/optimal): 512 bytes / 512 bytesDisk identifier: 0x91cd37a8Device Boot Start End Blocks Id System/dev/sdb1 * 784384 60751871 29983744 c W95 FAT32 (LBA)Command (m for help): d ## 删除原本分区Selected partition 1Command (m for help): p ## 打印U盘分区: 无Disk /dev/sdb: 31.1 GB, 31104958464 bytes255 heads, 63 sectors/track, 3781 cylinders, total 60751872 sectorsUnits = sectors of 1 * 512 = 512 bytesSector size (logical/physical): 512 bytes / 512 bytesI/O size (minimum/optimal): 512 bytes / 512 bytesDisk identifier: 0x91cd37a8Device Boot Start End Blocks Id SystemCommand (m for help): n ## 新建分区Partition type:p primary (0 primary, 0 extended, 4 free)e extendedSelect (default p): p ## 基本分区Partition number (1-4, default 1): 2 ## 指定为2号分区First sector (2048-60751871, default 2048):Using default value 2048Last sector, +sectors or +size{K,M,G} (2048-60751871, default 60751871): +2G ## 大小为2GCommand (m for help): p ## 打印分区: /dev/sdb2Disk /dev/sdb: 31.1 GB, 31104958464 bytes255 heads, 63 sectors/track, 3781 cylinders, total 60751872 sectorsUnits = sectors of 1 * 512 = 512 bytesSector size (logical/physical): 512 bytes / 512 bytesI/O size (minimum/optimal): 512 bytes / 512 bytesDisk identifier: 0x91cd37a8Device Boot Start End Blocks Id System/dev/sdb2 2048 4196351 2097152 83 LinuxCommand (m for help): nPartition type:p primary (1 primary, 0 extended, 3 free)e extendedSelect (default p): p ## 基本分区Partition number (1-4, default 1): 1 ## 指定为2号分区First sector (4196352-60751871, default 4196352):Using default value 4196352Last sector, +sectors or +size{K,M,G} (4196352-60751871, default 60751871): ## 剩余所有空间Using default value 60751871Command (m for help): p ## 打印分区: /dev/sdb1 & /dev/sdb2Disk /dev/sdb: 31.1 GB, 31104958464 bytes255 heads, 63 sectors/track, 3781 cylinders, total 60751872 sectorsUnits = sectors of 1 * 512 = 512 bytesSector size (logical/physical): 512 bytes / 512 bytesI/O size (minimum/optimal): 512 bytes / 512 bytesDisk identifier: 0x91cd37a8Device Boot Start End Blocks Id System/dev/sdb1 4196352 60751871 28277760 83 Linux ## 数据分区/dev/sdb2 2048 4196351 2097152 83 Linux ## 启动分区Command (m for help): w ## 保存修改并退出The partition table has been altered!
注意: Windows下默认只识别 1号分区,因此将数据分区指定为1号 /dev/sdb1 。
sudo mkfs.ntfs -f -L NTFS /dev/sdb1 ## NTFSsudo mkfs.vfat -F 32 /dev/sdb2 ## FAT32
数据分区为 NTFS 以支持大于4G文件的存取,启动分区为 FAT32 获得更好的兼容性。
sudo mkdir -p /mnt/usb1sudo mount -t auto /dev/sdb1 /mnt/usb1sudo mkdir -p /mnt/usb2sudo mount -t auto /dev/sdb2 /mnt/usb2sudo df -h ## 打印文件系统信息
Filesystem Size Used Avail Use% Mounted on/dev/mapper/ubuntu--vg-root 1.8T 3.4G 1.7T 1% /none 4.0K 0 4.0K 0% /sys/fs/cgroupudev 32G 4.0K 32G 1% /devtmpfs 6.3G 1.5M 6.3G 1% /runnone 5.0M 0 5.0M 0% /run/locknone 32G 144K 32G 1% /run/shmnone 100M 36K 100M 1% /run/user/dev/sda2 237M 45M 180M 20% /boot/dev/sda1 511M 3.4M 508M 1% /boot/efi/dev/sdb2 27G 16K 2.0G 1% /mnt/usb2 # <- here/dev/sdb1 2.0G 16K 27G 1% /mnt/usb1 # <- here
ExtensionClonezilla(再生龙)是一款遵守GUN授权方式的自由软件,它基于Partimage,吸取了Norton Ghost和Partition Image的优点。即不仅支持对整个硬盘系统进行克隆,而且也可以克隆单个的分区,这种灵活性更能满足各种使用者的需要,此外支持多种的操作系统与文件系统也是其强大之处。我主要使用Clonezilla对Windows和Linux系统环境进行的备份、还原和部署。单台部署,选择最新的 Live 稳定版。

sudo unzip clonezilla.zip -d /mnt/usb2cd /mnt/usb2/utils/linuxsudo ./makeboot.sh /dev/sdb2sudo apt-get install -y libc6-i386 # may need
Clonezilla 具体使用方法参考 百度文库: Clonezilla(再生龙)用户指南
sudo umount /mnt/usb1 && sudo rm -r /mnt/usb1sudo umount /mnt/usb2 && sudo rm -r /mnt/usb2
提示: 每次拔出U盘前,请保持 卸载 的好习惯。