Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

"An ounce of prevention is worth a ton of code." -- an anonymous programmer


devel / comp.lang.c / Sometimes VHDs (on USB drive) don't mount in Windows 7 during boot/login any ideas ?

SubjectAuthor
* Sometimes VHDs (on USB drive) don't mount in Windows 7 duringskybuck2000
`- Re: Sometimes VHDs (on USB drive) don't mount in Windows 7 duringskybuck2000

1
Sometimes VHDs (on USB drive) don't mount in Windows 7 during boot/login any ideas ?

<d366d56b-4287-4e91-8e11-e988d03bf9a3n@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=19004&group=comp.lang.c#19004

  copy link   Newsgroups: comp.lang.c
X-Received: by 2002:a05:620a:a47:: with SMTP id j7mr12560303qka.439.1637145184973;
Wed, 17 Nov 2021 02:33:04 -0800 (PST)
X-Received: by 2002:ac8:7d8a:: with SMTP id c10mr15398510qtd.415.1637145184870;
Wed, 17 Nov 2021 02:33:04 -0800 (PST)
Path: i2pn2.org!rocksolid2!i2pn.org!aioe.org!news.mixmin.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.c
Date: Wed, 17 Nov 2021 02:33:04 -0800 (PST)
Injection-Info: google-groups.googlegroups.com; posting-host=84.25.28.171; posting-account=np6u_wkAAADxbE7UBGUIOm-csir6aX02
NNTP-Posting-Host: 84.25.28.171
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <d366d56b-4287-4e91-8e11-e988d03bf9a3n@googlegroups.com>
Subject: Sometimes VHDs (on USB drive) don't mount in Windows 7 during
boot/login any ideas ?
From: skybuck2...@hotmail.com (skybuck2000)
Injection-Date: Wed, 17 Nov 2021 10:33:04 +0000
Content-Type: text/plain; charset="UTF-8"
 by: skybuck2000 - Wed, 17 Nov 2021 10:33 UTC

Sometimes Virtual Harddisk Images don't mount in Windows 7.

Currently these VHDs are on a usb drive. Perhaps the usb drive is not detected yet during boot and causes the mounting of the VHDs to fail.

However I have seen same behaviour with actualy build in harddisks.

Perhaps same problems. Harddisk not detected during boot ? Seems strange... perhaps ntfs file system not yet fully mounted/available ?

Anyway this is the script that is added to task schedular:

Stored in a file called Script.txt whatever..:

select vdisk file="E:\FileDiskImages\MusicConsolidationV2.vhd"
attach vdisk
assign letter=F

This script is supposed to run during bootup in task schedular..

Is there any way to do this more reliably ?!?!?

Notice the E: drive is an usb drive.

Bye for now,
Skybuck.

Re: Sometimes VHDs (on USB drive) don't mount in Windows 7 during boot/login any ideas ?

<f3965f96-d8e4-425f-b8c8-52b6a31a81f8n@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=19060&group=comp.lang.c#19060

  copy link   Newsgroups: comp.lang.c
X-Received: by 2002:a37:654f:: with SMTP id z76mr27145337qkb.224.1637317046154;
Fri, 19 Nov 2021 02:17:26 -0800 (PST)
X-Received: by 2002:a37:6295:: with SMTP id w143mr27542085qkb.161.1637317046049;
Fri, 19 Nov 2021 02:17:26 -0800 (PST)
Path: i2pn2.org!i2pn.org!news.swapon.de!fu-berlin.de!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.c
Date: Fri, 19 Nov 2021 02:17:25 -0800 (PST)
In-Reply-To: <d366d56b-4287-4e91-8e11-e988d03bf9a3n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=84.25.28.171; posting-account=np6u_wkAAADxbE7UBGUIOm-csir6aX02
NNTP-Posting-Host: 84.25.28.171
References: <d366d56b-4287-4e91-8e11-e988d03bf9a3n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <f3965f96-d8e4-425f-b8c8-52b6a31a81f8n@googlegroups.com>
Subject: Re: Sometimes VHDs (on USB drive) don't mount in Windows 7 during
boot/login any ideas ?
From: skybuck2...@hotmail.com (skybuck2000)
Injection-Date: Fri, 19 Nov 2021 10:17:26 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
 by: skybuck2000 - Fri, 19 Nov 2021 10:17 UTC

The idea to enable history is brilliant ! (Can be done on the far right side of the screen in task schedular when main thing selected.)

Now I can see if there are any error messages, I did notice one and googled it.

It kinda makes sense, the task was trying to run under "user"... I am not very familiar with selecting any other object.

But I managed to set it to "SYSTEM" by simply typing that in which object to use/select.

The coming days I will observe if this technique fix the problem with calling diskpart directly:

diskpart /s "path to script.txt"

In case that somehow fails then another idea could be to call a batch file instead which gives more powerfull possibilities:

mountvhd.bat e: "path to script.txt"

For that purpose I implemented some of you Paul's ideas and also included a timeout loop, it will wait 60 seconds, here is the mountvhd.bat batch script:

@echo off
SET /A "index = 1"
SET /A "count = 60"
:while
if %index% leq %count% (
echo Waiting 60 seconds for drive %1 to come online, seconds waited: %index%
SET /A "index = index + 1"
timeout /t 1 /nobreak>nul

vol %1 >nul 2>nul
REM echo %1
if errorlevel 1 (
REM echo IT DOES NOT EXIST
) else (
REM echo IT EXISTS
diskpart /s %2
REM echo %2
exit
)
goto :while
)

For now I will not use this script because first I want to observe if there are any problems with the direct diskpart method... and ofcourse if the usb drive is unplugged then no cookie... but I also dont want to see any batch file/cmd prompt windows during start so that is why I may prefer the direct diskpart method, here is once more the diskpart script:

C:\Scripts\SomeScript.txt:
select vdisk file="E:\FileDiskImages\MusicConsolidationV2.vhd"
attach vdisk
assign letter=F

Anyway the mountvhd.bat works with two parameters:

The drive letter which must match the script above... in the first line... and then diskpart script filename/path:

so for example to use the mountvhd.bat it would be invoked as follows:

MountVHD.bat E: "C:\Scripts\SomeScript.txt"

I tested the mountvhd.bat in cmd.exe, not sure if it will work with taskplanner, it may suffer the same problem as before... it may need to run from system object instead of user...

the benefit of system object is it requires no annoying password, so that is why I prefer that method... with maximum rights etc...

Anyway I am not sure about the " " quotes but that should work.

I tested mountvhd.bat in taskschedular once... seemed to work, but not sure.... so use it on your own risk ! ;) :)

Maybe both scripts can be integrated into one, that would be nice, then the parameters would work better.

So this script could use some more work... it's a bit crude ;) =D

(Posting this one day later, today the diskpart method worked again, so all seems fine for now, so maybe this bigger script is not necessary, time will tell ! ;) it could still be handy for people that like plugging usb drives into their machines and want it to automount within 60 seconds lol.)

Bye for now,
Skybuck.

1
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor