fdisk_aix.c 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. #if ENABLE_FEATURE_AIX_LABEL
  2. /*
  3. * Copyright (C) Andreas Neuper, Sep 1998.
  4. *
  5. * Licensed under GPLv2, see file LICENSE in this tarball for details.
  6. */
  7. typedef struct {
  8. unsigned int magic; /* expect AIX_LABEL_MAGIC */
  9. unsigned int fillbytes1[124];
  10. unsigned int physical_volume_id;
  11. unsigned int fillbytes2[124];
  12. } aix_partition;
  13. #define AIX_LABEL_MAGIC 0xc9c2d4c1
  14. #define AIX_LABEL_MAGIC_SWAPPED 0xc1d4c2c9
  15. #define AIX_INFO_MAGIC 0x00072959
  16. #define AIX_INFO_MAGIC_SWAPPED 0x59290700
  17. #define aixlabel ((aix_partition *)MBRbuffer)
  18. /*
  19. Changes:
  20. * 1999-03-20 Arnaldo Carvalho de Melo <acme@conectiva.com.br>
  21. * Internationalization
  22. *
  23. * 2003-03-20 Phillip Kesling <pkesling@sgi.com>
  24. * Some fixes
  25. */
  26. static smallint aix_other_endian; /* bool */
  27. static smallint aix_volumes = 1; /* max 15 */
  28. /*
  29. * only dealing with free blocks here
  30. */
  31. static void
  32. aix_info(void)
  33. {
  34. puts("\n"
  35. "There is a valid AIX label on this disk.\n"
  36. "Unfortunately Linux cannot handle these disks at the moment.\n"
  37. "Nevertheless some advice:\n"
  38. "1. fdisk will destroy its contents on write.\n"
  39. "2. Be sure that this disk is NOT a still vital part of a volume group.\n"
  40. " (Otherwise you may erase the other disks as well, if unmirrored.)\n"
  41. "3. Before deleting this physical volume be sure to remove the disk\n"
  42. " logically from your AIX machine. (Otherwise you become an AIXpert).\n"
  43. );
  44. }
  45. static int
  46. check_aix_label(void)
  47. {
  48. if (aixlabel->magic != AIX_LABEL_MAGIC
  49. && aixlabel->magic != AIX_LABEL_MAGIC_SWAPPED
  50. ) {
  51. current_label_type = 0;
  52. aix_other_endian = 0;
  53. return 0;
  54. }
  55. aix_other_endian = (aixlabel->magic == AIX_LABEL_MAGIC_SWAPPED);
  56. update_units();
  57. current_label_type = LABEL_AIX;
  58. g_partitions = 1016;
  59. aix_volumes = 15;
  60. aix_info();
  61. /*aix_nolabel();*/ /* %% */
  62. /*aix_label = 1;*/ /* %% */
  63. return 1;
  64. }
  65. #endif /* AIX_LABEL */