2019年9月24日火曜日

NAS・LS210D - Debian Server 仮死状態からの復旧・その3

最初に IP アドレスを固定化します。



まずは、既存の設定内容を確認します。





debian:/# cat /etc/network/interfaces

# This file describes the network interfaces available on your system

# and how to activate them. For more information, see interfaces(5).



source /etc/network/interfaces.d/*



# The loopback network interface

auto lo

iface lo inet loopback



# The primary network interface

allow-hotplug eth0

iface eth0 inet dhcp

hwaddress ether [MAC アドレス]





vi で編集します。



"iface eth0 inet dhcp" 行の dhcp を削除し、そこから "static〜〜〜" と挿入していきます。

"dns-servers 1.1.1.1 1.0.0.1" 行まで入力を終えたら [escキー] :wq で vi を終了します。



debian:/# vi /etc/network/interfaces

# This file describes the network interfaces available on your system

# and how to activate them. For more information, see interfaces(5).



source /etc/network/interfaces.d/*



# The loopback network interface

auto lo

iface lo inet loopback



# The primary network interface

allow-hotplug eth0

iface eth0 inet static
address 192.168.0.100
netmask 255.255.255.0
gateway 192.168.0.1
dns-servers 1.1.1.1 1.0.0.1


hwaddress ether [MAC アドレス]



:wq



debian:/#



アドレスを固定 IP 設定にしたらリブートします。



debian:/# reboot



一旦 ssh 接続が切れるので設定した IP アドレスでログインし直します。



Mac:~ $ ssh username@192.168.0.100

username@192.168.0.100's password: [username のパスワード]

Linux debian 4.9.0-11-armmp #1 SMP Debian 4.9.189-3 (2019-09-02) armv7l



The programs included with the Debian GNU/Linux system are free software;

the exact distribution terms for each program are described in the

individual files in /usr/share/doc/*/copyright.



Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent

permitted by applicable law.

Last login: Tue Sep 24 17:43:13 2019 from 192.168.0.100

debian:~$







次に NAS で使用時のデータが格納されているディスク領域を探し、これをマウントします。



fdisk -l でデータが格納されいるデバイス名を得ます。



/dev/sda6 917.2G というのがデーター領域です。





次にこのデバイスの UUID を得るため、blkid /dev/sda6 を実行します。



debian:/# blkid /dev/sda6

/dev/sda6: UUID="e9e03e87-dd0d-4a20-acbe-c4c0c99597c2" TYPE="xfs" PARTLABEL="primary" PARTUUID="bf8969b8-6d48-4d1b-9633-b8a9ee8ea722"





これを因縁の fstab に設定します。





まずは現在の fstab を確認します。



debian:/# cat /etc/fstab

# /etc/fstab: static file system information.

#

# Use 'blkid' to print the universally unique identifier for a

# device; this may be used with UUID= as a more robust way to name devices

# that works even if disks are added and removed. See fstab(5).

#

#              
# / was on /dev/sda2 during installation
UUID=5bc2a37f-35df-4b3f-b23d-f16889fd03d9 /               ext3    errors=remount-ro 0       1
# /boot was on /dev/sda1 during installation
UUID=c4132975-d466-403d-9211-472f1eb7d899 /boot           ext3    defaults        0       2
# swap was on /dev/sda5 during installation
UUID=973d5117-5981-47ef-af79-636c5b39904a none            swap    sw              0       0



vi /etc/fstab で最終行に以下の2行を追加します(/dev/sda6 のマウントポイントを /home/username とします)

# data region
UUID=e9e03e87-dd0d-4a20-acbe-c4c0c99597c2 /home/username xfs defaults,noatime 0 2




前回、おかしくなったときは次のようにしていました。



# data region

/dev/sda6 /home/username ext3 defaults,noatime 0 2





これはこれでいいはずだったのですが、UUID 指定でないとうまくないか、type を誤って ext3 に設定したのが悪かったのか、おそらく前者でしょう。







再びリブートしてマウントされているかを確認します。





debian:~$ df -h

ファイルシス   サイズ  使用  残り 使用% マウント位置

udev             105M     0  105M    0% /dev

tmpfs             25M  716K   24M    3% /run

/dev/sda2        4.6G  792M  3.6G   18% /

tmpfs            121M     0  121M    0% /dev/shm

tmpfs            5.0M     0  5.0M    0% /run/lock

tmpfs            121M     0  121M    0% /sys/fs/cgroup

/dev/sda6        917G  419G  499G   46% /home/username

/dev/sda1        953M  260M  694M   28% /boot

tmpfs             25M     0   25M    0% /run/user/1000

debian:~$ ls -l /home/username

合計 8

drwxrwxrwx 8 root root 4096  9月 22 07:07 Data

drwx------ 2 root root   22 12月 20  2015 mt-daapd

drwxrwxrwx 7 root root 4096  9月 22 07:07 share

drwxrwxrwx 5 root root   42 12月 15  2018 spool

debian:~$





***** ちゃんとマウントされました *****





>> 次回(その4)に続きます






















0 件のコメント:

コメントを投稿