Find in this Blog

Showing posts with label LINUX`. Show all posts
Showing posts with label LINUX`. Show all posts

Wednesday, January 11, 2023

How to create copy of root user as root ?

 Premise: using sudo (as suggested by the accepted answer) probably is the correct solution at your problem.

That said, if you really need something resembling a second root account, you can create an alias to the system root account.

To do that, follow these steps:

  1. open /etc/passwd
  2. locate the root account line (often the very first line). It will be something similar to root:x:0:0:root:/root:/bin/bash
  3. copy/paste it changing the first root occurence in root2 (ie: changing it in root2:x:0:0:root:/root:/bin/bash)
  4. save your changes and exit the text editor
  5. issue passwd root2 and enter the new password

Note: if you whish, you can avoid direct editing the /etc/passwd file by replacing steps 1-3 with the following command: useradd -o -u 0 -g 0 -N -d /root/ -M root2 (see useradd --help for more information about the required options)

At this point, you can login using not only the original root account (with its original password), but also using the new root2 account (with its new password).

Anyway, remember that it is an alias of an existing user, rather than a completely new user. This means that any files created while logged as root2 have the very same numerical oid/gid of the original system root account (which has 0 as both uid and gid).


Thansk

Yoonus

Saturday, January 7, 2023

EMC-NETWOKER backinit HANA BACKUP RESTORE 19.X HANA 2.>=0

 

EMC-NETWOKER backinit HANA BACKUP RESTORE 19.X HANA 2.>=0

 

This Blog explain the restore steps of using backint from Dell EMC netwoker software

Expample:

Source machine name: s4hhdb1
Source Bakup pool: S4HPRD
Source tenant DB: SH1
Target machine name: testdbr2
Backup media server name: emcbackup137
Target tenant DB: SH1

FQDN= yoonus.local

 

The following  Changes to be made in source client GUI.. login Networker
> select source> modify the property t go to global2 add target machine host name, IP FQDN for full permission of access ( Full Permission= *@* )

 

Changes in Target machine (.utl)Files

Go to Target machine ( initSID.utl) file location and edit the file /usr/sap/TST/SYS/global/hdb/opt

 

##NSR_CLIENT=testdbr2.yoonus.local( target)
NSR_SERVER=emcbkp137.yoonus.local
NSR_CLIENT=s4hhdb1.yoonus.local ( source Client name)
NSR_RECOVER_POOL=S4HPRD (update source machine backup pool, the backup which need to restore from)
NSR_PARALLELISM=20
NSR_DEBUG_LEVEL=9
NSR_DPRINTF=true
NSR_DIAGNOSTIC_DEST = /nsr/applogs ( keep more space for this path)
NSR_DATA_VOLUME_POOL=TEST (optional)

 

Opt Location Files: /usr/sap/SID/SYS/global/hdb/opt
Following files should be in opt location: ( give full permission)
hdbbackint
initSID.utl
nsrsapsv.cfg

 

(nsrsapsv file details)

DATABASES=SYSTEMDB,TST (tenantdb)
HANA_BIN=/usr/sap/TST/HDB00/exe
HANA_DYNAMIC_PREFIX=FALSE
HANA_INSTANCE=00
HANA_MDC=TRUE
HANA_SID=TST
TENANT_ADMIN=FALSE

 

 

CHANGES IN HANA STUDIO SOURCE AND TARGET

Apply the below parameters based on respective source and target( HANA parameter in studio)

Global.ini>>backup>>

Catalog_backup_parameter_file = /usr/sap/SID/SYS/global/hdb/opt/initSID.utl
Catalog_backup_using_backint= true
Data_backup_parameter_file= /usr/sap/SID/SYS/global/hdb/opt/initSID.utl
Log_backup_parameter_file= /usr/sap/SID/SYS/global/hdb/opt/initSID.utl
Log_bakup_using_backint= true
Parallel_data_backup_backint_channels= ( based on sessions you need for fast restore)

 

HANA STUDIO CONSOLE STEPS
——————————

Restore select as tenant database

select :Recover the database a specific data backup

select: Search for the backup catalog in backinit only

Tick: Backinit system copy

SH2@SH2

DB will restart

after it will fetch the available backup logs to select and restore.

Tuesday, May 4, 2021

LVM EXTEND LINUX

 

1. extend hdd from vmware

 

ON LINUX VM

-------------

2. run echo 1 > /sys/block/sda/device/rescan (this is to rescan devices)

3. fdisk /dev/sda

               type p to list partitions

               it will show the new disk size ( Disk /dev/sda: new*GB )

               type d to delete the current partition which you want to increase

               type n to create new partiton ( create wih same partiton number - very iportant, starting cylinder should be same ( VERY IMPORTANT) as before mostly default value, and last cylinder will be new value usualy deafult.)

               Type N to keep the same partion file system (eg: Linux file system) or Y to select a new file system.

               Type p again to list partitions and check the size change is reflected

               Make sure everything is correct and then type w, it will write changes to disk - No turning back from here,

               (type q to exit from fdisk if not already)

4. partprobe -s ( reprobe all the partitions)

5. pvresize /dev/sda4

6. Now go to vm console or rdp open partitioner

               select the logical volume you want to expand and give the new size and finish

               this can be done from CLI but easier if can access the console :)


Primary partition extend:

Extend the volume disc and run the below command 

 xfs_growfs -d /hana


> rescan-scsi-bus.sh -a