Current-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: 1.5TB drives = fail (RAIDframe/fdisk/sysinst)



netbsd%precedence.co.uk@localhost said:
> With 1.5TB drives

Obviously the MBR partitioning scheme is approaching its
limits - a sector number doesn't fit into a signed integer
anymore.

> I've written a script to  create RAID-1/RAID-5 as specified from a
> standard non-RAID disk, so I  booted from a USB installation and got
> my script to do the  fdisk/disklabel/raidctl/newfs stages
> appropriately

Does your script use the "-s id/start/size" command line
argument for fdisk?
If yes - it seems that the fdisk command line treats this
as signed. The appended patch might help. (compile-tested only)

best regards
Matthias





-------------------------------------------------------------------
-------------------------------------------------------------------
Forschungszentrum Juelich GmbH
52425 Juelich

Sitz der Gesellschaft: Juelich
Eingetragen im Handelsregister des Amtsgerichts Dueren Nr. HR B 3498
Vorsitzende des Aufsichtsrats: MinDir'in Baerbel Brumme-Bothe
Geschaeftsfuehrung: Prof. Dr. Achim Bachem (Vorsitzender),
Dr. Ulrich Krafft (stellv. Vorsitzender), Prof. Dr. Harald Bolt,
Dr. Sebastian M. Schmidt
-------------------------------------------------------------------
-------------------------------------------------------------------
#
# old_revision [79fbef1a1bca5606767aae68eca9bb5e3f417b05]
#
# patch "sbin/fdisk/fdisk.c"
#  from [a649d8ca1fd2e7a31be34ad890cf565e94780a06]
#    to [7a9aa95ec989dc56d9de08104470c3a32b57df20]
#
============================================================
--- sbin/fdisk/fdisk.c  a649d8ca1fd2e7a31be34ad890cf565e94780a06
+++ sbin/fdisk/fdisk.c  7a9aa95ec989dc56d9de08104470c3a32b57df20
@@ -286,7 +286,8 @@ main(int argc, char *argv[])
        char *cbootmenu = 0;
 #endif
 
-       int csysid, cstart, csize;      /* For the b_flag. */
+       int csysid;                     /* For the s_flag. */
+       unsigned int cstart, csize;
 
        a_flag = i_flag = u_flag = sh_flag = f_flag = s_flag = b_flag = 0;
        v_flag = 0;
@@ -345,7 +346,7 @@ main(int argc, char *argv[])
                        break;
                case 's':       /* Partition details */
                        s_flag = 1;
-                       if (sscanf(optarg, "%d/%d/%d%n", &csysid, &cstart,
+                       if (sscanf(optarg, "%d/%u/%u%n", &csysid, &cstart,
                            &csize, &n) == 3) {
                                if (optarg[n] == 0)
                                        break;


Home | Main Index | Thread Index | Old Index