3 # desc: edit partition tables (e.g., to create a plan 9 partition)
8 disks=`{ls /dev/sd*/data >[2]/dev/null | sed 's!/dev/(sd.*)/data!\1!'}
10 echo 'No disk devices were found on your system.'
11 echo 'The installation process cannot continue.'
15 echo 'The following disk devices were found.'
18 desc=`{cat /dev/$i/ctl | sed 1q | sed 's/inquiry //'}
20 @{disk/edisk -r /dev/$i/data
21 ||disk/fdisk -r /dev/$i/data} </dev/null >[2]/dev/null | grep -v '^ mbr'
32 prompt $default 'Disk to partition' $disks
36 if(disk/edisk -p /dev/$disk/data >/dev/null >[2=1])
39 if(~ $diskedit disk/fdisk && ! ./hasmbr /dev/$disk/data) {
40 echo 'The disk you selected HAS NO master boot record on its first sector.'
41 echo '(Perhaps it is a completely blank disk.)'
42 echo 'Shall we create a blank EFI partition table (GPT)'
43 echo 'or install traditional DOS partition table (MBR)?'
45 prompt 'Install mbr or gpt' mbr gpt
48 disk/mbr -m /386/mbr /dev/$disk/data
50 disk/edisk -bw /dev/$disk/data
56 echo 'This is '$diskedit'; use it to create a Plan 9 partition.'
57 echo 'If there is enough room, a Plan 9 partition will be'
58 echo 'suggested; you can probably just type ''w'' and then ''q''.'
60 $diskedit -a /dev/$disk/data
61 $diskedit -p /dev/$disk/data >/dev/$disk/ctl >[2]/dev/null
62 for(i in /dev/sd*/plan9*){
65 disk/prep -p $i >$d/ctl >[2]/dev/null
70 # we want at least one disk with both an mbr and a plan9 partition
72 disks=`{ls /dev/sd*/plan9 >[2]/dev/null | sed 's!/dev/(sd.*)/plan9!\1!'}
74 if(./hasmbr /dev/$disk/data)