Linux Problem

I’m trying to format a micro-SD to install Fedora on my Raspberry Pi 2. I’m following the instructions here.

But when I get to the part about building the swap partition, I’m getting an error message. This is the output of fdisk:

Command (m for help): p
Disk /dev/sdd: 29.7 GiB, 31914983424 bytes, 62333952 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
Disklabel type: dos
Disk identifier: 0x0002ce31

Device Boot Start End Sectors Size Id Type
/dev/sdd1 2048 264191 262144 128M b W95 FAT32
/dev/sdd2 264192 1312767 1048576 512M 82 Linux swap / Solaris
/dev/sdd3 1312768 62333951 61021184 29.1G 83 Linux

Now here’s what happens when I run mkswap:

[root@new-host-5 raspberry]# mkswap /dev/sdd2
mkswap: error: swap area needs to be at least 40 KiB

I’ve tried searching for a similar issue, but am coming up empty. Anyone have any ideas?

[Update a while later]

OK, I’ve decided that it’s a bad SD. But now I’ve got a new problem; I can’t mount the W95 FAT32 boot partition:

Disk /dev/sdd: 14.5 GiB, 15560867840 bytes, 30392320 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
Disklabel type: dos
Disk identifier: 0x00000000

Device Boot Start End Sectors Size Id Type
/dev/sdd1 2048 264191 262144 128M b W95 FAT32
/dev/sdd2 264192 772095 507904 248M 82 Linux swap / Solaris
/dev/sdd3 772096 30392319 29620224 14.1G 83 Linux

Command (m for help): q

[root@new-host-5 raspberry]# mount -t fat32 /dev/sdd1 /tmp/rpi/boot/
mount: unknown filesystem type ‘fat32’
[root@new-host-5 raspberry]# mount -t auto /dev/sdd1 /tmp/rpi/boot/
mount: /dev/sdd1 is write-protected, mounting read-only
mount: wrong fs type, bad option, bad superblock on /dev/sdd1,
missing codepage or helper program, or other error

In some cases useful info is found in syslog – try
dmesg | tail or so.

It doesn’t work with “auto” or “vfat” either.

[Tuesday-morning update]

OK, not sure what the problem was, but after rebooting the machine, I managed to get it all to work. I haven’t actually tried booting the Pi, yet, though.

9 thoughts on “Linux Problem”

  1. Try mount -t msdos
    vfat and msdos filesystem drivers are subtle variations, and your kernel may have one but not the other enabled.

    1. [root@new-host-5 raspberry]# mount -t msdos /dev/sdd1 /tmp/rpi/boot/
      mount: wrong fs type, bad option, bad superblock on /dev/sdd1,
      missing codepage or helper program, or other error

      In some cases useful info is found in syslog – try
      dmesg | tail or so.

      1. You’ll have to make sure it is formatted before you can mount it. Just re-partitioning, either size or type won’t be sufficient.

      2. If you didn’t run mkfs or equivalent the partition didn’t get formatted. Which fits the error message you got from `mount -t msdos /dev/sdd1 /tmp/rpi/boot/’. fdisk allocates space for partitions, but does not format.

  2. Formatting is done with a mkfs or a variant (mkfs.vfat) depending upon your Linux.

  3. At this point I think I’d run a non-destructive “badblocks” command over the entire device to find bad chunks.

    badblocks -vsn /dev/sdd

  4. I just ordered a Raspberry Pi 2 from Adafruit.com (My getting out of hospice captivity gift to me.)

    They said something about needing an OS upgrade off the internet?

    Also getting this cute little keyboard.

Comments are closed.