如何制作原始 /etc/fstab?

如何制作原始 /etc/fstab?

如何制作原始 /etc/fstab ?? 谢谢

root@Gateway:~# fdisk -l

Disk /dev/sda: 80.0 GB, 80026361856 bytes
255 heads, 63 sectors/track, 9729 cylinders, total 156301488 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: 0x00033c3d

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *        2048    70311935    35154944   83  Linux
/dev/sda2        70311936   148436991    39062528   83  Linux
/dev/sda3       148439038   156301311     3931137    5  Extended
/dev/sda5       148439040   156301311     3931136   82  Linux swap / Solaris

Disk /dev/mapper/cryptswap1: 4025 MB, 4025483264 bytes
255 heads, 63 sectors/track, 489 cylinders, total 7862272 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: 0x27dc0ef5

Disk /dev/mapper/cryptswap1 doesn't contain a valid partition table
root@Gateway:~#

答案1

有关如何重新创建 fstab 的示例可以在以下位置找到:ubuntuforums.org

您需要以下结果:

$ sudo blkid
/dev/sda1: LABEL="EFI" UUID="3F3C-1AF6" TYPE="vfat"
/dev/sda2: UUID="83062D46C78FDD33" LABEL="Macintosh HD" TYPE="hfsplus"
/dev/sda3: UUID="9A1C07811C075821" TYPE="ntfs"
/dev/sda4: UUID="58e05acc-a255-48c7-ac8a-acbf5a7764c9" TYPE="ext3"
/dev/sda5: TYPE="swap" UUID="dc91869f-897e-47d1-a472-98551ae03fa5"

以及:

$ cat /etc/mtab
/dev/sda4 / ext3 rw,relatime,errors=remount-ro 0 0
tmpfs /lib/init/rw tmpfs rw,nosuid,mode=0755 0 0
proc /proc proc rw,noexec,nosuid,nodev 0 0
sysfs /sys sysfs rw,noexec,nosuid,nodev 0 0
varrun /var/run tmpfs rw,nosuid,mode=0755 0 0
varlock /var/lock tmpfs rw,noexec,nosuid,nodev,mode=1777 0 0
udev /dev tmpfs rw,mode=0755 0 0
tmpfs /dev/shm tmpfs rw,nosuid,nodev 0 0
devpts /dev/pts devpts rw,noexec,nosuid,gid=5,mode=620 0 0
fusectl /sys/fs/fuse/connections fusectl rw 0 0
lrm /lib/modules/2.6.28-17-generic/volatile tmpfs rw,mode=755 0 0
securityfs /sys/kernel/security securityfs rw 0 0
binfmt_misc /proc/sys/fs/binfmt_misc binfmt_misc rw,noexec,nosuid,nodev 0 0
gvfs-fuse-daemon /home/dan/.gvfs fuse.gvfs-fuse-daemon rw,nosuid,nodev,user=dan 0 0

使用这些结果,您可以重新创建 fstab 文件。根据示例,它将是:

# /etc/fstab: static file system information.
#
# <file system> <mount point>   <type>  <options>       <dump>  <pass>
proc            /proc           proc    defaults        0       0
# /dev/sda4
UUID=58e05acc-a255-48c7-ac8a-acbf5a7764c9 / ext3 relatime,errors=remount-ro 0 1
# /dev/sda5
UUID=dc91869f-897e-47d1-a472-98551ae03fa5 none swap defaults 0 0

但是你的 /etc/fstab 会有所不同。你将拥有不同的 UUID、不同的磁盘,并且可以拥有不同的挂载选项。

相关内容