How to fix and manage data in rescue mode?


 
Thread Tools Search this Thread
Top Forums UNIX for Beginners Questions & Answers How to fix and manage data in rescue mode?
# 1  
Old 06-28-2019
How to fix and manage data in rescue mode?

Hello,
I am running ubuntu 14.04
My server has problems again. I need to manage system files in rescue mode, backup some files, edit /etc/crontab and rc.local files etc.

Code:
root@rescue:~# cat /proc/mdstat
Personalities : [linear] [raid0] [raid1] [raid10] [raid6] [raid5] [raid4] [multipath] [faulty]
md2 : active raid1 sda2[0] sdb2[1]
      4193216 blocks [2/2] [UU]

md3 : active raid0 sda3[0] sdb3[1]
      7787813888 blocks 512k chunks

unused devices: <none>



Code:
root@rescue:~# fdisk -l

Disk /dev/ram0: 50 MiB, 52428800 bytes, 102400 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk /dev/ram1: 50 MiB, 52428800 bytes, 102400 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk /dev/ram2: 50 MiB, 52428800 bytes, 102400 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk /dev/ram3: 50 MiB, 52428800 bytes, 102400 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk /dev/ram4: 50 MiB, 52428800 bytes, 102400 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk /dev/ram5: 50 MiB, 52428800 bytes, 102400 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk /dev/ram6: 50 MiB, 52428800 bytes, 102400 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk /dev/ram7: 50 MiB, 52428800 bytes, 102400 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk /dev/ram8: 50 MiB, 52428800 bytes, 102400 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk /dev/ram9: 50 MiB, 52428800 bytes, 102400 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk /dev/ram10: 50 MiB, 52428800 bytes, 102400 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk /dev/ram11: 50 MiB, 52428800 bytes, 102400 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk /dev/ram12: 50 MiB, 52428800 bytes, 102400 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk /dev/ram13: 50 MiB, 52428800 bytes, 102400 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk /dev/ram14: 50 MiB, 52428800 bytes, 102400 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk /dev/ram15: 50 MiB, 52428800 bytes, 102400 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk /dev/sda: 3.7 TiB, 4000787030016 bytes, 7814037168 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: 9F2BE807-05E5-4247-B2A3-E5C013A64B46

Device          Start        End    Sectors  Size Type
/dev/sda1        2048    1048575    1046528  511M EFI System
/dev/sda2     1048576    9435135    8386560    4G Linux RAID
/dev/sda3     9435136 7797250047 7787814912  3.6T Linux RAID
/dev/sda4  7797250048 7814025215   16775168    8G Linux swap

Disk /dev/sdb: 3.7 TiB, 4000787030016 bytes, 7814037168 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: F60F460A-BE4D-40EB-915B-BAE53BEF4758

Device          Start        End    Sectors  Size Type
/dev/sdb1        2048    1048575    1046528  511M EFI System
/dev/sdb2     1048576    9435135    8386560    4G Linux RAID
/dev/sdb3     9435136 7797250047 7787814912  3.6T Linux RAID
/dev/sdb4  7797250048 7814025215   16775168    8G Linux swap

Disk /dev/md3: 7.3 TiB, 7974721421312 bytes, 15575627776 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 524288 bytes / 1048576 bytes
Disk /dev/md2: 4 GiB, 4293853184 bytes, 8386432 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes

How may I proceed step by step ?

Thank you
Boris
# 2  
Old 06-28-2019
And WHAT EXACTLY is your problem? What errors do you encounter, where do you run into difficulties? What is your system disk? Show the mounted devices.
# 3  
Old 06-28-2019
Hello Rudic,
CPU is 100% and server is not accessible via ssh in normal boot mode.

The problem started after nfs installation. I received a warning message from authorities emphasizing that nfs usage has some risks as attackers could sniff the system via udp ports. Not sure about that. Company replaced the motherboard in the morning which did not solve the issue. After an eight hours of intervention process they said, server is under attack.
I am still not sure about that so I am planning to edit my settings in rescue mode.

