Go Back   The macosxhints Forums > OS X Help Requests > System



Reply
 
Thread Tools Rate Thread Display Modes
Old 07-15-2003, 02:23 PM   #1
Bossa Nova
Prospect
 
Join Date: Jul 2002
Location: Los Angeles
Posts: 47
Terminal And ASR Question

Ok so I got asr installed and it looks like it worked when I made my image. Now I can't get it to restore to the correct volume. Any ideas?

Here's my command line session:

[Admin:/Volumes/Test Partition] root# asr -source /Volumes/OS\ X\ Boot\ disk/test\ partition\ files/HD.ro_asr.dmg -target /Volumes/Test\ Partition/ -erase -noprompt
Validating target...done
Validating source...done
Erasing target device /dev/disk2s9.../sbin/newfs_hfs: /dev/disk2s9 is mounted on /Volumes/Test Partition
/sbin/newfs_hfs failed with error 256
/Volumes/Test Partition

couldn't erase target - Operation not permitted.
[Admin:/Volumes/Test Partition] root# sudo asr -source /Volumes/OS\ X\ Boot\ disk/test\ partition\ files/HD.ro_asr.dmg -target /Volumes/Test\ Partition/ -erase -noprompt
Validating target...done
Validating source...done
Erasing target device /dev/disk2s9.../sbin/newfs_hfs: /dev/disk2s9 is mounted on /Volumes/Test Partition
/sbin/newfs_hfs failed with error 256
/Volumes/Test Partition

couldn't erase target - Operation not permitted.

-----end of terminal session


Posted: Tue 15 Jul, 2003 13:08__ _Post subject: ASR Additional Command line attempts
------------------------------------------------------------------------
...ok now trying something different. On this second attempt I was trying to restore to a firewire drive that was partitioned into 3 volumes. I was thinking maybe it wasn't working because it didn't want to write to a firewire volume that was partitioned. (don't ask me why-I just think some firewire volumes are finicky)

So this time I booted from the firewire drive instead and I installed an additional drive right into the machine and tried again. Can anyone see the error in my ways in the following terminal session?

Last login: Tue Jul 15 10:44:20 on console
Welcome to Darwin!
[My-Computer:~] My% asr -source ./HD.ro_asr.dmg -target /Volumes/Test\ Partition -erase -noprompt
Validating target...done
Validating source.../usr/bin/hdid: "/Users/My/HD.ro_asr.dmg" unrecognized: No such file or directory.
couldn't validate source - No such file or directory.

[My-Computer:~] My% where asr
/usr/sbin/asr
[My-Computer:~] My% asr -source /HD.ro_asr.dmg -target /Volumes/Test\ Partition -erase -noprompt
Validating target...done
Validating source...done
Erasing target device /dev/disk2s9.../sbin/newfs_hfs: /dev/rdisk2s9: Permission denied
/sbin/newfs_hfs failed with error 256
/Volumes/Test Partition

couldn't erase target - Operation not permitted.
[My-Computer:~] My% asr -source /HD.ro_asr.dmg -target /Volumes/G4\ 1GHz -erase -noprompt
Validating target.../sbin/mount_hfs: Operation not permitted
/sbin/mount failed with error 256

Couldn't enable permissions for "/Volumes/G4 1GHz"
Try using -disableOwners

couldn't validate target - Operation not permitted.
[My-Computer:~] My% asr -source /HD.ro_asr.dmg -target /Volumes/TV\ G4\ 1GHz -erase -noprompt
Validating target...done
Validating source...done
Erasing target device /dev/disk1s9.../sbin/newfs_hfs: /dev/rdisk1s9: Permission denied
/sbin/newfs_hfs failed with error 256
/Volumes/G4 1GHz

couldn't erase target - Operation not permitted.
[My-Computer:~] My% asr -source /HD.ro_asr.dmg -target /Volumes/G4\ 1GHz
Validating target..."/Volumes/G4 1GHz" is not a volume

couldn't validate target - No such file or directory.
[My-Computer:~] My% mount /Volumes/G4\ 1GHZ
mount: /Volumes/G4 1GHZ: unknown special file or file system.
[My-Computer:~] My%

----end terminal session.

This is really getting frustrating. I have to get this image finished and the pc guys think this is really funny and have made some very dry Mac jokes. Maybe pc's really are the answer. It's slow going trying to learn this stuff from bulletin boards and trial and error.

Anyone wanta have an ASR party? I will bring the beer!
Bossa Nova is offline   Reply With Quote
Old 07-15-2003, 03:10 PM   #2
pink
Major Leaguer
 
Join Date: Jul 2002
Location: Germany
Posts: 441
don't know if you find this worth some beer, but here's how I made it work for me:
First I tried to make a network-based distribution (described by Bombich at http://www.bombich.com/ . This failed right from the beginning cause our machines refused to net-boot, which I attributed to a DHCP problem.)

So then I used a firewire-HD (20 G) with three partitions:
1)"boot" containing a complete 10.2.6 installation (with the BSD subsystem etc.), no 3rd party stuff; 4 G
2)"osx" complete 10.2.6, os 9.2, 3rd party apps as needed, 8 G
3)"user_data", to back up (once more) user date before installation; 7 G

