How to make ComboFormat partition larger than a gig?
Here's something weird:
If I make the first partition 1350 mb:
...it works great. But if I make it another 512mb bigger, it suffers from the same problem as before - the second partition is created with the remaining space, but is unmountable.
If I make the first partition 1350 mb:
Code: Select all
#create 256M empty file...
dd if=/dev/zero of=${WKGPATH}/image256m bs=1024 count=1382400
Code: Select all
sh-4.1# mount /dev/sdf2 /mnt/sdf2
mount: you must specify the filesystem type
The Way of the Samurai
Does partition 1 seem OK? Does it boot?
What's the output from:
What's the output from:
Code: Select all
fdisk -l /dev/sdf
blkid /dev/sdf1
blkid /dev/sdf2
It boots, and the first partition seems to work normally.
Code: Select all
sh-4.1# fdisk -l /dev/sdf
Disk /dev/sdf: 4089 MB, 4089446400 bytes
126 heads, 62 sectors/track, 1022 cylinders, total 7987200 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000
Device Boot Start End Blocks Id System
/dev/sdf1 * 32 3786239 1893104 b W95 FAT32
/dev/sdf2 3786240 7987199 2100480 b W95 FAT32
sh-4.1# blkid /dev/sdf1
/dev/sdf1: UUID="5233-BBCE" TYPE="vfat"
sh-4.1# blkid /dev/sdf2
/dev/sdf1: UUID="5233-BBCE" TYPE="vfat"
/dev/sdf: UUID="5233-BBCE" TYPE="vfat"
[and a few entries for my partitions on sda... nothing about sdf2]
The Way of the Samurai
I was going to say that the second partition must be quite corrupt for blkid to be finding information about the first partition on it, and severely corrupt if it is finding information about your hard drive on it. But I used losetup to associate a file full of zeros with a loop device and tried blkid with it. Sure enough, it reports information on all block devices. So apparently that is a quirk of blkid: when given an unformatted device, it throws up its hands and gives information about every other block device it can find.Ghost Dog wrote:Code: Select all
sh-4.1# blkid /dev/sdf2 /dev/sdf1: UUID="5233-BBCE" TYPE="vfat" /dev/sdf: UUID="5233-BBCE" TYPE="vfat" [and a few entries for my partitions on sda... nothing about sdf2]
So it appears that for some reason the second partition just isn't getting formatted, or is being incorrectly formatted, which is no surprise. The question is why.
I notice that /dev/sdf1 has only 1893104 blocks, which is only 1848.734 MiB, which is significantly smaller than the 1350 + 512 = 1862 that you were aiming for. (I think makebootfat may use 32 blocks for the stuff before the first partition, but that only accounts for 0.031 MiB.) So I am guessing that bootflash didn't find enough temporary space to make partition 1 the size that you asked for. (It actually creates the image in a temporary file on an already mounted filesystem (in /tmp/, /root/, or /mnt/home/) before moving it to your flash drive.)
As you know, normally bootflash creates a 256 MiB empty file. It searches for space containing 300 MiB (to allow a little room to breathe). You will see three lines in the script like this:
Code: Select all
if [ $FREEM -lt 300 ];then
If you are not running a full install, my guess is that you have a PC with 2 GiB, and the layered filesytem in RAM had enough room to create a 1350 MiB file, but not an 1862 MiB file. But bootflash was only looking for 300 MiB of space, which it found in /tmp/ so it tried to create the file in /tmp/.
If that is what happened, then changing those three lines will allow bootflash to keep looking until it finds sufficient space at /mnt/home/, assuming that /mnt/home is a symlink to a mounted partition with sufficient space.
BUT . . .
But this may not be your only problem. While it is easy to see why the above situation could result in partition 1 being smaller than expected, I see no clear reason why it would prevent partition 2 from being formatted correctly. Perhaps mkdosfs needed some space to work and couldn't find any. Anyway, when RAM gets filled up, all bets are off as to what happens.
So changing those three lines may or may not fix partition 2, but let's eliminate that problem first, then we can revisit the lack of proper format for partition 2, if that problem still exists.
Still the same, by the looks of it:
I'm running a full install, so it shouldn't be a RAM problem.
Like I said, weird.
Code: Select all
sh-4.1# fdisk -l /dev/sdf
Disk /dev/sdf: 4089 MB, 4089446400 bytes
126 heads, 62 sectors/track, 1022 cylinders, total 7987200 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000
Device Boot Start End Blocks Id System
/dev/sdf1 * 32 3884159 1942064 b W95 FAT32
/dev/sdf2 3884160 7987199 2051520 b W95 FAT32
sh-4.1# blkid /dev/sdf1
/dev/sdf1: UUID="5235-232F" TYPE="vfat"
sh-4.1# blkid /dev/sdf2
/dev/sdf1: UUID="5235-232F" TYPE="vfat"
/dev/sda3: UUID="c70dd211-2aa3-4aa5-b6bd-6204f6b662a1" TYPE="swap"
/dev/sda1: UUID="702f5e62-7e1e-4eee-952d-85c04929f1a9" TYPE="ext3"
/dev/sda2: UUID="bcd58708-8b3d-4552-b2d8-15da03b76e3b" TYPE="ext3"
/dev/sdf: UUID="5235-232F" TYPE="vfat"
Like I said, weird.
The Way of the Samurai
Well, it looks like the change allowed partition 1 to be bigger.
Before:
After:
But that didn't solve the partition 2 problem.
Try formating partition 2 manually with the following command. (If the flash drive you're testing isn't still at /dev/sdf, you will of course want to modify the command to prevent any nasty surprises.):
Does that give any error messages?
If not, is it now mountable? Does blkid recognise it?
Before:
Code: Select all
Device Boot Start End Blocks Id System
/dev/sdf1 * 32 3786239 1893104 b W95 FAT32
Code: Select all
Device Boot Start End Blocks Id System
/dev/sdf1 * 32 3884159 1942064 b W95 FAT32
OK, that's good to know.Ghost Dog wrote:I'm running a full install, so it shouldn't be a RAM problem.
Try formating partition 2 manually with the following command. (If the flash drive you're testing isn't still at /dev/sdf, you will of course want to modify the command to prevent any nasty surprises.):
Code: Select all
mkdosfs -F 32 -n storage /dev/sdf2
If not, is it now mountable? Does blkid recognise it?
Yep, that fixes it!
Code: Select all
sh-4.1# blkid /dev/sdf2
/dev/sdf2: LABEL="storage" UUID="1FCB-C3D9" TYPE="vfat"
The Way of the Samurai