GhostBSD 10.1-Beta2 - Custom MBR partitioning

News and Announcements related to GhostBSD
ASX
Posts: 988
Joined: Wed May 06, 2015 12:46 pm

GhostBSD 10.1-Beta2 - Custom MBR partitioning

Post by ASX »

This is a report of a failure while installing on a custom MBR scheme:

screen shot from partition editor:
Image

After that, starting the installation ... after very little time it stopped with "Installation Error", let see the log:

Code: Select all

[ghostbsd@livecd ~]$ cat /tmp/.pc-sysinstall/pc-sysinstall.log 
kern.geom.debugflags: 0 -> 16
kern.geom.label.disk_ident.enable: 0 -> 0
Running gpart modify on /dev/ada0
Running: gpart modify -t freebsd -i 1 /dev/ada0
ada0s1 modified
Cleaning up /dev/ada0s1
Running: dd if=/dev/zero of=/dev/ada0s1 count=1024
1024+0 records in
1024+0 records out
524288 bytes transferred in 0.483902 secs (1083459 bytes/sec)
Stamping boot sector on /dev/ada0
Running: gpart bootcode -b /boot/boot0 /dev/ada0
bootcode written to ada0
Running: gpart create -s BSD /dev/ada0s1
ada0s1 created
Running: gpart add -s 20000M -t freebsd-ufs -i 1 /dev/ada0s1
ada0s1a added
Running: gpart add -s 1144M -t freebsd-swap -i 2 /dev/ada0s1
gpart: autofill: No space left on device
EXITERROR: Error 1: gpart add -s 1144M -t freebsd-swap -i 2 /dev/ada0s1
Unmounting: /mnt
Running: umount -f /mnt
Unmounting DVD/USB media: /cdmnt-install
Running: umount -f /cdmnt-install
[ghostbsd@livecd ~]$ 
let see also what happened really about partitions:

Code: Select all

[ghostbsd@livecd ~]$ gpart show -p
=>      63  43306113    ada0  MBR  (21G)
        63  43302861  ada0s1  freebsd  (21G)
  43302924      3252          - free -  (1.6M)

=>       0  43302861   ada0s1  BSD  (21G)
         0  40960000  ada0s1a  freebsd-ufs  (20G)
  40960000   2342861           - free -  (1.1G)

[ghostbsd@livecd ~]$ 
Lets try again, I restarted the installation entered manual partitioning, deleted all existing partitions, selected ada0 and MBR scheme again, then selected free space and now the offered size is 1MB less than the previous tentative. (puzzling and interesting).

This time I create a UFS parition of 19000 MB and the remaining 2143 are assigned to swap, the installation start, and succeed,

Code: Select all

root@livecd:/home/ghostbsd # cat /tmp/.pc-sysinstall/p
part-info-enc/     part-info/         pc-sysinstall.log  
root@livecd:/home/ghostbsd # cat /tmp/.pc-sysinstall/pc-sysinstall.log 
kern.geom.debugflags: 16 -> 16
kern.geom.label.disk_ident.enable: 0 -> 0
Running gpart modify on /dev/ada0
Running: gpart modify -t freebsd -i 1 /dev/ada0
ada0s1 modified
Cleaning up /dev/ada0s1
Running: dd if=/dev/zero of=/dev/ada0s1 count=1024
1024+0 records in
1024+0 records out
524288 bytes transferred in 0.429213 secs (1221510 bytes/sec)
Stamping boot sector on /dev/ada0
Running: gpart bootcode -b /boot/boot0 /dev/ada0
bootcode written to ada0
Running: gpart create -s BSD /dev/ada0s1
ada0s1 created
Running: gpart add -s 19000M -t freebsd-ufs -i 1 /dev/ada0s1
ada0s1a added
Running: gpart add -s 2143M -t freebsd-swap -i 2 /dev/ada0s1
ada0s1b added
Running: gpart bootcode -b /boot/boot /dev/ada0s1
bootcode written to ada0s1
NEWFS: /dev/ada0s1a - UFS+SUJ
Running: newfs -t  -U /dev/ada0s1a
/dev/ada0s1a: 19000.0MB (38912000 sectors) block size 32768, fragment size 4096
	using 31 cylinder groups of 626.22MB, 20039 blks, 80256 inodes.
	with soft updates
