Re: disk format question
On 01/08/2013 10:24 PM, Warren Young wrote: On 1/8/2013 08:38, bartels wrote: That may very well be true, but I have a friend called locate: I *had* a friend called which, but he didn't find it. I have now unfriended him. ;) Very funny. Yeah, know thy friends, is true. Cygwin remains a mongrel, an alien, an exotic thing in almost hostile territory. In that case, you shouldn't be looking at /dev names anyway. They're assigned in order of device discovery, so the device that gets called /dev/sdb or whatever depends on what happened before your code ran. It turns out that it is even easier: the device was switched to read-only. I could not see that, because it is remote. And dd does not work on udf, but format.com has no such problems. In Disk Management, you can permanently assign a USB key a different drive letter than the default. Now when you put it in, it appears somewhere other than code blindly hard-coded with a /dev name expects. I know. We assign letters with diskpart. Does windows leave a trail when mounting? Oh, doubtless there's something buried in the NT device namespace, mentioned in the document I pointed you to. Maybe you could dump two copies of it and diff(1) them, and assume that the one line that appears in the output is the new device. No need for that, fortunately. Ugh. Well said. - bartels. -- 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: disk format question
Warren Young wrote: If this were Linux, I'd suggest basing your script's logic on device or filesystem UUIDs, but I don't know how to do that under Cygwin. Under Cygwin, you can refer to a device by UUID by looking under the path /proc/sys/GLOBAL??/ (those are literal question marks; you'll probably need to escape them in bash). There's a little more discussion about this directory from Corinna at http://cygwin.com/ml/cygwin-developers/2012-10/msg1.html. I've looked through the UG, and quickly searched Google, and can't find anything more in depth, though. -- Adam Dinwoodie Messages posted to this list are made in a personal capacity. -- 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: disk format question
Greetings, Warren Young! The windows format.com format.com hasn't existed since the DOS days. That includes the DOS-based versions of Windows, up through Windows ME. Under NT-derived versions of Windows, format is a built-in command in cmd.exe. You can easily check it with a simple batch file :x format /? goto :x and see that it actually calling format.com -- WBR, Andrey Repin (anrdae...@freemail.ru) 09.01.2013, 22:11 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: disk format question
On Wed, Jan 09, 2013 at 10:12:02PM +0400, Andrey Repin wrote: Greetings, Warren Young! The windows format.com format.com hasn't existed since the DOS days. That includes the DOS-based versions of Windows, up through Windows ME. Under NT-derived versions of Windows, format is a built-in command in cmd.exe. You can easily check it with a simple batch file :x format /? goto :x and see that it actually calling format.com I think we have exhausted this issue. Obviously some people have found a format program on their hard drives. Since there is no Cygwin component here, I'd appreciate it if everyone could all move on from this subject. -- 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: disk format question
Greetings, Christopher Faylor! Sorry, Christopher, I've had some troubles locally, and didn't see the other replies before I sent mine. On Wed, Jan 09, 2013 at 10:12:02PM +0400, Andrey Repin wrote: Greetings, Warren Young! The windows format.com format.com hasn't existed since the DOS days. That includes the DOS-based versions of Windows, up through Windows ME. Under NT-derived versions of Windows, format is a built-in command in cmd.exe. You can easily check it with a simple batch file :x format /? goto :x and see that it actually calling format.com I think we have exhausted this issue. Obviously some people have found a format program on their hard drives. :) Since there is no Cygwin component here, I'd appreciate it if everyone could all move on from this subject. -- 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 -- WBR, Andrey Repin (anrdae...@freemail.ru) 10.01.2013, 06:26 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
disk format question
Hello Forum, I frequently need to destroy a file system on removable media. The windows format.com claims the fs is write protected, but I hope dd can help out. The mtab is not very helpful: D: /cygdrive/d udf binary,posix=0,user,noumount,auto 1 1 My question is this: which device in /dev do I use? - bartels -- 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: disk format question
On 1/8/2013 06:59, bartels wrote: The windows format.com format.com hasn't existed since the DOS days. That includes the DOS-based versions of Windows, up through Windows ME. Under NT-derived versions of Windows, format is a built-in command in cmd.exe. claims the fs is write protected, but I hope dd can help out. It's worth a try, but if I had to take a blind bet on it, I'd say you're going to find that dd will give the same result. Cygwin is essentially a user-level process. If cmd.exe cannot do a thing, dd.exe probably can't, either. It is *possible* that unmounting the filesystem with the taskbar button will let you write to the raw device. But Windows being Windows, it's possible that will make it disappear from the system entirely, too. The mtab is not very helpful: That's because Cygwin proper does not mount local filesystems. The Cygwin mount table just shows you Cygwin-specific mappings that it has added on top of what the underlying NT kernel has done. In this case... D: /cygdrive/d udf binary,posix=0,user,noumount,auto 1 1 ...it is showing you the /cygdrive/d alias Cygwin has provided for you. My question is this: which device in /dev do I use? According to [this][1] it's probably /dev/sdb. But please do read through what I pointed you to first, and check its applicability carefully before attempting this. [1] http://cygwin.com/cygwin-ug-net/using-specialnames.html#pathnames-posixdevices -- 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: disk format question
On 01/08/2013 10:14 AM, Warren Young wrote: On 1/8/2013 06:59, bartels wrote: The windows format.com format.com hasn't existed since the DOS days. That includes the DOS-based versions of Windows, up through Windows ME. Under NT-derived versions of Windows, format is a built-in command in cmd.exe. FWIW in Windows 7: objdump -p c:/Windows/System32/format.com c:/Windows/System32/format.com: file format pei-i386 Characteristics 0x102 executable 32 bit words Time/Date Tue Jul 14 00:15:15 2009 Magic 010b(PE32) I don't know if that changes anything here though. Roger Wells claims the fs is write protected, but I hope dd can help out. It's worth a try, but if I had to take a blind bet on it, I'd say you're going to find that dd will give the same result. Cygwin is essentially a user-level process. If cmd.exe cannot do a thing, dd.exe probably can't, either. It is *possible* that unmounting the filesystem with the task/c/Windows/System32/format.combar button will let you write to the raw device. But Windows being Windows, it's possible that will make it disappear from the system entirely, too. The mtab is not very helpful: That's because Cygwin proper does not mount local filesystems. The Cygwin mount table just shows you Cygwin-specific mappings that it has added on top of what the underlying NT kernel has done. In this case... D: /cygdrive/d udf binary,posix=0,user,noumount,auto 1 1 ...it is showing you the /cygdrive/d alias Cygwin has provided for you. My question is this: which device in /dev do I use? According to [this][1] it's probably /dev/sdb. But please do read through what I pointed you to first, and check its applicability carefully before attempting this. [1] http://cygwin.com/cygwin-ug-net/using-specialnames.html#pathnames-posixdevices -- 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 -- Roger Wells, P.E. SAIC 221 Third St Newport, RI 02840 401-847-4210 (voice) 401-849-1585 (fax) roger.k.we...@saic.com -- 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: disk format question
On 01/08/2013 04:14 PM, Warren Young wrote: On 1/8/2013 06:59, bartels wrote: The windows format.com format.com hasn't existed since the DOS days. That includes the DOS-based versions of Windows, up through Windows ME. Under NT-derived versions of Windows, format is a built-in command in cmd.exe. That may very well be true, but I have a friend called locate: $ locate format.com /cygdrive/c/Windows/System32/format.com /cygdrive/c/Windows/SysWOW64/format.com /cygdrive/c/Windows/winsxs/amd64_microsoft-windows-format_31bf3856ad364e35_6.1.7600.16385_none_827dd459a3aa9980/format.com /cygdrive/c/Windows/winsxs/x86_microsoft-windows-format_31bf3856ad364e35_6.1.7600.16385_none_265f38d5eb4d284a/format.com And it even seems to work ;-) claims the fs is write protected, but I hope dd can help out. It's worth a try, but if I had to take a blind bet on it, I'd say you're going to find that dd will give the same result. Cygwin is essentially a user-level process. If cmd.exe cannot do a thing, dd.exe probably can't, either. It is *possible* that unmounting the filesystem with the taskbar button will let you write to the raw device. But Windows being Windows, it's possible that will make it disappear from the system entirely, too. I cannot touch the gui. It may not be necessary, as format.com has a /x feature. The mtab is not very helpful: That's because Cygwin proper does not mount local filesystems. The Cygwin mount table just shows you Cygwin-specific mappings that it has added on top of what the underlying NT kernel has done. Okay, I see. My question is this: which device in /dev do I use? According to [this][1] it's probably /dev/sdb. But please do read through what I pointed you to first, and check its applicability carefully before attempting this. 'Probably' is not good enough when the goal is targeted destruction :) I need a solid automated procedure to locate my device. $ cat /proc/partitions major minor #blocks name 8 0 732574584 sda 8 1104391 sda1 8 2 245063542 sda2 816 976762584 sdb 817102400 sdb1 818 976657408 sdb2 832 4882808320 sdc 833131072 sdc1 834 4882675712 sdc2 848 3909092 sdd 849 3909091 sdd1 864 7566844 sde 865 7566016 sde1 880 31590400 sdf 881 31590400 sdf1 $ df -h Filesystem Size Used Avail Use% Mounted on C:/cygwin/bin 932G 62G 871G 7% /usr/bin C:/cygwin/lib 932G 62G 871G 7% /usr/lib C:/cygwin 932G 62G 871G 7% / C: 932G 62G 871G 7% /cygdrive/c D: 31G 31G 0 100% /cygdrive/d E: 102M 30M 73M 30% /cygdrive/e F: 234G 137G 98G 59% /cygdrive/f K: 3.8G 616M 3.2G 17% /cygdrive/k O: 4.6T 1.7T 3.0T 36% /cygdrive/o X: 3.1G 3.1G 0 100% /cygdrive/x Y: 4.6T 1.7T 3.0T 36% /cygdrive/y Z: 7.3G 46M 7.2G 1% /cygdrive/z [1] http://cygwin.com/cygwin-ug-net/using-specialnames.html#pathnames-posixdevices Yeah, I had a look see on that page before and it is not all that helpful, for reasons you explained. Does windows leave a trail when mounting? Prospects are not good without it. Thanks for the help. - bartels -- 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: disk format question
On Tue, Jan 8, 2013 at 4:14 PM, Warren Young wrote: On 1/8/2013 06:59, bartels wrote: The windows format.com format.com hasn't existed since the DOS days. That includes the DOS-based versions of Windows, up through Windows ME. Under NT-derived versions of Windows, format is a built-in command in cmd.exe. Your statements are contradicted by evidence: $ ls -l /cygdrive/c/Windows/System32/format.com -rwxrwx---+ 2 35K Nov 2 2006 /cygdrive/c/Windows/System32/format.com* $ file /cygdrive/c/Windows/System32/format.com /cygdrive/c/Windows/System32/format.com: PE32 executable (console) Intel 80386, for MS Windows $ strings /cygdrive/c/Windows/System32/cmd.exe | grep -wi format no output Csaba -- GCS a+ e++ d- C++ ULS$ L+$ !E- W++ P+++$ w++$ tv+ b++ DI D++ 5++ The Tao of math: The numbers you can count are not the real numbers. Life is complex, with real and imaginary parts. Ok, it boots. Which means it must be bug-free and perfect. -- Linus Torvalds People disagree with me. I just ignore them. -- Linus Torvalds -- 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: disk format question
On 1/8/2013 08:38, bartels wrote: On 01/08/2013 04:14 PM, Warren Young wrote: On 1/8/2013 06:59, bartels wrote: The windows format.com format.com hasn't existed since the DOS days. That may very well be true, but I have a friend called locate: I *had* a friend called which, but he didn't find it. I have now unfriended him. ;) My question is this: which device in /dev do I use? According to [this][1] it's probably /dev/sdb. But please do read through what I pointed you to first, and check its applicability carefully before attempting this. 'Probably' is not good enough when the goal is targeted destruction :) In that case, you shouldn't be looking at /dev names anyway. They're assigned in order of device discovery, so the device that gets called /dev/sdb or whatever depends on what happened before your code ran. Actually, it's even worse than that. In Disk Management, you can permanently assign a USB key a different drive letter than the default. Now when you put it in, it appears somewhere other than code blindly hard-coded with a /dev name expects. Or, put two USB keys in, one gets called F: (say) and the other G:. Remove both. Now plug the second back in...it's still called G:! Hence, it gets a different /dev name. If this were Linux, I'd suggest basing your script's logic on device or filesystem UUIDs, but I don't know how to do that under Cygwin. Does windows leave a trail when mounting? Oh, doubtless there's something buried in the NT device namespace, mentioned in the document I pointed you to. Maybe you could dump two copies of it and diff(1) them, and assume that the one line that appears in the output is the new device. Ugh. -- 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: disk format question
bartels sent the following at Tuesday, January 08, 2013 9:00 AM I frequently need to destroy a file system on removable media. The windows format.com claims the fs is write protected, but I hope dd can help out. In Windows Explorer, right clicking on the drive should give a format command. Whether using it will tell you that the drive is write protected works is another issue. - Barry Disclaimer: Statements made herein are not made on behalf of NIAID. -- 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