CentOS7/Tips


xrdpインストール

# yum install xrdp
# systemctl start xrdp
# systemctl enable xrdp

これでWindowsからリモートデスクトップできる。

yum updateしたら yum doesn't have enough cached data to continue

yum updateしたら下記のエラー
# yum upgrade
読み込んだプラグイン:fastestmirror
Determining fastest mirrors


 One of the configured repositories failed (不明),
 and yum doesn't have enough cached data to continue. At this point the only
 safe thing yum can do is fail. There are a few ways to work "fix" this:

     1. Contact the upstream for the repository and get them to fix the problem.

     2. Reconfigure the baseurl/etc. for the repository, to point to a working
        upstream. This is most often useful if you are using a newer
        distribution release than is supported by the repository (and the
        packages for the previous distribution release still work).

     3. Run the command with the repository temporarily disabled
            yum --disablerepo=<repoid> ...

     4. Disable the repository permanently, so yum won't use it by default. Yum
        will then just ignore the repository until you permanently enable it
        again or use --enablerepo for temporary usage:

            yum-config-manager --disable <repoid>
        or
            subscription-manager repos --disable=<repoid>

     5. Configure the failing repository to be skipped, if it is unavailable.
        Note that yum will try to contact the repo. when it runs most commands, 
        so will have to try and fail each time (and thus. yum will be be much
        slower). If it is a very temporary problem though, this is often a nice
        compromise:

            yum-config-manager --save --setopt=<repoid>.skip_if_unavailable=true

Cannot retrieve metalink for repository: epel/x86_64. Please verify its path and try again
epelがなんかだめだったらしいので削除した
# yum remove epel-release


state change: ip-config -> failed (reason 'ip-config-unavailable', sys-iface-state: 'managed')とかstate change: failed -> disconnected (reason 'none', sys-iface-state: 'managed')とか

サーバーに繋がったり繋がらなかったりが続いてたと聞き、messages見たらこれが延々と出力されていた。
NetworkManager[678]: <info>  [1561363993.4632] device (eth2): state change: ip-config -> failed (reason 'ip-config-unavailable', sys-iface-state: 'managed')
NetworkManager[678]: <warn>  [1561363993.4640] device (eth2): Activation: failed for connection 'eth2'
NetworkManager[678]: <info>  [1561363993.4647] device (eth2): state change: failed -> disconnected (reason 'none', sys-iface-state: 'managed')
こいつ自身はKVMの仮想サーバーで他にもいくつかネットワークインターフェースを持っているのに、なぜかeth2だけでこのログが出ている。
エラーでググってみたらNetworkManager止めろ
⇒やだ
だとかDHCPクライアントを変えてみろ
⇒固定IPでDHCPじゃない
だとか出てくる。

だめもとでeth2を作り直したら元に戻った感じ。
なんだったんだ・・・

CentOS7でpartedからresizeできない

CentOS7のpartedを使ってパーティションのリサイズしようと思ったら、resizeのコマンドが存在していないようだった。

redhatのサイトを見てみたら、fdiskを使ってやるようにマニュアルが変わっていた。

とりあえず拡張であれば開始セクタが同じかその手前であればパーティションを作り直しでもデータは消えないようなので、以下手順。
# fdisk /dev/sdb

コマンド (m でヘルプ): p

Disk /dev/sdb: 536.9 GB, 536870912000 bytes, 1048576000 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O サイズ (最小 / 推奨): 512 バイト / 512 バイト
Disk label type: dos
ディスク識別子: 0x00037b69

デバイス ブート      始点        終点     ブロック   Id  システム
/dev/sdb1   *        2048      411647      204800   83  Linux
/dev/sdb2          411648     4507647     2048000   82  Linux swap / Solaris
/dev/sdb3         4507648    83886079    39689216   8e  Linux LVM
削除
コマンド (m でヘルプ): d
パーティション番号 (1-3, default 3): 3
Partition 3 is deleted
確認
コマンド (m でヘルプ): p

Disk /dev/sdb: 536.9 GB, 536870912000 bytes, 1048576000 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O サイズ (最小 / 推奨): 512 バイト / 512 バイト
Disk label type: dos
ディスク識別子: 0x00037b69

デバイス ブート      始点        終点     ブロック   Id  システム
/dev/sdb1   *        2048      411647      204800   83  Linux
/dev/sdb2          411648     4507647     2048000   82  Linux swap / Solaris
新規作成
コマンド (m でヘルプ): n
Partition type:
   p   primary (2 primary, 0 extended, 2 free)
   e   extended
Select (default p):
Using default response p
パーティション番号 (3,4, default 3):
最初 sector (4507648-1048575999, 初期値 4507648):
初期値 4507648 を使います
Last sector, +sectors or +size{K,M,G} (4507648-1048575999, 初期値 1048575999):
初期値 1048575999 を使います
Partition 3 of type Linux and of size 497.9 GiB is set
確認
コマンド (m でヘルプ): p

Disk /dev/sdb: 536.9 GB, 536870912000 bytes, 1048576000 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O サイズ (最小 / 推奨): 512 バイト / 512 バイト
Disk label type: dos
ディスク識別子: 0x00037b69

デバイス ブート      始点        終点     ブロック   Id  システム
/dev/sdb1   *        2048      411647      204800   83  Linux
/dev/sdb2          411648     4507647     2048000   82  Linux swap / Solaris
/dev/sdb3         4507648  1048575999   522034176   83  Linux
ラベル変更
コマンド (m でヘルプ): t
パーティション番号 (1-3, default 3): 3
Hex code (type L to list all codes): 8e
Changed type of partition 'Linux' to 'Linux LVM'

コマンド (m でヘルプ): p

Disk /dev/sdb: 536.9 GB, 536870912000 bytes, 1048576000 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O サイズ (最小 / 推奨): 512 バイト / 512 バイト
Disk label type: dos
ディスク識別子: 0x00037b69

デバイス ブート      始点        終点     ブロック   Id  システム
/dev/sdb1   *        2048      411647      204800   83  Linux
/dev/sdb2          411648     4507647     2048000   82  Linux swap / Solaris
/dev/sdb3         4507648  1048575999   522034176   8e  Linux LVM

コマンド (m でヘルプ): w
パーティションテーブルは変更されました!
これで普通に起動してきましたので、あとはresize2fsとかでなんとかして頂ければと。
縮小の場合はやり方違うので、機会があれば書きます。

  • 最終更新:2021-06-22 18:35:14

このWIKIを編集するにはパスワード入力が必要です

認証パスワード