super-block backups (for fsck_ffs -b #) at:
 192, 1282688, 2565184, 3847680, 5130176, 6412672, 7695168, 8977664, 10260160,
 11542656, 12825152, 14107648, 15390144, 16672640, 17955136, 19237632,
 20520128, 21802624, 23085120, 24367616, 25650112, 26932608, 28215104,
 29497600, 30780096, 32062592, 33345088, 34627584, 35910080, 37192576, 38475072
Running: sync
Running: tunefs -j enable /dev/ada0s1a
tunefs: soft updates journaling set
Using inode 4 in cg 0 for 33554432 byte journal
Running: sync
Running: glabel label rootfs0 /dev/ada0s1a
Running: sync
Running: sync
Running: glabel label swap0 /dev/ada0s1b
Running: sync
mount -o rw /dev/ada0s1a -> /mnt/
Running: mount -o rw /dev/ada0s1a /mnt/
FOUND DVD: /dev/cd0
pc-sysinstall: Starting Extraction
pc-sysinstall: Extraction Finished
Running chroot command: /usr/bin/cap_mkdb /etc/login.conf
Running chroot command: mkdir /usr/home
Running chroot command: pw userdel -n ghostbsd
Running chroot command: rm -rf /home/ghostbsd
Running chroot command: cat /.tmpPass | pw useradd -n as -c "as" -h 0 -s "/usr/local/bin/bash" -m -d "/home/as" -g "wheel" -G "operator"
Running: rm /mnt/.tmpPass
Setting hostname: as.ghostbsd-pc.home
Setting root password
Running chroot command: cat /.rootpw | pw usermod root -h 0
Running: rm /mnt/.rootpw
Running chroot command: /usr/local/bin/iso_to_hd
Running: swapoff /dev/ada0s1b
swapoff: /dev/ada0s1b: Invalid argument
Unmounting: /mnt
Running: umount -f /mnt
Unmounting DVD/USB media: /cdmnt-install
Running: umount -f /cdmnt-install
Installation finished!
root@livecd:/home/ghostbsd # 

Code: Select all

root@livecd:/home/ghostbsd # gpartshow -p
gpartshow: Command not found.
root@livecd:/home/ghostbsd # gpart show -p
=>      63  43306113    ada0  MBR  (21G)
        63  43302861  ada0s1  freebsd  (21G)
  43302924      3252          - free -  (1.6M)

=>       0  43302861   ada0s1  BSD  (21G)
         0  38912000  ada0s1a  freebsd-ufs  (19G)
  38912000   4388864  ada0s1b  freebsd-swap  (2.1G)
  43300864      1997           - free -  (999K)

root@livecd:/home/ghostbsd # 
On the installation that succeeded the remaining free space is less than 1 MB, it says 999k, all the above sound very much like a "rounding issue" about partition sizes, in fact the remaining free space on /dev/ada0s1is equal to 1997 sectors, it would need 2048 sectors to make 1MB. (2048 sect x 512 bytes sector size).

Looking back at the failed installation, we can see that after failing the remaining free space on /dev/ada0s1 was 2342861 sectors:
(2342861 * 512 ) / (1024 *1024) = 1143.97 MByte, no way that 1144 MB can fit there.

The difference shown from the two tentative installations ... I can only guess that some sectors used for the partition scheme inside /dev/ada0s1 has not been properly accounted for.

Hope the above will be of some help.
User avatar
ericbsd
Developer
Posts: 2125
Joined: Mon Nov 19, 2012 7:54 pm

Re: GhostBSD 10.1-Beta2 - Custom MBR partitioning

Post by ericbsd »

I will have to look at the old code from PCBSD, I what think right know is that the the old partition query from the old pc-install is rounded to number I will have go get a look on that.

Did you test the ATI driver?
ASX
Posts: 988
Joined: Wed May 06, 2015 12:46 pm

Re: GhostBSD 10.1-Beta2 - Custom MBR partitioning

Post by ASX »

ericbsd wrote:I will have to look at the old code from PCBSD, ...<snip>
In my opinion you should look at how partition sizes are calculated when using "auto" function, which is working and is already in partition editor.
ASX
Posts: 988
Joined: Wed May 06, 2015 12:46 pm

Re: GhostBSD 10.1-Beta2 - Custom MBR partitioning

Post by ASX »

Another glitch related to custom partitioning: it say rootfs partition is missing, which clearly is not.

Image

How to replicate the bug:

1) Create an MBR partition scheme
2) create a freebsd partition
3) add a UFS partition and, by error, don't set the mountpoimt
4) add swap
5) edit the previously create UFS partition to set the correct mountpoint
6) click to "Forward"

