Jan 20, 2017

Restore linux server in as is state from restricted mode

Issue: Recently I faced ..
After rebooting server, GUI window not coming. Server only able to start in restrict mode. NAS storage is attached to server. What could be the reason? How it will be fixed and server can be started in good condition again?

Ans:
I did below workaround to fix the issue.


-- before reboot server ( for NAS connected)

step-1: umount NAS connected vg
step-2: coment same in /etc/fstab

-- If rebooted forcefully

Step-1: Start the server in maintenance mode

Step-2: Convert the filesystems in R/W mode

# mount -o remount, rw /

Step-3: scan lv and vg, It will show you as "inactive"

# lvscan
  inactive          '/dev/oradev/datalv' [299.00 GiB] inherit
  inactive          '/dev/orasit/datasitlv' [299.00 GiB] inherit
[root@DEVDB02 sysconfig]#

# df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/sda2              25G  7.8G   16G  34% /
tmpfs                 5.8G  100K  5.8G   1% /dev/shm
/dev/sda1             504M   60M  420M  13% /boot
/dev/sda5             9.9G  151M  9.2G   2% /home
/dev/sda6             5.0G  148M  4.6G   4% /tmp
# cd

# vgscan
  Reading all physical volumes.  This may take a while...
  Found volume group "oradev" using metadata type lvm2
  Found volume group "orasit" using metadata type lvm2
#


Step-4 : Activate vg

# vgchange -a y oradev
  1 logical volume(s) in volume group "oradev" now active

# vgchange -a y orasit
  1 logical volume(s) in volume group "orasit" now active
#

Step-5 : check now

# lvscan
  ACTIVE            '/dev/oradev/datalv' [299.00 GiB] inherit
  ACTIVE            '/dev/orasit/datasitlv' [299.00 GiB] inherit
#

# vgscan
  Reading all physical volumes.  This may take a while...
  Found volume group "oradev" using metadata type lvm2
  Found volume group "orasit" using metadata type lvm2

Step-6 : Uncomment in /etc/fstab

# vi /etc/fstab
..
/dev/oradev/datalv              /u01            ext4    defaults        1 2
/dev/orasit/datasitlv           /u02            ext4    defaults        1 2

:wq!

Step-7 : Mount now
#
# mount /u01
# mount /u02

Step-8 : Check mount points now

# df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/sda2              25G  7.8G   16G  34% /
tmpfs                 5.8G  100K  5.8G   1% /dev/shm
/dev/sda1             504M   60M  420M  13% /boot
/dev/sda5             9.9G  151M  9.2G   2% /home
/dev/sda6             5.0G  148M  4.6G   4% /tmp
/dev/mapper/oradev-datalv
                      295G  191M  280G   1% /u01
/dev/mapper/orasit-datasitlv
                      295G  191M  280G   1% /u02
#



Additional Knowledge - Change hostname in Linux:

1) Add/Edit hostname in /etc/hosts

e.g.,

# vi /etc/hosts

10.20.30.40     myhost

:wq!

2) Edit network file from /etc/sysconfig/

# cd /etc/sysconfig/
vi network
NETWORKING=YES
HOSTNAME=myhost

:wq!

3) Apply the hostname

# hostname myhost



1 comment:

  1. Thanks for sharing, nice post! Post really provice useful information!

    Giaonhan247 chuyên dịch vụ vận chuyển hàng đi mỹ cũng như dịch vụ ship hàng mỹ từ dịch vụ nhận mua hộ hàng mỹ từ website nổi tiếng Mỹ là mua hàng amazon về VN uy tín, giá rẻ.

    ReplyDelete

Translate >>