Montar atualizações / proc / mount, mas não / etc / mtab, fazendo com que a partição não apareça no df, monte listando

2

Eu estou no RHEL 6. Eu criei algumas partições usando parted, formatei-as usando o mke2fs e as montei usando o mount. Eu também os adicionei ao / etc / fstab. No entanto, eles não aparecem nas listagens mount ou df.

$ df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/vda1              20G  1.9G   17G  10% /
tmpfs                  58G     0   58G   0% /dev/shm

$ mount
/dev/vda1 on / type ext4 (rw)
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)
none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
sunrpc on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw)

$ cat /etc/mtab
/dev/vda1 / ext4 rw 0 0
proc /proc proc rw 0 0
sysfs /sys sysfs rw 0 0
devpts /dev/pts devpts rw,gid=5,mode=620 0 0
tmpfs /dev/shm tmpfs rw 0 0
none /proc/sys/fs/binfmt_misc binfmt_misc rw 0 0
sunrpc /var/lib/nfs/rpc_pipefs rpc_pipefs rw 0 0

No entanto, as partições aparecem como montadas em / proc / mounts:

$ cat /proc/mounts
rootfs / rootfs rw 0 0
proc /proc proc rw,nosuid,nodev,noexec,relatime 0 0
sysfs /sys sysfs rw,nosuid,nodev,noexec,relatime 0 0
devtmpfs /dev devtmpfs rw,nosuid,relatime,size=60487100k,nr_inodes=15121775,mode=755 0 0
devpts /dev/pts devpts rw,relatime,gid=5,mode=620,ptmxmode=000 0 0
tmpfs /dev/shm tmpfs rw,nosuid,nodev,relatime 0 0
/dev/vda1 / ext4 rw,relatime,barrier=1,data=ordered 0 0
/proc/bus/usb /proc/bus/usb usbfs rw,relatime 0 0
none /proc/sys/fs/binfmt_misc binfmt_misc rw,relatime 0 0
sunrpc /var/lib/nfs/rpc_pipefs rpc_pipefs rw,relatime 0 0
/etc/auto.misc /misc autofs rw,relatime,fd=7,pgrp=2265,timeout=300,minproto=5,maxproto=5,indirect 0 0
-hosts /net autofs rw,relatime,fd=13,pgrp=2265,timeout=300,minproto=5,maxproto=5,indirect 0 0
/dev/vdb1 /mnt ext4 rw,relatime,barrier=1,data=ordered 0 0
/dev/vdc1 /disks/vdc1 ext4 rw,relatime,barrier=1,data=ordered 0 0
/dev/vdd1 /disks/vdd1 ext4 rw,relatime,barrier=1,data=ordered 0 0
/dev/vde1 /disks/vde1 ext4 rw,relatime,barrier=1,data=ordered 0 0
/dev/vdf1 /disks/vdf1 ext4 rw,relatime,barrier=1,data=ordered 0 0
/dev/vdg1 /disks/vdg1 ext4 rw,relatime,barrier=1,data=ordered 0 0
/dev/vdh1 /disks/vdh1 ext4 rw,relatime,barrier=1,data=ordered 0 0
/dev/vdi1 /disks/vdi1 ext4 rw,relatime,barrier=1,data=ordered 0 0
/dev/vdj1 /disks/vdj1 ext4 rw,relatime,barrier=1,data=ordered 0 0
/dev/vdk1 /disks/vdk1 ext4 rw,relatime,barrier=1,data=ordered 0 0

Sobrescrever o / etc / mtab com o acima faz o trabalho do df:

# cat /proc/mounts > /etc/mtab

$ df -h
Filesystem            Size  Used Avail Use% Mounted on
rootfs                 20G  1.9G   17G  10% /
devtmpfs               58G  232K   58G   1% /dev
tmpfs                  58G     0   58G   0% /dev/shm
/dev/vda1              20G  1.9G   17G  10% /
/dev/vdb1             2.7T  202M  2.6T   1% /mnt
/dev/vdc1             2.7T  201M  2.6T   1% /disks/vdc1
/dev/vdd1             2.7T  201M  2.6T   1% /disks/vdd1
/dev/vde1             2.7T  201M  2.6T   1% /disks/vde1
/dev/vdf1             2.7T  201M  2.6T   1% /disks/vdf1
/dev/vdg1             2.7T  201M  2.6T   1% /disks/vdg1
/dev/vdh1             2.7T  201M  2.6T   1% /disks/vdh1
/dev/vdi1             2.7T  201M  2.6T   1% /disks/vdi1
/dev/vdj1             2.7T  201M  2.6T   1% /disks/vdj1
/dev/vdk1             2.7T  201M  2.6T   1% /disks/vdk1

Isso me leva além do problema imediato, mas eu ainda gostaria de entender porque o mount não atualizou o / etc / mtab corretamente. Alguma idéia?

Editar : Conforme solicitado, saída de fdisk -l:

$ sudo fdisk -l

Disk /dev/vda: 21.5 GB, 21474836480 bytes
43 heads, 16 sectors/track, 60963 cylinders
Units = cylinders of 688 * 512 = 352256 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00054b77

   Device Boot      Start         End      Blocks   Id  System
/dev/vda1               3       60964    20970496   83  Linux

