From: Kern S. <ke...@si...> - 2004-09-18 20:01:11
|
Hello, On Tue, 2004-09-14 at 13:59, philip nash wrote: > --- Kern Sibbald <ke...@si...> wrote: > > > Hello, > > > > On Fri, 2004-09-10 at 14:07, philip nash wrote: > > > Hi all > > > > > > I was just going through the bare metal restore > > rescue > > > scripts. I couldnt get the logic of the following > > > lines > > > > > > ********** > > > sed -n 's/\(^.*\)\ on\ \(.*\)\ type.*$/mkdir -p > > > \/mnt\/disk\2/p' $di/mount.ext2.bsi >> > > mount_drives > > > > > > sed -n 's/\(^.*\)\ on\ \(.*\)\ type.*$/mkdir -p > > > \/mnt\/disk\2/p' $di/mount.ext3.bsi >> > > mount_drives > > > echo "#" >>mount_drives > > > > > > sed -n 's/\(^.*\)\ on\ \(.*\)\ type.*$/mount \1 > > > \/mnt\/disk\2/p' $di/mount.ext2.bsi >/tmp/1$$ > > > > > > sed -n 's/\(^.*\)\ on\ \(.*\)\ type.*$/mount \1 > > > \/mnt\/disk\2/p' $di/mount.ext3.bsi >>/tmp/1$$ > > > > > > # sort so that root is mounted first > > > > > > sort -k 3 </tmp/1$$ >> mount_drives > > > ********* > > > > > > As I see it, if the entire directory hierarchy > > > (/mnt/disk, /mnt/disk/prog, ... )is created first, > > and > > > the partitions are mounted with root (/)at the > > top, > > > the underlying directories will become invisible > > and > > > the remaining stuff wont work. > > > > > > I suggest it should be like: > > > 1. create the directory (/mnt/disk) for the root > > > parttion > > > 2. mount it > > > 3. create the remaining directories > > > 4. mount them in a similar fashion > > > > > > What is your opinion on this? > > > > If you think there is a problem here, you will need > > to show me a real > > case where it fails. Please send a "df" of your > > system, and the output > > file that getdiskinfo produced along with an > > explanation of why it won't > > work. You could also possibly attach a few of the > > files that are > > processed so that I can repeat it here with your > > data. > > > > Please put the above into the bugs database so that > > it can be properly > > tracked and processed. > > > > Regards, Kern > > > > > > > > Regards, > > > Philip > > Hi everyone, > I apologize for the delay. Got caught up in some > chores and hence the late reply. > > The df on my system gives: > [root:root]# df > Filesystem 1K-blocks Used Available Use% Mounted > on > /dev/hda1 4195632 4083892 111740 98% / > /dev/hda3 20968736 19650192 1318544 94% /boot > /dev/hda4 12639928 8464084 4175844 67% /prog > tmpfs 512460 0 512460 0% > /dev/shm > > The file mount_drives contains lines like (I didnt > save the old file and have changed the generating > script now, so these aren't the *exact* lines) > > mkdir -p /mnt/disk > mkdir -p /mnt/disk/boot > mkdir -p /mnt/disk/prog > > mount /dev/hda1 /mnt/disk > mount /dev/hda3 /mnt/disk/boot > mount /dev/hda4 /mnt/disk/prog > > Now, when this is executed, the last 2 mounts fail > because the target directories do not exist. I suggest > that the order should be: > > mkdir -p /mnt/disk > mount /dev/hda1 /mnt/disk > > mkdir -p /mnt/disk/boot > mount /dev/hda3 /mnt/disk/boot > > mkdir -p /mnt/disk/prog > mount /dev/hda4 /mnt/disk/prog Well, I must be really missing something here because I don't see anything wrong with the first script you show above. It should create the mount points with no problems. That said, I know that the rescue scripts have some difficulties getting the order of creating directories correct. I you can send me something it does wrong, and I can understand why it fails (I don't understand why the first script above fails) I'll try to fix it. Regards, Kern > > also, I have one question: in the various mount > outputs that I have observed, the root partition (/) > always comes first. Can we depend on this behaviour or > is it just coincidence? > > Hope someone clarifies things. > Regards, > Philip > > > > _______________________________ > Do you Yahoo!? > Declare Yourself - Register online to vote today! > http://vote.yahoo.com > > > ------------------------------------------------------- > This SF.Net email is sponsored by: YOU BE THE JUDGE. Be one of 170 > Project Admins to receive an Apple iPod Mini FREE for your judgement on > who ports your project to Linux PPC the best. Sponsored by IBM. > Deadline: Sept. 13. Go here: http://sf.net/ppc_contest.php > _______________________________________________ > Bacula-devel mailing list > Bac...@li... > https://lists.sourceforge.net/lists/listinfo/bacula-devel |