cleaned up the "osx" according to the asr man page ("How to use asr", steps 6 and 7), booted from the "boot" partition; typed in the terminal:

Code:
sudo asr -source /Volumes/osx -target /Volumes/Target_HD -erase
....that was it. The speed was amazing; I think it was hardly more than 10 min to erase and install an ~ 4 G System; rebooted into the target Volume (note: the name of the target will be the same as the source's name, don't get confused) and was greeted by the setup assistant. Great (except for the fact that I had to realize that some users do not even know which mail program they are using, let alone where the mails would be stored )

Further info is also found at http://www.macosxlabs.org

cheers, pink

PS: Could it be that you forgot to become root for the attempts with the firewire disk ?
__________________
"And what have we got in here ? - Ahh, things.." (Louis (2), inspecting kitchen cupboards.)
pink is offline   Reply With Quote
Old 07-15-2003, 05:22 PM   #3
Bossa Nova
Prospect
 
Join Date: Jul 2002
Location: Los Angeles
Posts: 47
I don't know if this has anything to do with it but I was logged in as "root"...and I also tried to do it as admin neither worked. I also tried from the OS X partition on my firewire drive which is the same setup as yours (20 gig divided into three partitions)

Wonder what is going on here?
Bossa Nova is offline   Reply With Quote
Old 07-16-2003, 03:49 AM   #4
pink
Major Leaguer
 
Join Date: Jul 2002
Location: Germany
Posts: 441
Some more thoughts:

-If you have a closer look, you'll see that in the first two examples you started the asr command from a directory on the Volume to be erased. I'm not sure but maybe this prevents asr from unmounting the Volume, which apparently is necessary to erase it.

-The first try of the second series contains a mistyping "./HD..." instead of "/HD...", so it searched the .dmg in your home directory.

-For the next three tries, I still see no indication that you were root, sorry; maybe that's why you get "Permission denied"

-Did you try -disableOwners, as proposed ?

-In all tries in the second series, the .dmg was on the boot Volume. Maybe one could try to have it on a third, independent partition ?


If all this fails, probably it is time for some more detailed analysis, so let us split things up:
1) test asr functionality:
if you have a spare partition, try to use asr with a normal install of osx (not a .dmg) as a source and the spare partition as a target. Start omitting the -erase and -noprompt options. If this works, try with -erase, and so on. If this is ok,
2) test asr with your .dmg as a source, same procedure as in 1)
my assumption would be that all of these work.
3)Additionally, test what is implicated by the error messages, i.e. try to make the newfs_hfs command work on the target partition independently from asr.

BTW: what do you mean with

Quote:
Ok so I got asr installed

? AFAIK asr is part of the standard installation...

cheers, pink
__________________
"And what have we got in here ? - Ahh, things.." (Louis (2), inspecting kitchen cupboards.)
pink is offline   Reply With Quote
Old 07-16-2003, 11:46 AM   #5
mervTormel
League Commissioner
 
Join Date: Jan 2002
Posts: 5,536
Quote:
Originally posted by pink
...
-If you have a closer look, you'll see that in the first two examples you started the asr command from a directory on the Volume to be erased. I'm not sure but maybe this prevents asr from unmounting the Volume, which apparently is necessary to erase it.
...

it does prevent the unmount. good eye, pink
mervTormel is offline   Reply With Quote
Old 07-16-2003, 03:15 PM   #6
pink
Major Leaguer
 
Join Date: Jul 2002
Location: Germany
Posts: 441
Thx, Merv
__________________
"And what have we got in here ? - Ahh, things.." (Louis (2), inspecting kitchen cupboards.)
pink is offline   Reply With Quote
Old 07-16-2003, 04:56 PM   #7
Bossa Nova
Prospect
 
