Re: cat /proc/partitions shows only devices, not partitions

2020-03-09 Thread Bill Stewart
On Mon, Mar 9, 2020 at 9:47 AM Hashim Aziz wrote:

> I see. Do you know how I would go about resolving this, as I am using an 
> Administrator account and have never run into any other issues reading, 
> writing or otherwise making changes to those drives.

As a side point: It is important to understand that "logging on using
an account that's a member of the Administrators group" is not the
same as "running elevated" when UAC (User Account Control) is enabled.
(It is not recommended to disable UAC.)

If you don't launch your Cygwin shell using the "Run as administrator"
option, the Administrator group is not enabled in the process token,
and thus actually does not have administrator permissions. (Using the
"Run as administrator" option is often referred to as "running
elevated.")

Bill
"--Problem reports:   http://cygwin.com/problems.htmlFAQ:   
http://cygwin.com/faq/Documentation: 
http://cygwin.com/docs.htmlUnsubscribe info:  
http://cygwin.com/ml/#unsubscribe-simple;


Re: cat /proc/partitions shows only devices, not partitions

2020-03-09 Thread Hashim Aziz
I see. Do you know how I would go about resolving this, as I am using an 
Administrator account and have never run into any other issues reading, writing 
or otherwise making changes to those drives.

Hashim


From: cygwin-ow...@cygwin.com on behalf of Corinna Vinschen
Sent: Tuesday, March 03, 2020 4:46 PM
To: cygwin@cygwin.com
Subject: Re: cat /proc/partitions shows only devices, not partitions

On Mar  3 16:32, Hashim Aziz wrote:
> Yes, this was what I expected you meant by elevated shell. I tried that 
> earlier and got no luck (though I tried the link to the Cygwin terminal in my 
> start menu
> not a desktop shortcut), and I just tried again after attempting several 
> permissions fixes but still no luck.
>
> The permissions fixed I tried were:
>
> - Right-clicking and deselecting Read-Only on the cygwin64 folder
> - Resetting permissions with the CMD command: icacls c:\cygwin64 /reset /t /l 
> /c
> - Taking control of the Cygwin folder with the following command (itself run 
> from an elevated window):
> [...]

When I was talking about permissions, I was talking about permissions on
the native Windows devices, not any permissions on Cygwin files.

The strace output shows that you don't have permissions to call
DeviceIoControl(IOCTL_DISK_GET_PARTITION_INFO) or
DeviceIoControl(IOCTL_DISK_GET_PARTITION_INFO_EX) on the devices
representing the partitions in the native NT device namespace, i.e.,
\Device\Harddisk0\Partition0, etc.


Corinna

--
Corinna Vinschen
Cygwin Maintainer
"--Problem reports:   http://cygwin.com/problems.htmlFAQ:   
http://cygwin.com/faq/Documentation: 
http://cygwin.com/docs.htmlUnsubscribe info:  
http://cygwin.com/ml/#unsubscribe-simple;


Re: cat /proc/partitions shows only devices, not partitions

2020-03-08 Thread Andrey Repin
Greetings, Hashim Aziz!

Please no top posting on the list.

> An update to this, I resorted to nuking and then re-installing Cygwin from
> scratch, and the problem STILL persists. This seems to suggest that
> something is wrong with Windows itself that is responsible for Cygwin no
> longer being able to see the the drive letters that partitions are mounted
> at, but what that something could be I have no idea anymore.

Look at the list of your installed software and ask yourself, which of them
could impose additional restrictions on low-level API's?

Various would-be-"antiviruses", "antihacking" and "firewall" applications are
ready candidates for investigation.

P.S.
If you have an hour to spare, you could try installing your OS in a VM and
check in there.


-- 
With best regards,
Andrey Repin
Monday, March 9, 2020 6:08:37

Sorry for my terrible english...

"--Problem reports:   http://cygwin.com/problems.htmlFAQ:   
http://cygwin.com/faq/Documentation: 
http://cygwin.com/docs.htmlUnsubscribe info:  
http://cygwin.com/ml/#unsubscribe-simple;


Re: cat /proc/partitions shows only devices, not partitions

2020-03-07 Thread Hashim Aziz
An update to this, I resorted to nuking and then re-installing Cygwin from 
scratch, and the problem STILL persists. This seems to suggest that something 
is wrong with Windows itself that is responsible for Cygwin no longer being 
able to see the the drive letters that partitions are mounted at, but what that 
something could be I have no idea anymore.

From: Hashim Aziz 
Sent: 03 March 2020 4:32 PM
To: cygwin@cygwin.com 
Subject: Re: cat /proc/partitions shows only devices, not partitions

Yes, this was what I expected you meant by elevated shell. I tried that earlier 
and got no luck (though I tried the link to the Cygwin terminal in my start menu
not a desktop shortcut), and I just tried again after attempting several 
permissions fixes but still no luck.

The permissions fixed I tried were:

- Right-clicking and deselecting Read-Only on the cygwin64 folder
- Resetting permissions with the CMD command: icacls c:\cygwin64 /reset /t /l /c
- Taking control of the Cygwin folder with the following command (itself run 
from an elevated window):

$ chown $USER /* -v
ownership of '/bin' retained as Hashim
chown: changing ownership of '/cygdrive': Permission denied
failed to change ownership of '/cygdrive' from Hashim to Hashim
chown: changing ownership of '/Cygwin.bat': Permission denied
failed to change ownership of '/Cygwin.bat' from Hashim to Hashim
chown: changing ownership of '/Cygwin.ico': Permission denied
failed to change ownership of '/Cygwin.ico' from Hashim to Hashim
chown: changing ownership of '/Cygwin-Terminal.ico': Permission denied
failed to change ownership of '/Cygwin-Terminal.ico' from Hashim to Hashim
ownership of '/dev' retained as Hashim
ownership of '/etc' retained as Hashim
ownership of '/home' retained as Hashim
ownership of '/lib' retained as Hashim
ownership of '/opt' retained as Hashim
chown: changing ownership of '/proc': Operation not permitted
failed to change ownership of '/proc' from Hashim to Hashim
ownership of '/sbin' retained as Hashim
ownership of '/srv' retained as Hashim
ownership of '/tmp' retained as Hashim
ownership of '/usr' retained as Hashim
ownership of '/var' retained as Hashim

Whether the above output is normal or not I'm unsure.



From: Corinna Vinschen
Sent: Tuesday, March 03, 2020 10:44 AM
To: Hashim Aziz
Cc: cygwin@cygwin.com
Subject: Re: cat /proc/partitions shows only devices, not partitions




On Mar  3 00:54, Hashim Aziz wrote:

> Hey Corinna, thanks for your quick reply.

>

> Regarding the elevated shell - I'm unsure of exactly how to run an

> elevated Cygwin shell?



Right click on the Cygwin Terminal icon on the desktop, choose the

item "Run as administrator".



I have no idea why your system has different permissions, but at least

you should be able to see the info in an elevated shell.



Corinna



--

Corinna Vinschen

Cygwin Maintainer

"--Problem reports:   http://cygwin.com/problems.htmlFAQ:   
http://cygwin.com/faq/Documentation: 
http://cygwin.com/docs.htmlUnsubscribe info:  
http://cygwin.com/ml/#unsubscribe-simple;


Re: cat /proc/partitions shows only devices, not partitions

2020-03-04 Thread Andrey Repin
Greetings, Hashim Aziz!

> This was an issue that I had previously in September of last year and sent
> the issue to this mailing list ("win-mounts no longer displays anything when
> doing "cat /proc/partitions") but the issue stopped occurring before I could
> get around to diagnosing it. This issue has now re-occurred and this time it 
> seems permanent. When I run:

> $ cat /proc/partitions
> major minor  #blocks  name   win-mounts

> 8 0 0 sda
> 816 0 sdb
> 832 0 sdc
> 848 0 sdd
> 864 0 sde
> 880 0 sdf

$ cat /proc/partitions
major minor  #blocks  name   win-mounts

8 0  78150744 sda
8 1102400 sda1
8 2131072 sda2
8 3  77916160 sda3   C:\ C:\dev\sda1\
816 488386584 sdb
817 486615520 sdb1
832 488386584 sdc
833 488384512 sdc1
848 312571224 sdd
849 312568641 sdd1
864 0 sde
880 0 sdf
896 0 sdg
8   112 0 sdh

> ...I see nothing at all in the win-mounts column. This makes it impossible
> for me to see which Windows drive letter maps to which /dev/sdX entry.

This seems like a permissions issue.

> win-mounts column. I'm running Cygwin on Windows 7 (yes I'm aware it's EOL).

Same here. Win 7 Pro SP1.


-- 
With best regards,
Andrey Repin
Wednesday, March 4, 2020 22:00:31

Sorry for my terrible english...


--
Problem reports:   http://cygwin.com/problems.html
FAQ:   http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple



Re: cat /proc/partitions shows only devices, not partitions

2020-03-03 Thread Corinna Vinschen
On Mar  3 16:32, Hashim Aziz wrote:
> Yes, this was what I expected you meant by elevated shell. I tried that 
> earlier and got no luck (though I tried the link to the Cygwin terminal in my 
> start menu 
> not a desktop shortcut), and I just tried again after attempting several 
> permissions fixes but still no luck.
> 
> The permissions fixed I tried were:
> 
> - Right-clicking and deselecting Read-Only on the cygwin64 folder
> - Resetting permissions with the CMD command: icacls c:\cygwin64 /reset /t /l 
> /c
> - Taking control of the Cygwin folder with the following command (itself run 
> from an elevated window):
> [...]

When I was talking about permissions, I was talking about permissions on
the native Windows devices, not any permissions on Cygwin files. 

The strace output shows that you don't have permissions to call
DeviceIoControl(IOCTL_DISK_GET_PARTITION_INFO) or
DeviceIoControl(IOCTL_DISK_GET_PARTITION_INFO_EX) on the devices
representing the partitions in the native NT device namespace, i.e.,
\Device\Harddisk0\Partition0, etc.


Corinna

-- 
Corinna Vinschen
Cygwin Maintainer


signature.asc
Description: PGP signature


Re: cat /proc/partitions shows only devices, not partitions

2020-03-03 Thread Hashim Aziz
Yes, this was what I expected you meant by elevated shell. I tried that earlier 
and got no luck (though I tried the link to the Cygwin terminal in my start 
menu 
not a desktop shortcut), and I just tried again after attempting several 
permissions fixes but still no luck.

The permissions fixed I tried were:

- Right-clicking and deselecting Read-Only on the cygwin64 folder
- Resetting permissions with the CMD command: icacls c:\cygwin64 /reset /t /l /c
- Taking control of the Cygwin folder with the following command (itself run 
from an elevated window):

$ chown $USER /* -v
ownership of '/bin' retained as Hashim
chown: changing ownership of '/cygdrive': Permission denied
failed to change ownership of '/cygdrive' from Hashim to Hashim
chown: changing ownership of '/Cygwin.bat': Permission denied
failed to change ownership of '/Cygwin.bat' from Hashim to Hashim
chown: changing ownership of '/Cygwin.ico': Permission denied
failed to change ownership of '/Cygwin.ico' from Hashim to Hashim
chown: changing ownership of '/Cygwin-Terminal.ico': Permission denied
failed to change ownership of '/Cygwin-Terminal.ico' from Hashim to Hashim
ownership of '/dev' retained as Hashim
ownership of '/etc' retained as Hashim
ownership of '/home' retained as Hashim
ownership of '/lib' retained as Hashim
ownership of '/opt' retained as Hashim
chown: changing ownership of '/proc': Operation not permitted
failed to change ownership of '/proc' from Hashim to Hashim
ownership of '/sbin' retained as Hashim
ownership of '/srv' retained as Hashim
ownership of '/tmp' retained as Hashim
ownership of '/usr' retained as Hashim
ownership of '/var' retained as Hashim

Whether the above output is normal or not I'm unsure.



From: Corinna Vinschen
Sent: Tuesday, March 03, 2020 10:44 AM
To: Hashim Aziz
Cc: cygwin@cygwin.com
Subject: Re: cat /proc/partitions shows only devices, not partitions




On Mar  3 00:54, Hashim Aziz wrote:

> Hey Corinna, thanks for your quick reply.

> 

> Regarding the elevated shell - I'm unsure of exactly how to run an

> elevated Cygwin shell?



Right click on the Cygwin Terminal icon on the desktop, choose the

item "Run as administrator".



I have no idea why your system has different permissions, but at least

you should be able to see the info in an elevated shell.



Corinna



-- 

Corinna Vinschen

Cygwin Maintainer


--
Problem reports:   http://cygwin.com/problems.html
FAQ:   http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple



Re: cat /proc/partitions shows only devices, not partitions

2020-03-03 Thread Corinna Vinschen
On Mar  3 00:54, Hashim Aziz wrote:
> Hey Corinna, thanks for your quick reply.
> 
> Regarding the elevated shell - I'm unsure of exactly how to run an
> elevated Cygwin shell?

Right click on the Cygwin Terminal icon on the desktop, choose the
item "Run as administrator".

> I have attached the requested strace file.

Here's what I see for all partitions in the trace output:

  460   21259 [main] cat 553 format_proc_partitions: DeviceIoControl
  (Harddisk0\Partition0, IOCTL_DISK_GET_PARTITION_INFO{_EX}) Win32 error 5

Win32 error 5 is ERROR_ACCESS_DENIED.

So it appears that the OS access is denied for some reason.  I tried
again on Windows 7, this time with a non-admin account, just to be sure,
but I still can see the partition info.  Yesterday I tried with an admin
account, just not in an elevated shell, so this may have been an
important difference.  Apparently not so.

I have no idea why your system has different permissions, but at least
you should be able to see the info in an elevated shell.


Corinna

-- 
Corinna Vinschen
Cygwin Maintainer


signature.asc
Description: PGP signature


Re: cat /proc/partitions shows only devices, not partitions

2020-03-02 Thread Hashim Aziz

Hey Corinna, thanks for your quick reply.

Regarding the elevated shell - I'm unsure of exactly how to run an elevated 
Cygwin shell?

I have attached the requested strace file.

Thanks,
Hashim
 




From: Corinna Vinschen
Sent: Monday, March 02, 2020 4:56 PM
To: Hashim Aziz
Cc: cygwin
Subject: Re: cat /proc/partitions shows only devices, not partitions




On Mar  1 21:16, Hashim Aziz wrote:

> This was an issue that I had previously in September of last year and

> sent the issue to this mailing list ("win-mounts no longer displays

> anything when doing "cat /proc/partitions") but the issue stopped

> occurring before I could get around to diagnosing it. This issue has

> now re-occurred and this time it seems permanent. When I run:

> 

> $ cat /proc/partitions

> major minor  #blocks  name   win-mounts

> 

> 8 0 0 sda

> 8    16 0 sdb

> 8    32 0 sdc

> 8    48 0 sdd

> 8    64 0 sde

> 8    80 0 sdf

> 

> ...I see nothing at all in the win-mounts column. This makes it

> impossible for me to see which Windows drive letter maps to which

> /dev/sdX entry. On closer inspection, this seems to be because I'm not

> actually seeing any partitions of my drives, even though there are

> many - for example, I see /dev/sda but no /dev/sda1 or /dev/sda2, and

> because it's the partitions that are mounted, it's this that seems to

> result in me seeing nothing in the win-mounts column. I'm running

> Cygwin on Windows 7 (yes I'm aware it's EOL).



Fortunately I just started Windows 7 for another thread here, so I

gave it a try myself:



  $ uname -a

  CYGWIN_NT-6.1 vmbert764 3.1.4(0.340/5/3) 2020-02-19 08:49 x86_64 Cygwin

  $ id -G | grep -Eq '\<544\>' && echo elevated || echo non-elevated

  non-elevated

  $ cat /proc/partitions

  major minor  #blocks  name   win-mounts



  8 0  54525952 sda

  8 1    102400 sda1

  8 2  54420480 sda2   C:\



So, https://cygwin.com/acronyms/#WJFFM



This appears to be a local phenomenon only, either some permission

problem, or some BLODA, a life virus scanner or something.



Two questions come to mind:



- Does it work in an elevated shell?



- If you run this under strace, does it show anything unusual?

  We could take a look if you call



    strace -o cat.trace cat /proc/partitions



  and send the cat.trace file here (assuming it still doesn't work).





Corinna



-- 

Corinna Vinschen

Cygwin Maintainer



cat.trace
Description: cat.trace

--
Problem reports:   http://cygwin.com/problems.html
FAQ:   http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple

Re: cat /proc/partitions shows only devices, not partitions

2020-03-02 Thread Hashim Aziz
Hey Corinna, thanks for your quick reply.

Regarding the elevated shell - I'm unsure of exactly how to run an elevated 
Cygwin shell?

I have attached the requested strace file.

Thanks,
Hashim
 




From: Corinna Vinschen
Sent: Monday, March 02, 2020 4:56 PM
To: Hashim Aziz
Cc: cygwin
Subject: Re: cat /proc/partitions shows only devices, not partitions




On Mar  1 21:16, Hashim Aziz wrote:

> This was an issue that I had previously in September of last year and

> sent the issue to this mailing list ("win-mounts no longer displays

> anything when doing "cat /proc/partitions") but the issue stopped

> occurring before I could get around to diagnosing it. This issue has

> now re-occurred and this time it seems permanent. When I run:

> 

> $ cat /proc/partitions

> major minor  #blocks  name   win-mounts

> 

> 8 0 0 sda

> 8    16 0 sdb

> 8    32 0 sdc

> 8    48 0 sdd

> 8    64 0 sde

> 8    80 0 sdf

> 

> ...I see nothing at all in the win-mounts column. This makes it

> impossible for me to see which Windows drive letter maps to which

> /dev/sdX entry. On closer inspection, this seems to be because I'm not

> actually seeing any partitions of my drives, even though there are

> many - for example, I see /dev/sda but no /dev/sda1 or /dev/sda2, and

> because it's the partitions that are mounted, it's this that seems to

> result in me seeing nothing in the win-mounts column. I'm running

> Cygwin on Windows 7 (yes I'm aware it's EOL).



Fortunately I just started Windows 7 for another thread here, so I

gave it a try myself:



  $ uname -a

  CYGWIN_NT-6.1 vmbert764 3.1.4(0.340/5/3) 2020-02-19 08:49 x86_64 Cygwin

  $ id -G | grep -Eq '\<544\>' && echo elevated || echo non-elevated

  non-elevated

  $ cat /proc/partitions

  major minor  #blocks  name   win-mounts



  8 0  54525952 sda

  8 1    102400 sda1

  8 2  54420480 sda2   C:\



So, https://cygwin.com/acronyms/#WJFFM



This appears to be a local phenomenon only, either some permission

problem, or some BLODA, a life virus scanner or something.



Two questions come to mind:



- Does it work in an elevated shell?



- If you run this under strace, does it show anything unusual?

  We could take a look if you call



    strace -o cat.trace cat /proc/partitions



  and send the cat.trace file here (assuming it still doesn't work).





Corinna



-- 

Corinna Vinschen

Cygwin Maintainer



cat.trace
Description: cat.trace

--
Problem reports:   http://cygwin.com/problems.html
FAQ:   http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple

Re: cat /proc/partitions shows only devices, not partitions

2020-03-02 Thread Corinna Vinschen
On Mar  1 21:16, Hashim Aziz wrote:
> This was an issue that I had previously in September of last year and
> sent the issue to this mailing list ("win-mounts no longer displays
> anything when doing "cat /proc/partitions") but the issue stopped
> occurring before I could get around to diagnosing it. This issue has
> now re-occurred and this time it seems permanent. When I run:
> 
> $ cat /proc/partitions
> major minor  #blocks  name   win-mounts
> 
> 8 0 0 sda
> 816 0 sdb
> 832 0 sdc
> 848 0 sdd
> 864 0 sde
> 880 0 sdf
> 
> ...I see nothing at all in the win-mounts column. This makes it
> impossible for me to see which Windows drive letter maps to which
> /dev/sdX entry. On closer inspection, this seems to be because I'm not
> actually seeing any partitions of my drives, even though there are
> many - for example, I see /dev/sda but no /dev/sda1 or /dev/sda2, and
> because it's the partitions that are mounted, it's this that seems to
> result in me seeing nothing in the win-mounts column. I'm running
> Cygwin on Windows 7 (yes I'm aware it's EOL).

Fortunately I just started Windows 7 for another thread here, so I
gave it a try myself:

  $ uname -a
  CYGWIN_NT-6.1 vmbert764 3.1.4(0.340/5/3) 2020-02-19 08:49 x86_64 Cygwin
  $ id -G | grep -Eq '\<544\>' && echo elevated || echo non-elevated
  non-elevated
  $ cat /proc/partitions
  major minor  #blocks  name   win-mounts

  8 0  54525952 sda
  8 1102400 sda1
  8 2  54420480 sda2   C:\

So, https://cygwin.com/acronyms/#WJFFM

This appears to be a local phenomenon only, either some permission
problem, or some BLODA, a life virus scanner or something.

Two questions come to mind:

- Does it work in an elevated shell?

- If you run this under strace, does it show anything unusual?
  We could take a look if you call

strace -o cat.trace cat /proc/partitions

  and send the cat.trace file here (assuming it still doesn't work).


Corinna

-- 
Corinna Vinschen
Cygwin Maintainer


signature.asc
Description: PGP signature


cat /proc/partitions shows only devices, not partitions

2020-03-01 Thread Hashim Aziz
This was an issue that I had previously in September of last year and sent the 
issue to this mailing list ("win-mounts no longer displays anything when doing 
"cat /proc/partitions") but the issue stopped occurring before I could get 
around to diagnosing it. This issue has now re-occurred and this time it seems 
permanent. When I run:

$ cat /proc/partitions
major minor  #blocks  name   win-mounts

8 0 0 sda
816 0 sdb
832 0 sdc
848 0 sdd
864 0 sde
880 0 sdf

...I see nothing at all in the win-mounts column. This makes it impossible for 
me to see which Windows drive letter maps to which /dev/sdX entry. On closer 
inspection, this seems to be because I'm not actually seeing any partitions of 
my drives, even though there are many - for example, I see /dev/sda but no 
/dev/sda1 or /dev/sda2, and because it's the partitions that are mounted, it's 
this that seems to result in me seeing nothing in the win-mounts column. I'm 
running Cygwin on Windows 7 (yes I'm aware it's EOL).

For testing purposes I also ran the following command (for obvious reasons I 
don't want to have run something like this to find my drive mappings):

$ for disk in /dev/sd*; do echo -n $disk$'\t'; cygpath -m $disk; done
/dev/sda//./PhysicalDrive0
/dev/sda1   //./D:
/dev/sdb//./PhysicalDrive1
/dev/sdc//./PhysicalDrive2
/dev/sdc1   //./Volume{88cc26b4-e0e5-11e9-9cc4-806e6f6e6963}
/dev/sdc2   //./C:
/dev/sdd//./PhysicalDrive3
/dev/sdd1   //./B:
/dev/sde//./PhysicalDrive4
/dev/sde1   //./HarddiskVolume5
/dev/sde2   //./E:
/dev/sdf//./PhysicalDrive5
/dev/sdf1   //./I:

​Thanks in advance for any help with this, it would be very much appreciated as 
I rely on Cygwin a lot.