Regarding system disk details:
Code:
root@rescue:~# df -aTh
Filesystem                        Type        Size  Used Avail Use% Mounted on
none                              proc           0     0     0    - /proc
none                              sysfs          0     0     0    - /sys
devtmpfs                          devtmpfs     16G     0   16G   0% /dev
178.33.124.49:/home/pub/rescue.v8 nfs         1.8T  298G  1.4T  18% /nfs
tmpfs                             tmpfs        16G  1.7M   16G   1% /rw
aufs                              aufs         16G  1.7M   16G   1% /
178.33.124.49:/home/pub/pro-power nfs         1.8T  298G  1.4T  18% /power
178.33.124.49:/home/pub/commonnfs nfs         1.8T  298G  1.4T  18% /common
securityfs                        securityfs     0     0     0    - /sys/kernel/security
tmpfs                             tmpfs        16G     0   16G   0% /dev/shm
devpts                            devpts         0     0     0    - /dev/pts
tmpfs                             tmpfs        16G  9.7M   16G   1% /run
tmpfs                             tmpfs       5.0M     0  5.0M   0% /run/lock
tmpfs                             tmpfs        16G     0   16G   0% /sys/fs/cgroup
cgroup                            cgroup         0     0     0    - /sys/fs/cgroup/systemd
pstore                            pstore         0     0     0    - /sys/fs/pstore
cgroup                            cgroup         0     0     0    - /sys/fs/cgroup/cpuset
cgroup                            cgroup         0     0     0    - /sys/fs/cgroup/cpu,cpuacct
cgroup                            cgroup         0     0     0    - /sys/fs/cgroup/blkio
cgroup                            cgroup         0     0     0    - /sys/fs/cgroup/memory
cgroup                            cgroup         0     0     0    - /sys/fs/cgroup/devices
cgroup                            cgroup         0     0     0    - /sys/fs/cgroup/freezer
cgroup                            cgroup         0     0     0    - /sys/fs/cgroup/net_cls,net_prio
cgroup                            cgroup         0     0     0    - /sys/fs/cgroup/pids
systemd-1                         autofs         0     0     0    - /proc/sys/fs/binfmt_misc
hugetlbfs                         hugetlbfs      0     0     0    - /dev/hugepages
debugfs                           debugfs        0     0     0    - /sys/kernel/debug
mqueue                            mqueue         0     0     0    - /dev/mqueue
tmpfs                             tmpfs        16G   12K   16G   1% /tmp
configfs                          configfs       0     0     0    - /sys/kernel/config
fusectl                           fusectl        0     0     0    - /sys/fs/fuse/connections
rpc_pipefs                        rpc_pipefs     0     0     0    - /run/rpc_pipefs

Kind regards
Boris

Last edited by baris35; 06-28-2019 at 06:06 PM.. Reason: requested info added
# 4  
Old 06-28-2019
Hello,
Code:
fdisk -l

Output:
Code:
Device          Start        End    Sectors  Size Type
/dev/sda1        2048    1048575    1046528  511M EFI System
/dev/sda2     1048576    9435135    8386560    4G Linux RAID
/dev/sda3     9435136 7797250047 7787814912  3.6T Linux RAID
/dev/sda4  7797250048 7814025215   16775168    8G Linux swap

Disk /dev/sdb: 3.7 TiB, 4000787030016 bytes, 7814037168 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: F60F460A-BE4D-40EB-915B-BAE53BEF4758

Device          Start        End    Sectors  Size Type
/dev/sdb1        2048    1048575    1046528  511M EFI System
/dev/sdb2     1048576    9435135    8386560    4G Linux RAID
/dev/sdb3     9435136 7797250047 7787814912  3.6T Linux RAID
/dev/sdb4  7797250048 7814025215   16775168    8G Linux swap

Disk /dev/md3: 7.3 TiB, 7974721421312 bytes, 15575627776 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 524288 bytes / 1048576 bytes
Disk /dev/md2: 4 GiB, 4293853184 bytes, 8386432 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes

Then I run:
Code:
mount /dev/md3 /mnt/

now I can see my files inside mnt. So when I edit related files, I hope it will be auto-edited after reboot in normal mode with one exception.
I do not know how to edit "crontab -e" in this environment.
I had created some rules with that command. Strongly believe that to surf in google will give me an idea.