Join Date: Jul 2002
Location: Los Angeles
Posts: 47
Quote:
Originally posted by pink
Some more thoughts:

-If you have a closer look, you'll see that in the first two examples you started the asr command from a directory on the Volume to be erased. I'm not sure but maybe this prevents asr from unmounting the Volume, which apparently is necessary to erase it.

I am not sure what you mean by starting in the directory, do you mean I should be down on the root before initiating the command (i.e. first cd to root then "some type of command"

Quote:
-The first try of the second series contains a mistyping "./HD..." instead of "/HD...", so it searched the .dmg in your home directory.

This is the way it was written...with the "./filepath" I did omit the dot and tried it without. Kinda hard when you are totally un-aware of term and how to use it BUT what the heck jump in anyway right?
Quote:
-For the next three tries, I still see no indication that you were root, sorry; maybe that's why you get "Permission denied"

I did log on to the machine by first enabling root from netinfo and then logging out and back in as "root" id.
Quote:
-Did you try -disableOwners, as proposed ?

Yes I did try it but got an error same kind of deal as before.

Quote:
-In all tries in the second series, the .dmg was on the boot Volume. Maybe one could try to have it on a third, independent partition ?

Yes, tried that as well. I installed a second hard drive and tried booting from that as root first then I moved the .dmg over to the firewire drive that was partitioned into three volumes.
Quote:
If all this fails, probably it is time for some more detailed analysis, so let us split things up:
1) test asr functionality:
if you have a spare partition, try to use asr with a normal install of osx (not a .dmg) as a source and the spare partition as a target. Start omitting the -erase and -noprompt options. If this works, try with -erase, and so on. If this is ok,

I did try omitting the switches. Didn't try the original volume, I will give that a try on this next round.
Quote:
2) test asr with your .dmg as a source, same procedure as in 1)
my assumption would be that all of these work.

That's what I thought too but no joy.
Quote:
3)Additionally, test what is implicated by the error messages, i.e. try to make the newfs_hfs command work on the target partition independently from asr.

I am not familiar with "newfs_hfs" I will take a look at man and see what you are referring to.
Quote:
BTW: what do you mean with
Ok so I got asr installed
? AFAIK asr is part of the standard installation...
cheers, pink

Originally I could not create the image and Joel over at afp548.com advised that there was one release of X that did not have it and I should check the /sbin dir and if that didn't work, to try and install the admin tools disk-Which fixed the problem. (if you are interested just go to afp and check my post under "ASR" You will find it here:
http://www.afp548.com/eBBS/viewforum.php?f=18

Pink you have given me lots to think about. I am going back to the rock pile and see what damage I can do this time. I really appreciate your time on this.

Last edited by Bossa Nova; 07-16-2003 at 07:16 PM.
Bossa Nova is offline   Reply With Quote
Old 07-16-2003, 11:31 PM   #8
TazmanDman
Triple-A Player
 
Join Date: Jun 2003
Location: Ft. Worth, TX
Posts: 231
ASR

It was either with OS 10.2.2 or 10.2.3 that finally had a complete command line ASR built-in
TazmanDman is offline   Reply With Quote
Old 07-17-2003, 03:31 AM   #9
pink
Major Leaguer
 
Join Date: Jul 2002
Location: Germany
Posts: 441
Quote:
I am not sure what you mean by starting in the directory, do you mean I should be down on the root before initiating the command

for example, yes, or your home directory on the boot disk; actually you can "cd" to every directory which is on the boot volume (i.e. everything which is not /Volumes/something). It is important for the shell that the directory you start from (the "working directory") exists, otherwise strange things can happen. Illustration:

Code:
[home:~] pink% cd ~; mkdir foo ; cd foo
[home:~/foo] pink% rm -d ~/foo
[home:~/foo] pink% pwd
pwd: : Permission denied
[home:~/foo] pink% more bar
bar: Permission denied
see ? the correct error for the pwd ("print working directory") and more commands would have been "no such file or directory". That's why it is reasonable that a well-written program should prevent you from deleting your working directory.

Quote:
Didn't try the original volume, I will give that a try on this next round.

that's what I would do, too


Quote:
check my post

