在Linux系统中,SCSI磁盘最多只支持15个分区(3个主分区sda1-sda3 + 1个扩展分区sda4 + 11个逻辑分区sda5-sda15),而IDE磁盘也只支持63个分区
- [root@rhel6 ~]# fdisk -l /dev/sda
- Disk /dev/sda: 6442 MB, 6442450944 bytes
- 16 heads, 63 sectors/track, 12483 cylinders
- Units = cylinders of 1008 * 512 = 516096 bytes
- Sector size (logical/physical): 512 bytes / 512 bytes
- I/O size (minimum/optimal): 512 bytes / 512 bytes
- Disk identifier: 0x00053d18
- Device BootStart EndBlocks IdSystem
- /dev/sda1 * 1 104 51200 83Linux
- /dev/sda2 104 11076 5529600 8eLinux LVM
- /dev/sda3 11076 12116524288 82Linux swap / Solaris
- /dev/sda4 12116 124831853205Extended
- /dev/sda5 12116 12136 10400+83Linux
- /dev/sda6 12137 12157 10552+83Linux
- /dev/sda7 12158 12178 10552+83Linux
- /dev/sda8 12179 12199 10552+83Linux
- /dev/sda9 12200 12220 10552+83Linux
- /dev/sda1012221 12241 10552+83Linux
- /dev/sda1112242 12262 10552+83Linux
- /dev/sda1212263 12283 10552+83Linux
- /dev/sda1312284 12304 10552+83Linux
- /dev/sda1412305 12325 10552+83Linux
- /dev/sda1512326 12346 10552+83Linux
- /dev/sda1612347 12367 10552+83Linux
- [root@rhel6 ~]# mkfs.ext4 /dev/sda16//虽然可以划出15个以上的分区,但无法格式化使用
- mke2fs 1.41.12 (17-May-2010)
- Could not stat /dev/sda16 --- No such file or directory
- The device apparently does not exist; did you specify it correctly?
- [root@rhel6 ~]# ls /dev/sda16
- ls: cannot access /dev/sda16: No such file or directory
回环设备可以把文件虚拟成块设备(block device),以便模拟整个文件系统,这样用户可以将其看作是硬盘驱动器或者光驱等设备,并挂载当作文件系统来使用。这样系统还可以额外增加多个分区(默认只有loop0-loop7)
- losetup
- -a显示所有已经使用的回环设备状态
- -d卸除回环设备
- -f寻找第一个未使用的回环设备
- -e<加密选项> 启动加密编码
- [root@rhel6 ~]# losetup -f//查找第一个未使用的回环设备
- /dev/loop0
- [root@rhel6 ~]# losetup -a//显示所有已经使用的回环设备状态
- [root@rhel6 ~]# dd if=/dev/zero of=loop.img bs=10M count=10
- 10+0 records in
- 10+0 records out
- 104857600 bytes (105 MB) copied, 0.794912 s, 132 MB/s
- [root@rhel6 ~]# losetup -f loop.img //将 loop.img 虚拟成第一个未使用的回环设备
- [root@rhel6 ~]# losetup -a
- /dev/loop0: [fd00]:26524 (/root/loop.img)
- [root@rhel6 ~]# losetup -f
- /dev/loop1
- [root@rhel6 ~]# mkfs.ext4 /dev/loop0
- [root@rhel6 ~]# mount /dev/loop0 /mnt/
- [root@rhel6 ~]# df -h
- FilesystemSizeUsed Avail Use% Mounted on
- /dev/mapper/Lrhel6-root
- 3.9G2.4G1.4G64% /
- tmpfs 499M 0499M 0% /dev/shm
- /dev/sda149M 27M 20M59% /boot
- /dev/loop0 97M5.6M 87M 7% /mnt
- [root@rhel6 ~]# umount /mnt/
- [root@rhel6 ~]# losetup -d /dev/loop0 //卸除回环设备
通过rescue的Skip模式克隆Linux系统Linux计划任务(at batch crontab anacron)相关资讯 文件系统 losetup 块设备
- losetup命令:设置循环设备 (07月04日)
- Ubuntu 将正式支持 ZFS 文件系统 (10/07/2015 15:22:03)
- 磁盘文件系统 (04/26/2014 09:56:12)
| - 如何选择文件系统:EXT4、Btrfs 和 (03月09日)
- Ceph文件系统与原生磁盘读写性能的 (06/11/2014 08:28:36)
- 制作LXC文件系统 (11/13/2013 13:44:11)
|
本文评论 查看全部评论 (0)