我有4个硬盘。我只是在所有这些中创建一个分区。我用ext 3格式化它们。然后我重写fstab
好吧,我会在 fstab 中添加几行
#
# /etc/fstab
# Created by anaconda on Wed Dec 19 15:22:22 2012
#
# Accessible filesystems, by reference, are maintained under '/dev/disk'
# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info
#
/dev/mapper/VolGroup-lv_root / ext4 usrjquota=quota.user,jqfmt=vfsv0 1 1
UUID=1450c2bf-d431-4621-9e8e-b0be57fd79b6 /boot ext4 defaults 1 2
/dev/mapper/VolGroup-lv_home /home ext4 usrjquota=quota.user,jqfmt=vfsv0 1 2
/dev/mapper/VolGroup-lv_swap swap swap defaults 0 0
tmpfs /dev/shm tmpfs defaults 0 0
devpts /dev/pts devpts gid=5,mode=620 0 0
sysfs /sys sysfs defaults 0 0
proc /proc proc defaults 0 0
/usr/tmpDSK /tmp ext3 defaults,noauto 0 0
/home2 /dev/sdb1 auto auto,defaults 0 3
/home3 /dev/sdc1 auto auto,defaults 0 4
/home4 /dev/sdd1 auto auto,defaults 0 5
我这样做正确吗?
有什么改进的建议吗?
我想知道为什么 /dev/sda1 现在出现在 fstat 中。
所以我只是改变这个,然后重新启动服务器,对吗?
这是 fdisk -l 的结果
root@host [/home/freemark/backup]# fdisk -l
Disk /dev/sda: 1500.3 GB, 1500301910016 bytes
255 heads, 63 sectors/track, 182401 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x0009e006
Device Boot Start End Blocks Id System
/dev/sda1 * 1 64 512000 83 Linux
Partition 1 does not end on cylinder boundary.
/dev/sda2 64 182402 1464625152 8e Linux LVM
Disk /dev/sdb: 1500.3 GB, 1500301910016 bytes
255 heads, 63 sectors/track, 182401 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x0007ad8f
Device Boot Start End Blocks Id System
/dev/sdb1 1 182401 1465136001 8e Linux LVM
Disk /dev/sdd: 1500.3 GB, 1500301910016 bytes
255 heads, 63 sectors/track, 182401 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x000e43c4
Device Boot Start End Blocks Id System
/dev/sdd1 1 182401 1465136001 8e Linux LVM
Disk /dev/sdc: 1500.3 GB, 1500301910016 bytes
255 heads, 63 sectors/track, 182401 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x0006f9d9
Device Boot Start End Blocks Id System
/dev/sdc1 1 182401 1465136001 8e Linux LVM
Disk /dev/mapper/VolGroup-lv_root: 53.7 GB, 53687091200 bytes
255 heads, 63 sectors/track, 6527 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000
Disk /dev/mapper/VolGroup-lv_swap: 36.0 GB, 35953573888 bytes
255 heads, 63 sectors/track, 4371 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000
Disk /dev/mapper/VolGroup-lv_home: 1410.1 GB, 1410133393408 bytes
255 heads, 63 sectors/track, 171438 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000
重启后还是无法访问/homne2 /home3/和/home4
一切也变得如此缓慢。
首先,auto 和 defaults 之间有一个空格。我删除了它并再次重新启动。现在一切正常。仍然没有/home2
如果我输入 mounts
我有
root@host [/etc]# mount
/dev/mapper/VolGroup-lv_root on / type ext4 (rw,usrjquota=quota.user,jqfmt=vfsv0)
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
devpts on /dev/pts type devpts (rw,gid=5,mode=620)
tmpfs on /dev/shm type tmpfs (rw,rootcontext="system_u:object_r:tmpfs_t:s0")
/dev/sda1 on /boot type ext4 (rw)
/dev/mapper/VolGroup-lv_home on /home type ext4 (rw,usrjquota=quota.user,jqfmt=vfsv0)
none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
/usr/tmpDSK on /tmp type ext3 (rw,noexec,nosuid,loop=/dev/loop0)
/tmp on /var/tmp type none (rw,noexec,nosuid,bind)
sunrpc on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw)
更新:看起来我犯了一个错误。挂载名称应位于第二列。在任何人回答之前,让我先解决这个问题。
fstab
您颠倒了文件的语法。设备名称在第一个字段中,挂载点在第二个字段中:/dev/sdd1 /home4 auto auto, defaults 0 5
/dev/sda1 没有出现,因为它是通过以下方式引用的
UUID
:UUID=1450c2bf-d431-4621-9e8e-b0be57fd79b6 /boot ext4 defaults 1 2
通常不需要在
/etc/fstab
编辑mount /home4
到fstab
.此外,您的磁盘似乎被分区为 LVM 分区,而不是 Linux 分区。您打算将这些磁盘添加到您的
/home
LVM 卷吗?这是我建议做的事情(并且可能将 RAID 与这么多磁盘混合使用),但您必须采取完全不同的方式(在 SF 或谷歌上搜索 LVM)。