1

I used http://www.pendrivelinux.com to build an installation of Linux Mint on a USB stick, so I could have a portable OS (mainly for work emergencies). It's installed, and works fine, but it's only used 5.8GB of space whereas the USB stick itself is 14.7GB. (when I say GB here, I mean 10^9 bytes).

When i'm inside the OS in question, and run df -h, i see this:

Filesystem      Size  Used Avail Use% Mounted on
/cow            3.9G  3.7G   31M 100% /
udev            3.9G  4.0K  3.9G   1% /dev
tmpfs           784M  1.5M  783M   1% /run
/dev/sdb1        15G  5.5G  9.2G  38% /cdrom
/dev/loop0      1.5G  1.5G     0 100% /rofs
none            4.0K     0  4.0K   0% /sys/fs/cgroup
tmpfs           3.9G  4.0K  3.9G   1% /tmp
none            5.0M     0  5.0M   0% /run/lock
none            3.9G   76K  3.9G   1% /run/shm
none            100M   28K  100M   1% /run/user

I get warning messages like "This machine only has 20MB remaining", suggesting that it's the /cow partition (or whatever it is) at the top which is being used.

And when i run df -h on a different machine, with the usb stick plugged in, i see this for the usb stick:

/dev/sdc1                                15G  5.5G  9.2G  38% /media/UUI

Same as in the /dev/sdb1 partition listed in the results of df in the problem OS (the 5.5 vs 5.8 difference is because df reports sizes in blocks of 1024 bytes).

If i run fdisk -l from within the problem OS, i get this:

Disk /dev/sda: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders, total 976773168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0x3d7d91ef

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1            2048     3074047     1536000    7  HPFS/NTFS/exFAT
/dev/sda2   *     3074048   313377829   155151891    7  HPFS/NTFS/exFAT
/dev/sda3       313378814   948099071   317360129    5  Extended
Partition 3 does not start on physical sector boundary.
/dev/sda4       948099072   976771071    14336000    7  HPFS/NTFS/exFAT
/dev/sda5       931889152   948099071     8104960   82  Linux swap / Solaris
/dev/sda6       519759872   931889151   206064640   83  Linux
/dev/sda7       313378816   519757823   103189504   83  Linux

Partition table entries are not in disk order

Disk /dev/sdb: 15.7 GB, 15724707840 bytes
74 heads, 10 sectors/track, 41503 cylinders, total 30712320 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: 0xc3072e18

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1   *        8064    30712319    15352128    c  W95 FAT32 (LBA)

(the 500GB listed at the top is the size of the hard disk in the host machine that the usb stick is plugged into)

And when I run fdisk -l on a different machine, with the usb stick plugged in, I see the following for the USB stick:

Disk /dev/sdc: 15.7 GB, 15724707840 bytes
74 heads, 10 sectors/track, 41503 cylinders, total 30712320 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: 0xc3072e18

   Device Boot      Start         End      Blocks   Id  System
/dev/sdc1   *        8064    30712319    15352128    c  W95 FAT32 (LBA)

So, it looks like it's FAT32. Is this the reason for the size limit? Is there any way I can expand this "partition" or whatever it is to use up the entire USB stick? My install is unusable as is because I need to install about 5GB of files on there, and leave a couple of GB for swap etc, in order for it to be any use for my work.

EDIT: in my original question it wasn't obvious that i was running the commands in my question on a DIFFERENT OS, with the usb stick plugged into it as an external drive, rather than running them INSIDE the problem OS install. I've added the results of running the commands inside the install as well, and more clearly denoted which is which. Sorry for any confusion caused.

EDIT2 - i've reformatted the drive to ext4 but looking at it in the Disk Utility it says that the format is ext4 but the partition type is W95 FAT32. (see attached png)png of output from the Disk Utility app for my freshly-formatted usb Is this ok? It'd be a pita to install all the stuff again and then find out i still didn't format the usb drive correctly.

  • 2
    The partition already uses the entire USB and as your df output tells, 9.2 GB are free (only 38% of the 15G are in use). The file size limit for FAT32 however is 2GB, leading to your problems. If the system is not meant to be mountable by a Windows system but rather to only run in live mode, reinstall the linux and make sure to format the drive to ext3 (better ext4). – Fiximan Jul 28 '15 at 9:00
  • @Fiximan please post that as an answer instead of a comment. – terdon Jul 28 '15 at 9:23
  • 1
    Max, could you explain what the actual issue is? Have you attempted and failed to install files? As Fiximan explained, your entire disk is available, that's what your df shows. Is there actually a problem here? – terdon Jul 28 '15 at 9:23
  • @terdon - while attempting to copy down about 2G of files, i got a "insufficient disk space" error. So the OS thinks that it's ran out of space. – Max Williams Jul 28 '15 at 9:27
  • Odd. In that case, please edit the command you ran and the error message into your question. As it stands, your question shows everything working as it should. – terdon Jul 28 '15 at 9:29
1

As your df output suggests, your drive is actually 15 GB in size, out of which 5.5 GB (38%) are used and 9.2 GB are free space. So the installation is fine. You can also see in your fdisk -l output that the end sector matches the final sector (off by one - nothing strange) and the start is at the beginning (minus the head sectors).

However the problem really is with the system being a FAT 32 partition which has a maximum of 2GB for file sizes.

You cannot alter the file system type without wiping the drive, so best reinstall the linux and make sure that the file system is set to ext3 (better ext4). Note that in this case Windows systems will not be able to mount the drive, but it seems that you want to run your linux as live version only.

  • Thanks Fiximan. I'm a bit confused by your last sentence, sorry. What i want to be able to do is to put the usb stick in a windows machine, start the machine, then boot the install of linux that's on the pen drive. I don't need to actually launch windows and then do something with the usb stick in windows per se. If i reformat it to ext3 (or ext4) will i still be able to boot it from usb on a windows machine? – Max Williams Jul 28 '15 at 11:12
  • That is exactly what I was addressing: Plug it in to start the linux - no problem with ext3/4. Start windows and try to use the USB as a flash drive - not possible with ext3/4 as Windows will not be able to recognize it. So for your intentions ext3/4 has no restrictions and is actually favourable as file system for a linux OS. – Fiximan Jul 28 '15 at 11:17
  • would you mind looking at the screengrab for my freshly-formatted usb drive (see EDIT2 in question) and seeing if that looks ok to go ahead with? thanks a lot – Max Williams Jul 28 '15 at 12:23
  • partition type is still FAT 32. Did you use cfdisk to set the type to "linux"? and make it bootable! – Fiximan Jul 28 '15 at 12:29
  • no, i did sudo mkfs.ext4 /dev/sdb1 – Max Williams Jul 28 '15 at 13:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.