做一个df -h
:
alvas@mt:~$ df -h
Filesystem Size Used Avail Use% Mounted on
/dev/sda2 3.5T 2.7T 597G 83% /
none 4.0K 0 4.0K 0% /sys/fs/cgroup
udev 63G 12K 63G 1% /dev
tmpfs 13G 1.8M 13G 1% /run
none 5.0M 0 5.0M 0% /run/lock
none 63G 72K 63G 1% /run/shm
none 100M 20K 100M 1% /run/user
/dev/sdd5 1.8T 1005G 718G 59% /media/2tb
/dev/sdd1 1.9T 1.2T 531G 70% /media/2moretb
/dev/sde1 1.9T 214G 1.7T 12% /media/shiny
然后是sudo fdisk -l
:
alvas@mt:~$ sudo fdisk -l
WARNING: GPT (GUID Partition Table) detected on '/dev/sda'! The util fdisk doesn't support GPT. Use GNU Parted.
Disk /dev/sda: 4000.2 GB, 4000225165312 bytes
255 heads, 63 sectors/track, 486333 cylinders, total 7812939776 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: 0x00000000
Device Boot Start End Blocks Id System
/dev/sda1 1 4294967295 2147483647+ ee GPT
WARNING: GPT (GUID Partition Table) detected on '/dev/sdc'! The util fdisk doesn't support GPT. Use GNU Parted.
Disk /dev/sdc: 4000.2 GB, 4000225165312 bytes
255 heads, 63 sectors/track, 486333 cylinders, total 7812939776 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: 0x00000000
Device Boot Start End Blocks Id System
/dev/sdc1 1 4294967295 2147483647+ ee GPT
Disk /dev/sdd: 4000.2 GB, 4000225165312 bytes
255 heads, 63 sectors/track, 486333 cylinders, total 7812939776 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: 0x0003bd79
Device Boot Start End Blocks Id System
/dev/sdd1 3865466880 7812939775 1973736448 83 Linux
/dev/sdd2 501758 3865466879 1932482561 5 Extended
/dev/sdd5 503808 3865466879 1932481536 83 Linux
Partition table entries are not in disk order
WARNING: GPT (GUID Partition Table) detected on '/dev/sdb'! The util fdisk doesn't support GPT. Use GNU Parted.
Disk /dev/sdb: 4000.2 GB, 4000225165312 bytes
255 heads, 63 sectors/track, 486333 cylinders, total 7812939776 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: 0x00000000
Device Boot Start End Blocks Id System
/dev/sdb1 1 4294967295 2147483647+ ee GPT
Disk /dev/sde: 2000.4 GB, 2000365289472 bytes
255 heads, 63 sectors/track, 243197 cylinders, total 3906963456 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: 0x2ae33383
Device Boot Start End Blocks Id System
/dev/sde1 2048 3906963455 1953480704 7 HPFS/NTFS/exFAT
alvas@mt:~$
alvas@mt:~$ df -h
Filesystem Size Used Avail Use% Mounted on
/dev/sda2 3.5T 2.7T 597G 83% /
none 4.0K 0 4.0K 0% /sys/fs/cgroup
udev 63G 12K 63G 1% /dev
tmpfs 13G 1.8M 13G 1% /run
none 5.0M 0 5.0M 0% /run/lock
none 63G 72K 63G 1% /run/shm
none 100M 20K 100M 1% /run/user
/dev/sdd5 1.8T 1005G 718G 59% /media/2tb
/dev/sdd1 1.9T 1.2T 531G 70% /media/2moretb
/dev/sde1 1.9T 214G 1.7T 12% /media/shiny
alvas@mt:~$ sudo fdisk -l
WARNING: GPT (GUID Partition Table) detected on '/dev/sda'! The util fdisk doesn't support GPT. Use GNU Parted.
Disk /dev/sda: 4000.2 GB, 4000225165312 bytes
255 heads, 63 sectors/track, 486333 cylinders, total 7812939776 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: 0x00000000
Device Boot Start End Blocks Id System
/dev/sda1 1 4294967295 2147483647+ ee GPT
WARNING: GPT (GUID Partition Table) detected on '/dev/sdc'! The util fdisk doesn't support GPT. Use GNU Parted.
Disk /dev/sdc: 4000.2 GB, 4000225165312 bytes
255 heads, 63 sectors/track, 486333 cylinders, total 7812939776 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: 0x00000000
Device Boot Start End Blocks Id System
/dev/sdc1 1 4294967295 2147483647+ ee GPT
Disk /dev/sdd: 4000.2 GB, 4000225165312 bytes
255 heads, 63 sectors/track, 486333 cylinders, total 7812939776 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: 0x0003bd79
Device Boot Start End Blocks Id System
/dev/sdd1 3865466880 7812939775 1973736448 83 Linux
/dev/sdd2 501758 3865466879 1932482561 5 Extended
/dev/sdd5 503808 3865466879 1932481536 83 Linux
Partition table entries are not in disk order
WARNING: GPT (GUID Partition Table) detected on '/dev/sdb'! The util fdisk doesn't support GPT. Use GNU Parted.
Disk /dev/sdb: 4000.2 GB, 4000225165312 bytes
255 heads, 63 sectors/track, 486333 cylinders, total 7812939776 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: 0x00000000
Device Boot Start End Blocks Id System
/dev/sdb1 1 4294967295 2147483647+ ee GPT
Disk /dev/sde: 2000.4 GB, 2000365289472 bytes
255 heads, 63 sectors/track, 243197 cylinders, total 3906963456 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: 0x2ae33383
Device Boot Start End Blocks Id System
/dev/sde1 2048 3906963455 1953480704 7 HPFS/NTFS/exFAT
如何检查我的sdb
和sdc
驱动器是否已安装?如果已安装,它们安装在哪里?
**什么是GPT (GUID Partition Table)
? **
如何检查哪个磁盘已使用以及哪个磁盘仍为空白
如何将所有备用的未使用的驱动器安装到单个目录中?
如果不是单个目录,那么放入单独的目录中吗/media/
?
这很奇怪,因为fdisk
显示 5 个物理磁盘但mount
只能找到 2 个:
gillin@mt:~$ mount /dev/sda1
mount: can't find /dev/sda1 in /etc/fstab or /etc/mtab
gillin@mt:~$ mount /dev/sdb1
mount: can't find /dev/sdb1 in /etc/fstab or /etc/mtab
gillin@mt:~$ mount /dev/sdc1
mount: can't find /dev/sdc1 in /etc/fstab or /etc/mtab
gillin@mt:~$ mount /dev/sdd1
mount: according to mtab, /dev/sdd1 is already mounted on /media/2moretb
mount failed
gillin@mt:~$ mount /dev/sde1
mount: according to mtab, /dev/sde1 is already mounted on /media/shiny
mount failed
使用 gparted,我找到了sdb
sdc`,但它们未格式化,看起来未使用,但使用它真的安全吗?我的机器有一个 RAID 1/0 系统,但我不确定具体设置是什么。
如何确保格式化 sdb 和 sdc 是安全的?gparted 上的可用空间是否能确保这一点?
答案1
如何检查我的 sdb 和 sdc 驱动器是否已安装?如果已安装,它们安装在哪里?
要找出已安装的驱动器,您可以检查/etc/mtab
,它是系统上安装的所有设备的列表。有时它可能会安装各种 tmpf 和其他您不想安装的东西,所以我建议cat /etc/mtab | grep /dev/sd
只获取物理设备。
正如您在答案中所展示的,df 也有效,如果它没有出现在 df 中,则它没有被安装。
我如何将所有闲置的未使用驱动器安装到单个目录中?如果不是单个目录,则将其安装到 /media/ 中的单独目录中?
该文件/etc/fstab
包含系统上的驱动器列表以及何时、如何以及在何处安装它们的规则。当您输入mount /dev/sda1
mount 时,会检查 fstab 以获取有关如何安装磁盘的信息。mount: can't find /dev/sdc1 in /etc/fstab or /etc/mtab
意味着 mount 在 mtab 中找不到该磁盘的行,而不是它找不到磁盘本身。
您可以通过自己指定驱动器的安装位置来使 mount 不出现在 fstab 中,例如mkdir /media/sdb1; mount /dev/sdb1 /media/sdb1
如果您编辑 fstab 以添加备用驱动器的条目,则可以在启动时安装备用驱动器。
您可以安装 pysdm 以便轻松写入条目/etc/fstab
。
如何检查哪个磁盘已被使用以及哪个磁盘仍为空白磁盘[?]
最好的方法可能是尝试在其上安装任何分区并查看数据。根据 gparted 的屏幕截图/dev/sdb1
,/dev/sdc1
看起来已格式化并有数据。Gparted 在未格式化驱动器的“已用空间”列中没有任何内容,因为您无法使用未格式化驱动器上的空间。
什么是 GPT?
它是磁盘开头的标头,用于描述磁盘上不同分区的开始和结束位置,以及有关它们的一些元数据。它取代了执行此任务的旧格式 MBR(主引导记录),并保持了与旧格式的兼容性。
答案2
mount
查看所有当前已安装的磁盘。您可以使用mount /dev/sdXY /mnt/DISK
手动安装磁盘,其中 X 代表磁盘编号,Y 代表分区编号,“DISK”是安装点。此“DISK”目录对于每个磁盘应该不同,并且应该在安装之前存在