Not getting UUID from diskutil on OSX - osx-lion

Running Mac OSX 10.7.5
I want to enable NTFS on a USB3 external hard disk and need the UUID to do it (http://ntfsonmac.com) but diskutil is refusing to give me the UUID. I start with:
diskutil info /Volumes/HD-PCTU3/
then from this:
diskutil info disk2s1
Device Identifier: disk2s1
Device Node: /dev/disk2s1
Part of Whole: disk2
Device / Media Name: Untitled 1
Volume Name: HD-PCTU3
Escaped with Unicode: HD-PCTU3
Mounted: Yes
Mount Point: /Volumes/HD-PCTU3
Escaped with Unicode: /Volumes/HD-PCTU3
File System Personality: NTFS
Type (Bundle): ntfs
Name (User Visible): Windows NT File System (NTFS)
Partition Type: Windows_NTFS
OS Can Be Installed: No
Media Type: Generic
Protocol: USB
SMART Status: Not Supported
Total Size: 500.1 GB (500107804672 Bytes) (exactly 976773056 512-Byte-Blocks)
Volume Free Space: 499.9 GB (499896778752 Bytes) (exactly 976360896 512-Byte-Blocks)
Device Block Size: 512 Bytes
Read-Only Media: No
Read-Only Volume: Yes
Ejectable: Yes
Whole: No
Internal: No
but as can be seen there is no UUID displayed. Any ideas why and/or how to get the UUID?

The only way I've been able to find involves a somewhat poorly documented feature of the hfs.util.
Run the diskutil command and then copy/remember/save the Device Identifier:
diskutil info /Volumes/my_drive_label | grep "Device Identifier"
You can use the hfs.util with the Device Identifier (replacing disk2s1 below) from diskutil to (re)generate a UUID for your volume:
/System/Library/Filesystems/hfs.fs/hfs.util -s disk2s1
Keep in mind this won't work for every volume, if the volume is not an HFS drive than it may not work, and other Filesystem/*.fs/*.util commands may not have a -s verb to generate UUIDs.
UPDATE
In Yosemite and after the -s flag has been disabled at the source level. I haven't been able to find a pre-modified version of hfs.util, but you can do it yourself using the information found in this Superuser question, summarized here:
Download the hfs.util source from Apple and extract it to a temporary folder
Download hfs_fsctl.h from Apple and put it in the hfs.util folder
Change line 47 of hfsutil_jnl.c into #include <hfs_fsctl.h>
Change line 80 of hfsutil_main.c into #include <System/uuid/uuid.h>
Change line 81 of hfsutil_main.c into static unsigned char kFSUUIDNamespaceSHA1[] = {0xB3,0xE2,0x0F,0x39,0xF2,0x92,0x11,0xD6,0x97,0xA4,0x00,0x30,0x65,0x43,0xEC,0xAC}; (replacing the include line)
Also add #define HFS_UUID_SUPPORT 1 to hfsutil_main.c
There might still be something missing in the argument parsing section if the above doesn't work, please reference the Superuser question and comment if I've missed something.
Some people have also reported that it may be possible to use Gparted to change the UUID of a drive.

I'm on Mac OS X 10.6.8 and bought NTFS 4TB Seagate USB3.0 drive.
Plugged in, Mac allowed me to read files from it, but not write to it. When I select 'Get Info' for the volume/disk, I see 'You can read only' under 'Sharing & Permissions'.
I copied a large file from Windows 10 to the USB Drive, worked fine. I then downloaded the file to Mac, worked fine, but won't allow me to write anything from Mac to the USB drive, or make any changes to it eg. delete or rename files on the USB drive.
My reason for getting this USB drive formatted in NTFS was to copy files from Mac larger than 4GB to Windows for redundant backup, because of 4GB limit in FAT.
One solution I found online was to sudo echo UUID to /etc/fstab
When I diskutil info, I don't get UUID.
I also see the following extracts:
File System Personality: NTFS
Type (Bundle): ntfs
Name (User Visible): Windows NT File System (NTFS)
&
Read-Only Media: No
Read-Only Volume: Yes
Ejectable: Yes
My solution was to download Samsung NTFS for Mac Driver from:
https://www.seagate.com/au/en/support/downloads/item/samsung-ntfs-driver-master-dl/
After installation & reboot, I noticed the following changes:
When I select 'Get Info' for the volume/disk, I see 'You can read and write' under 'Sharing & Permissions'.
2.
File System Personality: UFSD_NTFS
Type (Bundle): ufsd_NTFS
Name (User Visible): Windows NT Filesystem
3.
Read-Only Media: No
Read-Only Volume: No
Ejectable: Yes
The readme file (pdf) that comes with the download says NTFS features also work in Mac for the USB drive.
Now I can read/write to the disk, and is also visible in Finder. I've tested read & write speeds with a 2GB file, and don't see any difference in performance/speed between the NTFS & HFS+ Journaled volumes.
Finally after 2 days of reading about sudo, hfs.util & diskutil, I can now get back to backing up data from Mac 10.6 to USB NTFS drive.

Related

Where on disk is the BIOS file used by Simics?

(I saw one of my previous posts didn't actually answer the "where's the BIOS file used by simics?" question, so I renamed the previous one and am pulling that question out and making it standalone here.)
I can see the BIOS code for a default "targets\qsp-x86\firststeps.simics" invocation by just stepping through the debugger from the start. But if I want to see the full binary, is there a specific file somewhere I can look at?
you can check "bios" attribute on motherboard image:
simics> board.mb->bios
"%simics%/targets/qsp-x86/images/SIMICSX58IA32X64_1_0_0_bp_r.fd"
You can specify what BIOS image to use by bios_image script parameter to qsp-clear-linux.simics scripts.
Help info for the script:
$ ./simics -h targets/qsp-x86/qsp-clear-linux.simics
System:
bios_image - existing file or NIL
BIOS file.
Default value:
"%simics%/targets/qsp-x86/images/SIMICSX58IA32X64_1_0_0_bp_r.fd"
you can run with your own BIOS like this:
$ ./simics -e '$bios_image=my-bios.bin' targets/qsp-x86/qsp-clear-linux.simics
Now the BIOS is not quite handled consistently with some other things. Typically in Simics, disks and similar things are images. You can list them using list-persistent-images and resolve locations using lookup-file:
simics> list-persistent-images
┌─────────────────────┬────────────┬───────────────────────────────────────────────────────┐
│Image │Unsaved data│File(s) (read-only/read-write) │
├─────────────────────┼────────────┼───────────────────────────────────────────────────────┤
│board.disk0.hd_image │ no│%simics%/targets/qsp-x86/images/cl-b28910-v2.craff (ro)│
│board.disk1.hd_image │ no│ │
│board.mb.sb.spi_image│ yes│%simics%/targets/qsp-x86/images/spi-flash.bin (ro) │
└─────────────────────┴────────────┴───────────────────────────────────────────────────────┘
simics> lookup-file "%simics%/targets/qsp-x86/images/spi-flash.bin"
"/disk1/simics-6/simics-qsp-x86-6.0.47/targets/qsp-x86/images/spi-flash.bin"
The BIOS in the QSP is just loaded straight into target memory for execution. Which is a bit of a cheat for convenience.
Upon searching around, I found the following folder:
C:\Users\yourusername\AppData\Local\Programs\Simics\simics-qsp-x86-6.0.44\targets\qsp-x86\images
Inside that folder are the following 3 files:
SIMICSX58IA32X64_1_0_0_bp_r.fd
SIMICSX58IA32X64-ahci.fd
spi-flash. bin
Both SIMICSX58IA32X64_1_0_0_bp_r. fd and SIMICSX58IA32X64-ahci.fd have UEFI filevolume headers at the start, and a seeming BIOS entry point at the end. The spi-flash. bin seems to have a placeholder of the flash descriptor which would go at the start of the flash, but is mostly empty. So I believe Intel basically either stitches these together in memory, or possibly just uses the spi-flash. bin to allow for "soft strap" configuration or somesuch (since it's a virtual MCH/ICH anyway.)

Maxima does not start on Sierra

I downloaded and installed the latest Ma version of Maxima from source forge. When I try to launch it, I get
“Maxima.app” is damaged and can’t be opened. You should move it to the Trash.
This happens with both available versions, the one with VTK and the one without VTK.
How can I get it running?
I have MacOS 10.12.6
and both versions are here:
https://sourceforge.net/projects/maxima/files/Maxima-MacOS/5.40.0-MacOSX/
Others have run into the same problem. I don't use MacOS so I'm not sure what the problem is. Anyway, take a look at this bug report: #3316: Maxima VTK for Mac 5.40 is corrupt. The person who submitted it reported they got it working by following the advice in the comments.
See also thread 39: https://sourceforge.net/p/maxima/support-requests/39/
This is a really important thread to the larger MacOS community.
I have a MacBook Pro running OS X El Capitan, which is locked down a few versions back from the current MacOS Mojave.
I spent an entire night trying to get every wxMaxima from 5.36 to 5.42 running without success - even compiling from sources.
In desperation I found the thread 39 and entered the line:
(setf sb-impl::default-external-format :utf-8)
into a ~home/.sbclrc file (/Users/myName/.sbclrc). It was only then that the GUI and the Maxima engine could connect and a normal session could be established. Maxima, its maintainers and its users are too important a world resource to be stymied by such an esoteric and non-obvious bug.
A user encountering this bug will first go into the preferences menu and start trying to make sure that the file addresses and port numbers are correct, but experimentation can corrupt these and lead to other problems.
In my case following excerpt from https://sourceforge.net/p/maxima/mailman/message/35910588/ helped:
(0) Double-click the icon of "Terminal.app" in the folder "/Applications/Utilities", then the command-line-user-interface window is opened.
(1) Move the current working directory to the location of the disc image with the command "cd". (e.g. "Downloads" folder)
$ cd $HOME/Downloads
(2) You can check the attribute with the command "ls -l#":
(You will be able to find "com.apple.quarantine" which is the name of the attribute.)
$ ls -l# ./*.dmg
-rw-r--r--# 1 name staff 471227521 6 24 23:17 ./Maxima-5.40.0-VTK-macOS.dmg
com.apple.quarantine 62
(3) Remove the attribute "com.apple.quarantine" with the command "xattr -d com.apple.quarantine ./*.dmg":
$ xattr -d com.apple.quarantine ./Maxima-5.40.0-VTK-macOS.dmg
(4) Verify that the attribute "com.apple.quarantine" was removed:
$ ls -l# ./*.dmg
-rw-r--r-- 1 name staff 471227521 6 24 23:17 ./Maxima-5.40.0-VTK-macOS.dmg
(5) Double-click the icon of the disc image file to open.
After that, you should install Maxima.app into your "Applications" folder ("/Applications"). And you should drag the Launchers icon from the disc image to another place of your filesystem. You can install launchers to anywhere you like.
Then you will be able to launch Maxima with Maxima.app or launchers.

What corruption is indicated by WinDbg and !chkimg?

I am having often BSODs and WinDbg report similar corruption for most of them
4: kd> !chkimg -lo 50 -d !nt
fffff80177723e6d-fffff80177723e6e 2 bytes - nt!MiPurgeZeroList+6d
[ 80 fa:00 e9 ]
2 errors : !nt (fffff80177723e6d-fffff80177723e6e)
and
CHKIMG_EXTENSION: !chkimg -lo 50 -d !nt
fffff8021531ae6d-fffff8021531ae6e 2 bytes - nt!MiPurgeZeroList+6d
[ 80 fa:00 aa ]
2 errors : !nt (fffff8021531ae6d-fffff8021531ae6e)
What does it mean? What with what is compared and how it can be that corruption is similar? Does it explicitly indicates RAM problem?
UPDATE
What do these numbers mean? fffff80177723e6d and fffff8021531ae6d? What does it mean, that endings conincide?
What does the following code mean: nt!MiPurgeZeroList+6d?
I already answered this on superuser.com. Windbg downloads the original Exe/DLLs from the Symbol Server and now the chkimg command detects corruption in the images of executable files by comparing them to the copy on a symbol store.
All sections of the file are compared, except for sections that are
discardable, that are writeable, that are not executable, that have
"PAGE" in their name, or that are from INITKDBG. You can change this
behavior can by using the -ss, -as, or -r switches.
!chkimg displays any mismatch between the image and the file as an
image error, with the following exceptions:
Addresses that are occupied by the Import Address Table (IAT) are not checked.
Certain specific addresses in Hal.dll and Ntoskrnl.exe are not checked, because certain changes occur when these sections are loaded.
To check these addresses, include the -nospec option.
If the byte value 0x90 is present in the file, and if the value 0xF0 is present in the corresponding byte of the image (or vice
versa), this situation is considered a match. Typically, the symbol
server holds one version of a binary that exists in both uniprocessor
and multiprocessor versions. On an x86-based processor, the lock
instruction is 0xF0, and this instruction corresponds to a nop (0x90)
instruction in the uniprocessor version. If you want !chkimg to
display this pair as a mismatch, set the -noplock option.
If the RAM is fine, check the HDD / HDD cables for errors (disk diag tool and run chkdsk to detect and fix NTFS issues). You can also connect the HDD to different SATA port on the mainboard.

Learning when was the last time a file is accessed

I was wondering if learning when was the last time a file is accessed is possible. I mean like when a .dll file in windows is used by any other program. I wonder if are there any features in any operating system that keeps a file's last access date, or extensions.
Thanks!
Unix provides the stat command or the fstat() function to fetch the last access time of a file.
eos$ stat file
File: `file'
Size: 280486 Blocks: 548 IO Block: 4096 regular file
Device: 12h/18d Inode: 1963857568 Links: 1
Access: (0600/-rw-------) Uid: (83991/ vshesha) Gid: ( 108/ abcd)
Access: 2014-09-16 15:39:09.000000000 -0400
Modify: 2014-09-16 15:39:09.000000002 -0400
Change: 2014-09-16 15:39:09.000000000 -0400
For Windows see this post
This is a feature of a filesystem/OS. In case of Windows and it's default file system NTFS, you need to enable the feature first: http://www.groovypost.com/howto/microsoft/enable-last-access-time-stamp-to-files-folder-windows-7/
In the cmd prompt, Type in "fsutil behavior set disablelastaccess 0" and press enter.
Restart your PC for changes to take affect
Usually all file systems save the file access time.
For example, take a look at NTFS for Windows. Or ext2, and older version of the file system commonly used in linux.

How to mount sd card to android source-built emulator?

I've built the android source code and run the emulator successfully except one thing - SD card couldn't be mounted. Here is how I tried to mount it.
1. create a sdcard.img by mksdcard tool under /out/host/linux-x86/bin/
mksdcard 256M out/target/product/generic/sdcard.img
sdcard.img is rw
run emulator with command line:
out/host/linux-x86/bin/emulator -sysdir out/target/product/generic/ -system out/target/product/generic/system.img -ramdisk out/target/product/generic/ramdisk.img -data out/target/product/generic/userdata.img -kernel prebuilt/android-arm/kernel/kernel-qemu -skindir sdk/emulator/skins -skin WVGA800 -scale 0.7 -memory 512 -partition-size 2024 -sdcard out/target/product/generic/sdcard.img
the file under /system/etc/vold.conf is ok.
system log shows:
<6>mmc0: new SD card at address e118
<6>mmcblk0: mmc0:e118 SU02G 256 MiB
<6> mmcblk0:
But the truth is that it failed to mount sdcard. It will get a "read only" error if trying to write data in /mnt/sdcard/
Anyone can help on this? thanks in advance.
just follow below step:
Goto the Android Virtual device manager
click New for create new Vitual device
Add Name and choose your package
Under hardware you just click New Button and then pop new Window
After select SdCard support in drop down list near Property
finally you have gotten emulator with SDCard support
First, emulator should work without any parameters by setting up the right environment variables as described here.
Create sd card image file sdcard.img (on linux, using dd /dev/zero to make empty file filled by zeroes suffices)
Make FAT or ext4 filesystem on it (on linux, mkdosfs path/to/sdcard.img) It should be possible to skip this step and format it from within emulator, too.
Then run
emulator -sdcard path/to/sdcard.img
In my case, it shows in Settings as "usb storage", instead of "sd card".