Почему «df -h» не отображает точку монтирования /home?

Ваш код представляет собой любопытную смесь TCL и оболочки, и, вероятно, его следует писать только в одном из них. С TCL это может выглядеть примерно так

#!/usr/bin/expect

set timeout 5

# TCL has time functions, no need to call out to `date`...
set epoch    [clock seconds]
set outfile  "VS-HV-Report_[clock format $epoch -format "%Y"].txt"
set date     [clock format $epoch -format "%d-%B-%Y"]

# "yes | cp -i..." is very strange; why the interactive flag and then
# in turn ignoring that with the "yes |" pipe from non-interactive code?
#spawn sh -c "yes | cp -ifr.ssh/VS-HV-config.ssh/config"
exec cp -f.ssh/VS-HV-config.ssh/config

# TCL can do I/O, let's use that instead of forking sh processes...
#spawn sh -c "> VS-HV-Report_2017.txt"
set outfh [open $outfile w+]

# and a TCL loop instead of the duplicated spawn-to-host code...
set hostlist {L1n L2n L3n}
foreach host $hostlist {
    set done_auth 0

    # Spawn sh to spawn ssh is mighty complicated; let's instead just
    # call ssh directly (and catch any errors...)
    #spawn sh -c "ssh L1n \"./info.py | sed 's/total.*//g'\" >> VS-HV-Report_2017.txt"
    if { [catch {spawn ssh $host {./info.py | sed 's/total.*//g'}} msg] } {
        puts $outfh "SSHFAIL $host $msg"
        continue
    }

    while 1 {
        expect {
            -re {Enter passphrase for key '[^']+': } {
                # since in loop (because EOF or timeout could happen
                # anywhere) must only auth once in the event the remote
                # side is up to no good
                if {$done_auth == 0} {
                    send "hasapass\r"
                    set done_auth 1
                }
            }
            # remember that set timeout thing? there's a hook for it.
            timeout {
                puts $outfh "TIMEOUT $host $timeout"
                break
            }
            # dump whatever "server data" returned into the output
            # file (match_max might be relevant reading if there's a
            # lot of data) when the connection closes
            eof {
                puts $outfh $expect_out(buffer)
                break
            }
        }
    }
}

close $outfh

exec./format-VS-HV.sh > /root/format-allinement-output/format-allinement-output-$date.csv
0
06.06.2019, 20:12
1 ответ

Судя по выводам из df -h, ваш раздел /dev/sda5 вообще не смонтирован.

Помните, что команда df показывает только смонтированные разделы (, исключая разделы подкачки ). Если ваш раздел не смонтирован, он не будет отображаться при вводе команды df.

Как видно из введенной вами команды df -h, отображается только sda7, а sda5 и sda6 нет, потому что один из них является свопом, а другой даже не смонтирован --, следовательно, он не t показывает, когда используется df -h.

Чтобы смонтировать раздел dev/sda5, вы можете использовать команду mountи смонтировать его в каталог по вашему выбору. Пример:

mount /dev/sda5 /home/bob

Это смонтирует раздел sda5 в домашнюю директорию пользователя 'bob'.

Как только это будет сделано, команда df покажет точку монтирования /home для раздела /dev/sda5.

FСТАБ

Для постоянного монтирования, при котором разделы будут монтироваться автоматически при загрузке, необходимо отредактировать файл /etc/fstab. Вам нужно добавить его в /etc/fstab, используя ваш любимый текстовый редактор.

Будьте осторожны с этим файлом, так как он может легко привести к тому, что ваша система не загрузится.


#device      mountpoint             fstype    options  dump    fsck

/dev/sdb1    /home/yourname/mydata    ext4    defaults    0    1

4
28.01.2020, 02:30

Теги

Похожие вопросы