Linux中直接挂载硬盘和挂载分区有什么区别?



1.问题

Linux中直接挂载硬盘和挂载分区有什么区别?比如 /dev/sdb 的硬盘,直接mkfs.ext4 /dev/sdb 后mount 使用,和 先fdisk 分区 ,在 mkfs 在mount 使用,,两者相比有何区别?

2.回答1

你确定,不用分区?而不是一块硬盘只分成一个区?直接用过/dev/sdb 的硬盘,直接mkfs.ext4 能用吗?

3.回答2

操作如下:[root@rhel6_storage ~]# fdisk -lDisk /dev/sda: 21.5 GB, 21474836480 bytes255 heads, 63 sectors/track, 2610 cylindersUnits = cylinders of 16065 * 512 = 8225280 bytesSector size (logical/physical): 512 bytes / 512 bytesI/O size (minimum/optimal): 512 bytes / 512 bytesDisk identifier: 0x0008b221 Device Boot Start End Blocks IdSystem/dev/sda1 * 1 64 512000 83LinuxPartition 1 does not end on cylinder boundary./dev/sda2 64 2611 20458496 8eLinux LVMDisk /dev/mapper/vg_rhel6x64-lv_root: 18.9 GB, 18865979392 bytes255 heads, 63 sectors/track, 2293 cylindersUnits = cylinders of 16065 * 512 = 8225280 bytesSector size (logical/physical): 512 bytes / 512 bytesI/O size (minimum/optimal): 512 bytes / 512 bytesDisk identifier: 0x00000000Disk /dev/mapper/vg_rhel6x64-lv_swap: 2080 MB, 2080374784 bytes255 heads, 63 sectors/track, 252 cylindersUnits = cylinders of 16065 * 512 = 8225280 bytesSector size (logical/physical): 512 bytes / 512 bytesI/O size (minimum/optimal): 512 bytes / 512 bytesDisk identifier: 0x00000000Disk /dev/sdb: 42.9 GB, 42949672960 bytes255 heads, 63 sectors/track, 5221 cylindersUnits = cylinders of 16065 * 512 = 8225280 bytesSector size (logical/physical): 512 bytes / 512 bytesI/O size (minimum/optimal): 512 bytes / 512 bytesDisk identifier: 0x00000000Disk /dev/sdc: 21.5 GB, 21474836480 bytes255 heads, 63 sectors/track, 2610 cylindersUnits = cylinders of 16065 * 512 = 8225280 bytesSector size (logical/physical): 512 bytes / 512 bytesI/O size (minimum/optimal): 512 bytes / 512 bytesDisk identifier: 0x00000000[root@rhel6_storage ~]# mkfs.ext4 /dev/sdcmke2fs 1.41.12 (17-May-2010)/dev/sdc is entire device, not just one partition!无论如何也要继续? (y,n) y文件系统标签=操作系统:Linux块大小=4096 (log=2)分块大小=4096 (log=2)Stride=0 blocks, Stripe width=0 blocks1310720 inodes, 5242880 blocks262144 blocks (5.00%) reserved for the super user第一个数据块=0Maximum filesystem blocks=4294967296160 block groups32768 blocks per group, 32768 fragments per group8192 inodes per groupSuperblock backups stored on blocks: 32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208, 4096000正在写入inode表: 完成 Creating journal (32768 blocks): 完成Writing superblocks and filesystem accounting information: 完成This filesystem will be automatically checked every 31 mounts or180 days, whichever comes first.Use tune2fs -c or -i to override.[root@rhel6_storage ~]# mount /dev/sdc /mnt[root@rhel6_storage ~]# cd /mnt[root@rhel6_storage mnt]# lslost+found[root@rhel6_storage mnt]# fdisk /dev/sdcDevice contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabelBuilding a new DOS disklabel with disk identifier 0xaed63d20.Changes will remain in memory only, until you decide to write them.After that, of course, the previous content won’t be recoverable.Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)WARNING: DOS-compatible mode is deprecated. It’s strongly recommended to switch off the mode (command ‘c’) and change display units to sectors (command ‘u’).Command (m for help): pDisk /dev/sdc: 21.5 GB, 21474836480 bytes255 heads, 63 sectors/track, 2610 cylindersUnits = cylinders of 16065 * 512 = 8225280 bytesSector size (logical/physical): 512 bytes / 512 bytesI/O size (minimum/optimal): 512 bytes / 512 bytesDisk identifier: 0xaed63d20 Device Boot Start End Blocks IdSystemCommand (m for help): dNo partition is defined yet!Command (m for help): q可以看到 /dev/sdc 没有分区,直接mkfs 后 ,mount到了 /mnt,并且可以使用,同时用fdisk /dev/sdc 查看,里面是没有分区的。。

4.回答3

看你的操作是这样的,但我从没这么用过,更不清楚原因,坐等高手。这样是不是连分区表也省了啊,不知道会不会有什么不良后果

5.回答4

有一些穿高跟鞋走不到的路,

Linux中直接挂载硬盘和挂载分区有什么区别?

相关文章:

你感兴趣的文章:

标签云: