Cpio Restore didnt go to plan

 
Thread Tools Search this Thread
Top Forums UNIX for Beginners Questions & Answers Cpio Restore didnt go to plan
# 1  
Old 08-09-2016
Cpio Restore didnt go to plan

Hello folks, one of the RAID drives in our SCO system crashed recently and being hot swap it was replaced.
Problem was that on boot it stops at:

Checking protected password and protected subsystem databases....

First I did
Code:
#authck -a

and checked
Code:
/etc/auth/system/ttys

as per instructions in a previous thread but no go.

So I did a CPIO restore at "/" in single user mode
Code:
cpio -icudvmlB -I /dev/rct0 u/\*

Problem was, it must have restored at the wrong spot as
Code:
/dev/root

is now 100% used.
The crontab points to a backup script which has the backup as
Code:
cd /
find . -depth -print | cpio -ocvB -O /dev/rct0

This is a SCO system from 15 years ago (I'm away from the system at the moment, cant tell you what version) that is ignored in the corner - until something goes wrong.

Question 1:
I tried doing a find search on the drive to locate the wrongly located files but to no avail, so where did they go?

Question 2:
What did I do wrong and what is the correct sequence/command to fix my problem?

Question 3:
Is "/" different in single user mode compared to multi user?

I was a SCO hardware engineer 20+ years ago, but that was a lifetime ago and I think I have forgotten more than I remember.

Cheers

Last edited by rbatte1; 08-09-2016 at 06:47 AM.. Reason: Adjusted backup code, assuming it's one block.
# 2  
Old 08-09-2016
This is just a suggestion, but the problem you might have is that the backup crosses filesystem boundaries. If you restore without the filesystems mounted in the correct position relative to your current directory when you issue the command, then files will be put back in the directory in the parent filesystem.

If you can now boot but find the root filesystem is full, then you may need to unmount each filesystem and have a look in the directory each is mounted on.


Does this help?




Robin
# 3  
Old 08-09-2016
Hmm, I'll have a look when I get back next week.
Thanks, any problems I'll get back......
# 4  
Old 08-09-2016
Quote:
Question 3:
Is "/" different in single user mode compared to multi user?
Answer: No, it isn't.

As rbatte1 says, most likely, in single user you didn't have the non-root filesystems mounted (you'd have to mount them manually in single user) so the cpio restore created directories as it restored the non-root filesystem files. Then, when running multi-user with all non-root filesystems mounted, these files get 'covered' by the mount points so you can't see them any more. You need to go back to single user and remove the directory trees that should not be on root.
# 5  
Old 08-15-2016
Ok, I'm back.
I tried to
Code:
umount /dev/root

but I'm told the device is busy (error 16).
I could however
Code:
umount /dev/boot

- yep, something works.

I managed to fix the first problem "Checking protected password and protected subsystem databases..." by booting with floppies and restoring with tape, of course the restore stopped due to lack of space but I deleted a couple of unnecessary text files that gained me 6% !! See Pic....

The system is up but I'm still with the problem of where did the original restore files go. I think I am still owed another 20% of disk realestate!!

As I quoted above the backup was created with find . blah blah
But I restored the backup at / with
Code:
cpio -icudvmlB -I /dev/rct0 u/\*

So, to find the unnecessary duplicates from the restore could I run a script to get the location?

I think I have turned into a nube...
Cpio Restore didnt go to plan-sds-boxjpg
# 6  
Old 08-15-2016
I think you restored into the unmounted /u that is different from the mounted /u
To compare, do
Code:
df -v /u
ls -ila /u

and note it e.g. on paper or in a new file /inodes.u
Then boot to single-user mode and compare.
If different then you can delete the /u contents in single-user mode. To be safe (I dont know SCO well) exclude recently opened files like this
Code:
cd /u
find /u -type f -atime +1 -exec rm {} \;


Last edited by MadeInGermany; 08-15-2016 at 04:20 AM..
# 7  
Old 08-15-2016
Since this is SCO Unix the filesystem will be /usr and not /u.

Other than that follow MadeInGermany's advice.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Cpio - input files (from list) are stored in different order inside cpio archive - why?

Due to budget constraints I have to reinvent an Enterprise backup system in a SPARC (sun4v) Solaris estate (10 & 11). (yep - reinvent wheel, fun but time consuming. Is this wise?! :confused: ) For each filesystem of interest, to try to capture a 'catalog' at the front of each cpio archive (for... (1 Reply)
Discussion started by: am115998
1 Replies

2. UNIX for Beginners Questions & Answers

CPIO Restore

Please note that using the command cpio to back up to tape was successful. Used the below command: time find /accts -print | cpio -oa --block-size=512 --format=newc --verbose -O /dev/nst0 I'm trying to restore from tape of a particular file and having issues. Below is the command to restore... (7 Replies)
Discussion started by: isoabv
7 Replies

3. Forum Support Area for Unregistered Users & Account Problems

I didnt get the activation email !!

I tried to register twice but without success ,I used the Hotmail email on both of them. Im sure I typed the correct email, because I used " copy and paste" and I did the "re-sent the activation" option (10 Replies)
Discussion started by: BaxxterHp
10 Replies

4. HP-UX

script in cron didnt run

Hi, I have script in the cron which run at predefined time everyday. If the script fails then we get the mail and a log is created. But last night the script didnt run. If the script is even started it creates log so it seems the script never ran. It has never happened before. Th... (5 Replies)
Discussion started by: shipra_31
5 Replies

5. UNIX for Dummies Questions & Answers

Unable to restore cpio archive to a directory

Hello Every one, I want to back up all passwd files to /xyz/passfiles.cpio and Then restore them to /abc directory. Here is what I wrote: find / -name passwd | cpio -oc > /tmp/passwd.cpio and to restore cd abc cpio -ium < /tmp/passwd.cpio I can not find the files restored to /abc... (2 Replies)
Discussion started by: drdigital_m
2 Replies

6. UNIX for Dummies Questions & Answers

restore cpio file

Hi, under unix aix , i had to put a catostrophic patch from an editor ... i had first made a cpio backup connected root cd /application find . –print | cpio –ocvBm > /sauvegarde/sauvegarde.cpio Does someone know the command to restore my cpio backup ? thanks in advandce to everyone ... (7 Replies)
Discussion started by: bzh35
7 Replies

7. SCO

cpio Backup and restore to spare server fails

Our company purchased a spare HP ML350 server - identical to current one in use to act as minimal downtime replacement should the inevitable happen. After install of OS 5.0.7 and restore of cpiobackup I get this message: -: Syntax error: Hostname= $inexpected The SCO licence policy... (4 Replies)
Discussion started by: moondogi
4 Replies

8. Solaris

Auto Start/Stop Didnt Work in Solaris 10

Hi...all database - 10g Rs 2 with ASM platform - Sun Solaris V890 64bit This is the step i use to auto start the database n ASM: (auto start can start but need to kill lsvcrun first) 1 dbora---script 2 start_shutdown_asm.ksh---script 3. Dbora file must be put under /etc/init.d directory... (0 Replies)
Discussion started by: adzuanamir
0 Replies

9. UNIX for Dummies Questions & Answers

Selective restore from a cpio tape archive

Hi, I use following command to restore data from my cpio tape archive: $cpio -icvd < /dev/rct0 But this'll restore all tape contents to the current path, what if I want only selected files from the tape, suppose I want /home/compdir/home2/Rev83/data/PL/01/*.* files to be restored... (8 Replies)
Discussion started by: tayyabq8
8 Replies

10. UNIX for Dummies Questions & Answers

cpio restore - relative pathname

SCO/Caldera Unixware 711 Hi Friends, I have a cpio file which was created using relative pathnames. the relative pathname is users/data/* I want to restore these files to a different directory with cpio. An example restore directory is /home/suresh Is this possible ? Can someone... (4 Replies)
Discussion started by: sureshy
4 Replies
Login or Register to Ask a Question