While you are at it, would you consider to add a description on the form that ask the size for the freebsd partition, point 2 above ?
Something like "How much TOTAL space are you going to reserve for your GhostBSD installation ?"

Note: the same bug exists also whem using a GPT scheme setup.
ASX
Posts: 988
Joined: Wed May 06, 2015 12:46 pm

Re: GhostBSD 10.1-Beta2 - Custom MBR partitioning

Post by ASX »

partition_handler.py, lines 441-448

Code: Select all

        rootNum = number - swap
        llist = []
        mllist = []
        plf = open(partitiondb + disk + 's1', 'wb')
        llist.extend(([disk + 's1a', number, '/', 'freebsd-ufs']))      <<<<<<<========
        mllist.append(llist)
        llist = []
        llist.extend(([disk + 's1b', swap, 'none', 'freebsd-swap']))
The parameter 'number' for 's1a' look highly suspect to me ... as I would expect it as 'rootNum' ... please check about.
User avatar
ericbsd
Developer
Posts: 2125
Joined: Mon Nov 19, 2012 7:54 pm

Re: GhostBSD 10.1-Beta2 - Custom MBR partitioning

Post by ericbsd »

I think you pointed just were the bug is for that one.
ASX
Posts: 988
Joined: Wed May 06, 2015 12:46 pm

Re: GhostBSD 10.1-Beta2 - Custom MBR partitioning

Post by ASX »

unfortunately gpart output as shown from failed installations doesn't seem to confirm that this one is the error ...
ASX
Posts: 988
Joined: Wed May 06, 2015 12:46 pm

Re: GhostBSD 10.1-Beta2 - Custom MBR partitioning

Post by ASX »

Another tentative installation:

Image

The duplicate freespace rows have been obtained by repeatedly 'modify' (diminishing) one or more partitions size.

But, more interesting here is that clicking on forward to complete the installation, it failed pc-sysinstall report:

Code: Select all

root@livecd:/home/ghostbsd # more /tmp/.pc-sysinstall/pc-sysinstall.log 
kern.geom.debugflags: 16 -> 16
kern.geom.label.disk_ident.enable: 0 -> 0
Running gpart modify on /dev/ada0
Running: gpart modify -t freebsd -i 1 /dev/ada0
ada0s1 modified
Cleaning up /dev/ada0s1
Running: dd if=/dev/zero of=/dev/ada0s1 count=1024
1024+0 records in
1024+0 records out
524288 bytes transferred in 0.824007 secs (636267 bytes/sec)
Stamping boot sector on /dev/ada0
Running: gpart bootcode -b /boot/boot0 /dev/ada0
bootcode written to ada0
Running: gpart create -s BSD /dev/ada0s1
ada0s1 created
Running: gpart add -s 19998M -t freebsd-ufs -i 1 /dev/ada0s1
ada0s1a added
Running: gpart add -s 1144M -t freebsd-swap -i 2 /dev/ada0s1
ada0s1b added
Running: gpart add -s 19996M -t freebsd-ufs -i 4 /dev/ada0s1
gpart: autofill: No space left on device
EXITERROR: Error 1: gpart add -s 19996M -t freebsd-ufs -i 4 /dev/ada0s1
Notice that it is trying to add 3 partitions instead of the two requested.
Notice also the slightly different sizes (19998 MB and 19996 MB).
User avatar
ericbsd
Developer
Posts: 2125
Joined: Mon Nov 19, 2012 7:54 pm

Re: GhostBSD 10.1-Beta2 - Custom MBR partitioning

Post by ericbsd »

Modify is broken I think.
ASX
Posts: 988
Joined: Wed May 06, 2015 12:46 pm

Re: GhostBSD 10.1-Beta2 - Custom MBR partitioning

Post by ASX »

Then remove/disable the "Modify" button, at least temporarily, until it will be fixed ;)
Post Reply