#192 hide partition

open
nobody
5
2014-04-14
2011-12-13
happy vesla
No

Hello
I installed refit and it works great, but it shows all 2 ntfs partitions (one i use only for games). Is it possible to remove this non-bootable partition from the refit menu?

Discussion

  • Joe van Tunen
    Joe van Tunen
    2011-12-20

    There is no option to not list specific partitions.

    You could try editing the volume boot block so that rEFIt thinks it doesn't have boot code.

    Use "diskutil list" to list your disks.

    Use "sudo gpt -r show -l /dev/disk0" to list the partitions on disk 0.

    Use "sudo dd if=/dev/disk0 skip=1658208296 count=1 | xxd" to dump the boot block of a partition that starts at block 1658208296.

    If the boot block contains the text "BOOTMGR" or "NTLDR", then rEFIt will think it's a Windows bootable partition even though your partition doesn't contain those boot files. rEFIt doesn't check for the existence of those files because rEFIt doesn't have an EFI file system driver for NTFS.

     
  • happy vesla
    happy vesla
    2011-12-20

    yep, have this

    aries:refit vesla$ sudo dd if=/dev/disk1 skip=409640 count=1 | xxd
    1+0 records in
    1+0 records out
    512 bytes transferred in 0.000184 secs (2781715 bytes/sec)
    0000000: eb52 904e 5446 5320 2020 2000 0208 0000 .R.NTFS .....
    0000010: 0000 0000 00f8 0000 3f00 ff00 2840 0600 ........?...(@..
    0000020: 0000 0000 8000 8000 3fce 5674 0000 0000 ........?.Vt....
    0000030: 0000 0c00 0000 0000 0200 0000 0000 0000 ................
    0000040: f600 0000 0100 0000 16ab b672 b4b6 72c4 ...........r..r.
    0000050: 0000 0000 fa33 c08e d0bc 007c fb68 c007 .....3.....|.h..
    0000060: 1f1e 6866 00cb 8816 0e00 6681 3e03 004e ..hf......f.>..N
    0000070: 5446 5375 15b4 41bb aa55 cd13 720c 81fb TFSu..A..U..r...
    0000080: 55aa 7506 f7c1 0100 7503 e9dd 001e 83ec U.u.....u.......
    0000090: 1868 1a00 b448 8a16 0e00 8bf4 161f cd13 .h...H..........
    00000a0: 9f83 c418 9e58 1f72 e13b 060b 0075 dba3 .....X.r.;...u..
    00000b0: 0f00 c12e 0f00 041e 5a33 dbb9 0020 2bc8 ........Z3... +.
    00000c0: 66ff 0611 0003 160f 008e c2ff 0616 00e8 f...............
    00000d0: 4b00 2bc8 77ef b800 bbcd 1a66 23c0 752d K.+.w......f#.u-
    00000e0: 6681 fb54 4350 4175 2481 f902 0172 1e16 f..TCPAu$....r..
    00000f0: 6807 bb16 6870 0e16 6809 0066 5366 5366 h...hp..h..fSfSf
    0000100: 5516 1616 68b8 0166 610e 07cd 1a33 c0bf U...h..fa....3..
    0000110: 2810 b9d8 0ffc f3aa e95f 0190 9066 601e (........_...f`.
    0000120: 0666 a111 0066 0306 1c00 1e66 6800 0000 .f...f.....fh...
    0000130: 0066 5006 5368 0100 6810 00b4 428a 160e .fP.Sh..h...B...
    0000140: 0016 1f8b f4cd 1366 595b 5a66 5966 591f .......fY[ZfYfY.
    0000150: 0f82 1600 66ff 0611 0003 160f 008e c2ff ....f...........
    0000160: 0e16 0075 bc07 1f66 61c3 a0f8 01e8 0900 ...u...fa.......
    0000170: a0fb 01e8 0300 f4eb fdb4 018b f0ac 3c00 ..............<.
    0000180: 7409 b40e bb07 00cd 10eb f2c3 0d0a 4120 t.............A
    0000190: 6469 736b 2072 6561 6420 6572 726f 7220 disk read error
    00001a0: 6f63 6375 7272 6564 000d 0a42 4f4f 544d occurred...BOOTM
    00001b0: 4752 2069 7320 6d69 7373 696e 6700 0d0a GR is missing...
    00001c0: 424f 4f54 4d47 5220 6973 2063 6f6d 7072 BOOTMGR is compr
    00001d0: 6573 7365 6400 0d0a 5072 6573 7320 4374 essed...Press Ct
    00001e0: 726c 2b41 6c74 2b44 656c 2074 6f20 7265 rl+Alt+Del to re
    00001f0: 7374 6172 740d 0a00 8ca9 bed6 0000 55aa start.........U.

    but how edit block and remove this "BOOTMGR"? :)

     
  • Joe van Tunen
    Joe van Tunen
    2011-12-22

    I didn't list the commands because I didn't want you to blow up your disk accidentally :-)

    You could output the boot block to a binary file in your home directory:
    sudo dd if=/dev/disk1 skip=409640 count=1 of=bootblock.bin

    Make a copy for safe keeping:
    dd if=bootblock.bin of=bootblock2.bin

    Then edit bootblock.bin using a hex editor or more commands:

    First verify the positions (0x1AB and 0x1C0) and size (7 characters) of the strings you want to replace:
    echo $(dd if=bootblock.bin bs=1 iseek=$((0x1AB)) count=7 2> /dev/null)
    echo $(dd if=bootblock.bin bs=1 iseek=$((0x1C0)) count=7 2> /dev/null)

    Then you can replace the text at those positions:
    echo -n "_OOTMGR" | dd of=bootblock.bin bs=1 oseek=$((0x1AB)) count=7 conv=notrunc
    echo -n "_OOTMGR" | dd of=bootblock.bin bs=1 oseek=$((0x1C0)) count=7 conv=notrunc

    Then you can verify the contents to make sure you didn't change anything else:
    dd if=bootblock.bin | xxd

    Finally, use dd to output that back to disk:
    sudo dd of=/dev/disk1 seek=409640 count=1 if=bootblock.bin

    And verify that the change made it to disk:
    sudo dd if=/dev/disk1 skip=409640 count=1 | xxd

     
  • happy vesla
    happy vesla
    2011-12-22

    aries:home vesla$ sudo dd if=/dev/disk1 skip=409640 count=1 | xxd
    Password:
    1+0 records in
    1+0 records out
    512 bytes transferred in 0.000187 secs (2739137 bytes/sec)
    0000000: eb52 904e 5446 5320 2020 2000 0208 0000 .R.NTFS .....
    0000010: 0000 0000 00f8 0000 3f00 ff00 2840 0600 ........?...(@..
    0000020: 0000 0000 8000 8000 3fce 5674 0000 0000 ........?.Vt....
    0000030: 0000 0c00 0000 0000 0200 0000 0000 0000 ................
    0000040: f600 0000 0100 0000 16ab b672 b4b6 72c4 ...........r..r.
    0000050: 0000 0000 fa33 c08e d0bc 007c fb68 c007 .....3.....|.h..
    0000060: 1f1e 6866 00cb 8816 0e00 6681 3e03 004e ..hf......f.>..N
    0000070: 5446 5375 15b4 41bb aa55 cd13 720c 81fb TFSu..A..U..r...
    0000080: 55aa 7506 f7c1 0100 7503 e9dd 001e 83ec U.u.....u.......
    0000090: 1868 1a00 b448 8a16 0e00 8bf4 161f cd13 .h...H..........
    00000a0: 9f83 c418 9e58 1f72 e13b 060b 0075 dba3 .....X.r.;...u..
    00000b0: 0f00 c12e 0f00 041e 5a33 dbb9 0020 2bc8 ........Z3... +.
    00000c0: 66ff 0611 0003 160f 008e c2ff 0616 00e8 f...............
    00000d0: 4b00 2bc8 77ef b800 bbcd 1a66 23c0 752d K.+.w......f#.u-
    00000e0: 6681 fb54 4350 4175 2481 f902 0172 1e16 f..TCPAu$....r..
    00000f0: 6807 bb16 6870 0e16 6809 0066 5366 5366 h...hp..h..fSfSf
    0000100: 5516 1616 68b8 0166 610e 07cd 1a33 c0bf U...h..fa....3..
    0000110: 2810 b9d8 0ffc f3aa e95f 0190 9066 601e (........_...f`.
    0000120: 0666 a111 0066 0306 1c00 1e66 6800 0000 .f...f.....fh...
    0000130: 0066 5006 5368 0100 6810 00b4 428a 160e .fP.Sh..h...B...
    0000140: 0016 1f8b f4cd 1366 595b 5a66 5966 591f .......fY[ZfYfY.
    0000150: 0f82 1600 66ff 0611 0003 160f 008e c2ff ....f...........
    0000160: 0e16 0075 bc07 1f66 61c3 a0f8 01e8 0900 ...u...fa.......
    0000170: a0fb 01e8 0300 f4eb fdb4 018b f0ac 3c00 ..............<.
    0000180: 7409 b40e bb07 00cd 10eb f2c3 0d0a 4120 t.............A
    0000190: 6469 736b 2072 6561 6420 6572 726f 7220 disk read error
    00001a0: 6f63 6375 7272 6564 000d 0a5f 4f4f 544d occurred..._OOTM
    00001b0: 4752 2069 7320 6d69 7373 696e 6700 0d0a GR is missing...
    00001c0: 5f4f 4f54 4d47 5220 6973 2063 6f6d 7072 _OOTMGR is compr
    00001d0: 6573 7365 6400 0d0a 5072 6573 7320 4374 essed...Press Ct
    00001e0: 726c 2b41 6c74 2b44 656c 2074 6f20 7265 rl+Alt+Del to re
    00001f0: 7374 6172 740d 0a00 8ca9 bed6 0000 55aa start.........U.

    "Boot from Legacy OS"
    what word i should remove? :D
    Thank for Help :)

     
  • Joe van Tunen
    Joe van Tunen
    2011-12-24

    I think for "Legacy OS" you have to also remove the "55aa" tag at the end of the boot block also:

    echo -n "U_" | dd of=bootblock.bin bs=1 oseek=510 count=2 conv=notrunc

    Changing the first byte from 0xeb to 0x00 would also work.

     
  • happy vesla
    happy vesla
    2011-12-24

    WOOHOO!
    many thanks :)

     
  • Leo Bruno
    Leo Bruno
    2014-04-14

    Hi:

    Searching for a sollution, I understood that the problem is the word "Boot" that is found on the boot block.

    As I see, the solution you found is to change the string "Boot" that I'm refering to another.

    I was able to change as you teached, but when I try to output back to disk, I keep getting "Resource busy"

    MacBook-Pro-de-Macbook:~ Macbook$ sudo dd of=/dev/disk0 seek=293642240 count=1 if=bootblock.bin
    dd: /dev/disk0: Resource busy

     
  • happy vesla
    happy vesla
    2014-04-14

    are you trying to edit mac os system disk under os?
    this is my gplist output

    aries:Downloads vesla$ diskutil list
    /dev/disk0
    #: TYPE NAME SIZE IDENTIFIER
    0: GUID_partition_scheme 1.0 TB disk0
    1: EFI EFI 209.7 MB disk0s1
    2: Microsoft Basic Data fsw 999.3 GB disk0s2
    /dev/disk1
    #: TYPE NAME SIZE IDENTIFIER
    0: GUID_partition_scheme
    480.1 GB disk1
    1: EFI EFI 209.7 MB disk1s1
    2: Apple_CoreStorage 400.0 GB disk1s2
    3: Apple_Boot Recovery HD 650.0 MB disk1s3
    4: Microsoft Basic Data windows 79.2 GB disk1s4
    /dev/disk2
    #: TYPE NAME SIZE IDENTIFIER
    0: Apple_HFS macos 399.7 GB disk2
    /dev/disk3
    #: TYPE NAME SIZE IDENTIFIER
    0: GUID_partition_scheme
    2.0 TB disk3
    1: EFI EFI 209.7 MB disk3s1
    2: Apple_HFS fsm 2.0 TB disk3s2
    /dev/disk4
    #: TYPE NAME SIZE IDENTIFIER
    0: Apple_partition_scheme *7.3 MB disk4
    1: Apple_partition_map 32.3 KB disk4s1
    2: Apple_HFS Adobe Flash Player I... 7.3 MB disk4s2

     
  • Joe van Tunen
    Joe van Tunen
    2014-04-14

    I think you have to unmount the entire disk to output to the disk device. Change the command to write to the partition instead of the disk.

    First unmount the partition that you want to write to.

    Then copy the bootblock of the partition to a file.
    dd if=/dev/disk0sN of=bootblock.bin count=1

    Make a copy of the boot block for safe keeping, then edit it, then output it to the partition:
    dd of=/dev/disk0sN if=bootblock.bin count=1

    N is the slice number shown by the "diskutil list" command.

     
    • Leo Bruno
      Leo Bruno
      2014-04-14

      I'm sorry.

      I'm new to Unix Based Systems.

      I tried to eject the partition, but I got the same error.

      Having in ind that I only have 1 disc:

      What will I have to do to unmount the etire disk and then apply the modified bin file ?

      I'm also not fammiliar with the command you mentioned.