八亿电脑网
游戏盒子
当前位置: 首页 > 八亿电脑 > 电脑知识 >

linux中挂载新硬盘到目录,并开机自动挂载例子(2)

时间:2015-03-11 20:58来源:网络 作者:win8e 点击:
游戏盒子

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: 0xc35aebd4

Device Boot Start End Blocks Id System
/dev/sda1 * 63 104872319 52436128+ 7 HPFS/NTFS/exFAT
/dev/sda2 104872381 976771071 435949345+ f W95 Ext'd (LBA)
/dev/sda5 104872383 231962534 63545076 7 HPFS/NTFS/exFAT
/dev/sda6 231962598 300929579 34483491 b W95 FAT32
/dev/sda7 300931072 301125631 97280 83 Linux
/dev/sda8 301127680 517726207 108299264 83 Linux
/dev/sda9 517728256 945461247 213866496 83 Linux
/dev/sda10 945463296 976771071 15653888 82 Linux swap / Solaris

在之前的命令列表上面看到,n代表创建新硬盘分区,那么接下我们输入n命令来创建新分区:
root@figo:/home/feigo# fdisk /dev/sdb

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

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

Calling ioctl() to re-read partition table.
Syncing disks.
完成,再查看,已经发现多了一个sdb1的分区:
root@figo:/home/feigo# fdisk -l

Disk /dev/sdb: 500.1 GB, 500107862016 bytes
81 heads, 63 sectors/track, 191411 cylinders, total 976773168 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: 0x3f1e271a

Device Boot Start End Blocks Id System
/dev/sdb1 2048 976773167 488385560 83 Linux

Disk /dev/sda: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders, total 976773168 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: 0xc35aebd4

Device Boot Start End Blocks Id System
/dev/sda1 * 63 104872319 52436128+ 7 HPFS/NTFS/exFAT
/dev/sda2 104872381 976771071 435949345+ f W95 Ext'd (LBA)
/dev/sda5 104872383 231962534 63545076 7 HPFS/NTFS/exFAT
/dev/sda6 231962598 300929579 34483491 b W95 FAT32
/dev/sda7 300931072 301125631 97280 83 Linux
/dev/sda8 301127680 517726207 108299264 83 Linux
/dev/sda9 517728256 945461247 213866496 83 Linux
/dev/sda10 945463296 976771071 15653888 82 Linux swap / Solaris

3. 格式化分区为ext4:

root@figo:/home/feigo# mkfs.ext4 /dev/sdb1
mke2fs 1.42.5 (29-Jul-2012)
文件系统标签=
OS type: Linux
块大小=4096 (log=2)
分块大小=4096 (log=2)
Stride=0 blocks, Stripe width=0 blocks
30531584 inodes, 122096390 blocks
6104819 blocks (5.00%) reserved for the super user
第一个数据块=0
Maximum filesystem blocks=4294967296
3727 block groups
32768 blocks per group, 32768 fragments per group
8192 inodes per group
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
4096000, 7962624, 11239424, 20480000, 23887872, 71663616, 78675968,
102400000

Allocating group tables: 完成
正在写入inode表: 完成
Creating journal (32768 blocks): 完成
Writing superblocks and filesystem accounting information: 完成
格式化完成,可以使用parted命令查看/dev/sdb的分区格式:
root@figo:/home/feigo# parted
GNU Parted 2.3
Using /dev/sda
Welcome to GNU Parted! Type 'help' to vIEw a list of commands.
(parted) help
align-check TYPE N check partition N for TYPE(min|opt) alignment
check NUMBER do a simple check on the file system
cp [FROM-DEVICE] FROM-NUMBER TO-NUMBER copy file system to another partition
help [COMMAND] print general help, or help on COMMAND
mklabel,mktable LABEL-TYPE create a new disklabel (partition table)
mkfs NUMBER FS-TYPE make a FS-TYPE file system on partition NUMBER
mkpart PART-TYPE [FS-TYPE] START END make a partition
mkpartfs PART-TYPE FS-TYPE START END make a partition with a file system
move NUMBER START END move partition NUMBER
name NUMBER NAME name partition NUMBER as NAME
print [devices|free|list,all|NUMBER] display the partition table, available devices, free space, all found partitions, or a particular partition
quit exit program
rescue START END rescue a lost partition near START and END
resize NUMBER START END resize partition NUMBER and its file system
rm NUMBER delete partition NUMBER
selectDEVICE choose the device to edit
set NUMBER FLAG STATE change the FLAG on partition NUMBER
toggle [NUMBER [FLAG]] toggle the state of FLAG on partition NUMBER

本篇文章标签: 教程 Win10 win7 软件 Win8
发表评论