Last edit:
To stop crontab rules:
Code:
update-rc.d cron remove

Then, I turned server to normal boot
After restart, in command line:
Code:
update-rc.d cron defaults

After I edit some files, I have changed the boot mode. Now system is up&running.

Kind regards
Boris

Last edited by baris35; 06-28-2019 at 07:55 PM..
These 2 Users Gave Thanks to baris35 For This Post:
# 5  
Old 06-29-2019
Thanks for sharing this.
If you know where the crontab file is located - usually under /var/spool/cron/, in your case /mnt/var/spool/cron/ - then you can directly edit it. (That method is not good on a live system because the running cron daemon would not be notified.)
Furthermore, a chroot /mnt crontab -e might work.
This User Gave Thanks to MadeInGermany For This Post:
Login or Register to Ask a Question

Previous Thread | Next Thread

8 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

How to get cpanel backup data in rescue mode?

How to get cpanel backup data in rescue mode? Server OS 6.3 minimal with cPanel /dev/sdb1 is main partition root@rescue ~ # fdisk -l Anyone can help Thank you (0 Replies)
Discussion started by: jaydul
0 Replies

2. Red Hat

You' dont have any Linux partition- Rescue Mode

I accidently deleted fstab file from one of the compute nodes of the cluster (RHEL 5.3). Due to this no filesystem/directory is mounted on the system during bootup. I started system in rescue mode but it says You don't have any linux partitions. Press return to get a shell. The system will reboot... (2 Replies)
Discussion started by: ahsanpmd
2 Replies

3. Red Hat

I cannot find ext2online or resize2fs in RHEL 4 rescue mode

Hi, I'm trying to resize an ext3 FS (filesystem) under an LVM. I have booted the OS (RHEL 4) in rescue mode using the CD media and I'm able to use lvm commands. Now, I'm trying to shrink the filesystem before actually shrinking the logical volume but I cannot find ext2onlone or resize2fs... (1 Reply)
Discussion started by: verdepollo
1 Replies

4. UNIX for Advanced & Expert Users

How does netcat manage the data it transfers ?

Hi all, When using netcat to transfer the data over socket, if no connection is established, how long will netcat keep the data; will it discard the "oldest" data ? Say for example I use "Some Command | netcat -l -p port", the command I use will generate a lot of output constantly, while no... (2 Replies)
Discussion started by: qiulang
2 Replies

5. Linux

Xen VM rescue mode

Hi all, I am running xen virtual machine on centos 5 and xen gust o.s is centos. I cannot boot my xen vm machine it saying cannot find /bin/sh to execute. I want to go to rescue mode of my xen vm machine. I know how to do on actual physical machine but how i can enter in rescue mode of... (6 Replies)
Discussion started by: email-lalit
6 Replies

6. UNIX and Linux Applications

Xen VM rescue mode

Hi all, I am running xen virtual machine on centos 5 and xen gust o.s is centos. I cannot boot my xen vm machine it saying cannot find /bin/sh to execute. I want to go to rescue mode of my xen vm machine. I know how to do on actual physical machine but how i can enter in rescue mode of... (1 Reply)
Discussion started by: email-lalit
1 Replies

7. UNIX for Dummies Questions & Answers

help rescue my data

I was runing suse 10.2 and windows ,i had installed windows on a separate 40 gb hard disk and linux on a 160 gb disk which it shrunk and left some 60 gb which were readable in windows. Due to the fact that i store alot of data in the windows partions i used all the extra 60gb which where readable... (2 Replies)
Discussion started by: soba
2 Replies

8. Shell Programming and Scripting

Partitioning script for rescue mode (disk size calculation)

Hello! I need to write partitioning script wich would work in rescue mode. It will prepare partitions and unpack linux on it. However I need to calculate whole size of the disk and create: /dev/sda1 --> One big partition (minus (2*size of memory) for swap) /dev/sda2 --> Swap partition... (1 Reply)
Discussion started by: pug123
1 Replies
Login or Register to Ask a Question