had a quick look; the command in the first post actually contained two errors: asr is in /usr/sbin, not /usr/bin, that's why it was not found. even if it would have been found, you would have seen another error, cause you typed the path as ./Volumes... (should be /Volumes...).
FYI: if you start a path with a ".", it is a relative path. that means, the shell starts searching in the directory you are in. w/o the "." it is an absolute path, i.e. search starts at / (the root directory). A tip: if you not sure how to type a path, simply drag the corresponding symbol from the finder to the terminal window; this normally inserts the correct (absolute) path.
Furthermore you overlooked the tip to use "which asr" to see if asr is installed.
Anyway, now you've got asr and we're gonna try to make it work.

BTW: which version are you using (type "asr -v") ? Mine (the one from standard 10.2.6) is
Code:
asr: version 15.6
cheers, pink
__________________
"And what have we got in here ? - Ahh, things.." (Louis (2), inspecting kitchen cupboards.)
pink is offline   Reply With Quote
Old 07-17-2003, 04:10 AM   #10
Bossa Nova
Prospect
 
Join Date: Jul 2002
Location: Los Angeles
Posts: 47
Quote:
Originally posted by pink
for example, yes, or your home directory on the boot disk;

I did try it from root and also my home directory. So now I am moving towards it being possibly some sort of permissions error while trying to write to the disk. Would it matter if I had inadvertantly left "ignore permissions on this disk" unchecked on the disk I was trying to overwrite to?

Quote:
the correct error for the pwd ("print working directory") and more commands would have been "no such file or directory".

I was guessing the permission denied was because of a rights issue. But now what you are saying makes more sense.

Quote:
you typed the path as ./Volumes... (should be /Volumes...).

yes I did. that was what the documentation said. (I think I will send you the .pdf file so you can see what I am following)

When I saw that it didn't work then I omitted the "." before the forward slash and it worked so I assumed I was reading a misprint.

Quote:
FYI: if you start a path with a ".", it is a relative path. that means, the shell starts searching in the directory you are in. w/o the "." it is an absolute path, i.e. search starts at / (the root directory). A tip: if you not sure how to type a path, simply drag the corresponding symbol from the finder to the terminal window; this normally inserts the correct (absolute) path.

USEFUL! I have been wondering why I kept seeing those periods at the beginning of file paths.

In reference to dragging the objects into the terminal window, that is exactly how I did it. I learned that trick early on and will continue to use it until I am fully confident with pathing in my arguments.
Quote:
Furthermore you overlooked the tip to use "which asr" to see if asr is installed.

I think that I may have neglected to put that in my post. I did use "which asr" but it was after going back after installing the admin tools. I got the desired response-I should have mentioned that.

Quote:
BTW: which version are you using (type "asr -v") ? Mine (the one from standard 10.2.6) is
Code:
asr: version 15.6
cheers, pink

I am responding to this from home. I wil try this first thing in the morning when I get to the office and see what it returns.

I will update you with my progress.

Last edited by Bossa Nova; 07-17-2003 at 04:14 AM.
Bossa Nova is offline   Reply With Quote
Old 07-18-2003, 02:06 AM   #11
Bossa Nova
Prospect
 
Join Date: Jul 2002
Location: Los Angeles
Posts: 47
I finally got it to restore. I will test tomorrow to make sure it was fully successful. I will post what I found for a solution.
Bossa Nova is offline   Reply With Quote
Old 07-23-2003, 11:59 PM   #12
Bossa Nova
Prospect
 
Join Date: Jul 2002
Location: Los Angeles
Posts: 47
Ok...I got it to restore BUT I had some problems with deleting files which were addressed in another post here.

I figured out why things were not working as I expected. For some reason my firewire drive has all sorts of problems. Many times my compuuter balked at me because the fw drive didn't want to do it or because what I was trying to do was not logical to the drive. Such as un-mounting one of the three partitions. I thought you could do that. I guess you can't or maybe this drive is just fussy.

I was able to get a better understanding of relative vs. absolute because of the whole process and also because of Pinks sharp eye. His comments lead me to scrutinize more carefully. Thanks for your help Pink on this issue and the trash permissions issue that I Posted about.

If anyone cares I can post the code for what I was trying to do.

Last edited by Bossa Nova; 07-24-2003 at 12:02 AM.
Bossa Nova is offline   Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



All times are GMT -5. The time now is 10:24 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.
Site design © IDG Consumer & SMB; individuals retain copyright of their postings
but consent to the possible use of their material in other areas of IDG Consumer & SMB.