WARNING: GPT (GUID Partition Table) detected on '/dev/vdb'! The util fdisk doesn't support GPT. Use GNU Parted.


Disk /dev/vdb: 3000.0 GB, 2999999004672 bytes
255 heads, 63 sectors/track, 364729 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

   Device Boot      Start         End      Blocks   Id  System
/dev/vdb1               1      267350  2147483647+  ee  GPT

WARNING: GPT (GUID Partition Table) detected on '/dev/vdc'! The util fdisk doesn't support GPT. Use GNU Parted.


Disk /dev/vdc: 3000.0 GB, 2999999004672 bytes
255 heads, 63 sectors/track, 364729 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

   Device Boot      Start         End      Blocks   Id  System
/dev/vdc1               1      267350  2147483647+  ee  GPT

WARNING: GPT (GUID Partition Table) detected on '/dev/vdd'! The util fdisk doesn't support GPT. Use GNU Parted.


Disk /dev/vdd: 3000.0 GB, 2999999004672 bytes
255 heads, 63 sectors/track, 364729 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

   Device Boot      Start         End      Blocks   Id  System
/dev/vdd1               1      267350  2147483647+  ee  GPT

WARNING: GPT (GUID Partition Table) detected on '/dev/vde'! The util fdisk doesn't support GPT. Use GNU Parted.


Disk /dev/vde: 3000.0 GB, 2999999004672 bytes
255 heads, 63 sectors/track, 364729 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

   Device Boot      Start         End      Blocks   Id  System
/dev/vde1               1      267350  2147483647+  ee  GPT

WARNING: GPT (GUID Partition Table) detected on '/dev/vdf'! The util fdisk doesn't support GPT. Use GNU Parted.


Disk /dev/vdf: 3000.0 GB, 2999999004672 bytes
255 heads, 63 sectors/track, 364729 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

   Device Boot      Start         End      Blocks   Id  System
/dev/vdf1               1      267350  2147483647+  ee  GPT

WARNING: GPT (GUID Partition Table) detected on '/dev/vdg'! The util fdisk doesn't support GPT. Use GNU Parted.


Disk /dev/vdg: 3000.0 GB, 2999999004672 bytes
255 heads, 63 sectors/track, 364729 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

   Device Boot      Start         End      Blocks   Id  System
/dev/vdg1               1      267350  2147483647+  ee  GPT

WARNING: GPT (GUID Partition Table) detected on '/dev/vdh'! The util fdisk doesn't support GPT. Use GNU Parted.


Disk /dev/vdh: 3000.0 GB, 2999999004672 bytes
255 heads, 63 sectors/track, 364729 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

   Device Boot      Start         End      Blocks   Id  System
/dev/vdh1               1      267350  2147483647+  ee  GPT

WARNING: GPT (GUID Partition Table) detected on '/dev/vdi'! The util fdisk doesn't support GPT. Use GNU Parted.


Disk /dev/vdi: 3000.0 GB, 2999999004672 bytes
255 heads, 63 sectors/track, 364729 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

   Device Boot      Start         End      Blocks   Id  System
/dev/vdi1               1      267350  2147483647+  ee  GPT

WARNING: GPT (GUID Partition Table) detected on '/dev/vdj'! The util fdisk doesn't support GPT. Use GNU Parted.


Disk /dev/vdj: 3000.0 GB, 2999999004672 bytes
255 heads, 63 sectors/track, 364729 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

   Device Boot      Start         End      Blocks   Id  System
/dev/vdj1               1      267350  2147483647+  ee  GPT

WARNING: GPT (GUID Partition Table) detected on '/dev/vdk'! The util fdisk doesn't support GPT. Use GNU Parted.


Disk /dev/vdk: 3000.0 GB, 2999999004672 bytes
255 heads, 63 sectors/track, 364729 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

   Device Boot      Start         End      Blocks   Id  System
/dev/vdk1               1      267350  2147483647+  ee  GPT
    
por Leons 23.04.2013 / 23:08

1 resposta

1

Isso aconteceu comigo depois que cometi o erro de editar /etc/mtab manualmente. Há uma razão pela qual todo manual de existência diz - apenas não faça isso :) A edição em si era inofensiva - eu tinha renomeado um grupo de volume LVM de um volume lógico montado, e precisava de uma atualização trivial para sua entrada mtab mount -a pararia de relatar erros espúrios. O problema é que meu editor deixou um arquivo de backup simples em /etc/mtab~ .

Todas as invocações de mount(8) pararam de atualizar mtab e começaram a demorar ~ 30 segundos para serem executadas, o que era bastante suspeito. Infelizmente, nem mesmo imprimiu um aviso, foi necessário um strace para descobrir isso:

% sudo strace mount /something
[...]
link("/etc/mtab~.10889", "/etc/mtab~")  = -1 EEXIST (File exists)
open("/etc/mtab~", O_WRONLY)            = 3
[...]
unlink("/etc/mtab~.10889")              = 0
[...]

Ele fez esse conjunto de link() e open() chamadas em um loop, mas acabou desistindo e fez o unlink() de seu arquivo temporário.

A solução foi simplesmente remover manualmente esse backup em /etc/mtab~ .

    
por 30.09.2016 / 15:26

Tags