Tiny Core Linux

Tiny Core Base => TCB Q&A Forum => Topic started by: mb0 on August 01, 2012, 10:12:03 AM

Title: 30GB partition only allowing <1GB ?
Post by: mb0 on August 01, 2012, 10:12:03 AM
i created the partition /dev/sda2 to be 30GB, (fdisk shows 31254426 blocks), but `df /dev/sda2` shows it's size as 950MB, and i have just been told it's full when copying files to it. What's up with this??
Title: Re: 30GB partition only allowing <1GB ?
Post by: Lee on August 01, 2012, 10:21:21 AM
df shows the free space on a mounted fs, so try

df /mnt/sda2

If sda2 is mounted this should show its free space,otherwise it will show the free space of the root fs (which is likely in RAM, so not large)
Title: Re: 30GB partition only allowing <1GB ?
Post by: bmarkus on August 01, 2012, 10:24:54 AM
Also don't forget to mount partion. Use

df -h ...

to get result in "human readable" units.
Title: Re: 30GB partition only allowing <1GB ?
Post by: mb0 on August 01, 2012, 10:27:14 AM
It is mounted and `df /mountpoint` returns exactly the same

(and FWIW it is already bigger than the RAM in the system)
Title: Re: 30GB partition only allowing <1GB ?
Post by: tinypoodle on August 01, 2012, 10:29:29 AM
In case you mistakenly exhausted the space of your rootfs, better delete those files as soon as possible to prevent any consequences.
Title: Re: 30GB partition only allowing <1GB ?
Post by: tinypoodle on August 01, 2012, 10:31:28 AM
Best to run a fsck, after umounting first.
Title: Re: 30GB partition only allowing <1GB ?
Post by: mb0 on August 01, 2012, 10:36:57 AM
fsck /dev/sda2:
Code: [Select]
fsck (busybox 1.19.3, 2011-10-30 01:47:29 UTC)
e2fsck 1.41.14 (22-Dec-2010)
/dev/sda2 has been mounted 922 times without being checked, check forced.
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
/lost+found not found.  Create<y>? yes

Pass 4: Checking reference counts
Pass 5: Checking group summary information

/dev/sda2: ***** FILE SYSTEM WAS MODIFIED *****
/dev/sda2: 162/62848 files (42.0% non-contiguous), 249033/251007 blocks
Title: Re: 30GB partition only allowing <1GB ?
Post by: tinypoodle on August 01, 2012, 10:48:03 AM
That filesystem looks suspicious in several aspects...

mounted 922 times without being checked - is that about consistent with its history?

42.0% non-contiguous - unusually high!

/lost+found not found. - shouldn't occur without serious fs corruption (unless it was rm'ed manually)

Which fs type is that exactly? journalled or not?


Title: Re: 30GB partition only allowing <1GB ?
Post by: mb0 on August 01, 2012, 10:53:20 AM
it's ext4.. 922 times does seem higher than i would have expected (probably expected closer to 90?) and it's never been fsck'd..
Title: Re: 30GB partition only allowing <1GB ?
Post by: tinypoodle on August 01, 2012, 11:04:02 AM
Can you run another fsck but with the "-v" option and post output again?
Title: Re: 30GB partition only allowing <1GB ?
Post by: mb0 on August 01, 2012, 11:09:58 AM
sudo fsck -v /dev/sda2:
Code: [Select]
fsck (busybox 1.19.3, 2011-10-30 01:47:29 UTC)
e2fsck 1.41.14 (22-Dec-2010)
/dev/sda2: clean, 162/62848 files, 249033/251007 blocks

intersting huh?
Title: Re: 30GB partition only allowing <1GB ?
Post by: tinypoodle on August 01, 2012, 11:13:22 AM
Oh, sorry, make that "-vf". ;)
Title: Re: 30GB partition only allowing <1GB ?
Post by: mb0 on August 01, 2012, 11:18:06 AM
Code: [Select]
fsck (busybox 1.19.3, 2011-10-30 01:47:29 UTC)
e2fsck 1.41.14 (22-Dec-2010)
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information

     162 inodes used (0.26%)
      68 non-contiguous files (42.0%)
       0 non-contiguous directories (0.0%)
         # of inodes with ind/dind/tind blocks: 0/0/0
         Extent depth histogram: 150/2
  249033 blocks used (99.21%)
       0 bad blocks
       1 large file

     139 regular files
      14 directories
       0 character device files
       0 block device files
       0 fifos
       0 links
       0 symbolic links (0 fast symbolic links)
       0 sockets
--------
     153 files
Title: Re: 30GB partition only allowing <1GB ?
Post by: tinypoodle on August 01, 2012, 11:29:26 AM
"249033 blocks used (99.21%)" appears to agree with output of df.
Title: Re: 30GB partition only allowing <1GB ?
Post by: mb0 on August 01, 2012, 11:45:58 AM
yes, but..

fdisk /dev/sda, 'p'

Code: [Select]
Disk /dev/sda: 40.0 GB, 40007761920 bytes
255 heads, 63 sectors/track, 4864 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks  Id System
/dev/sda1   *        3892        4864     7815622+ 83 Linux
/dev/sda2               1        3891    31254426  83 Linux

Partition table entries are not in disk order
Which is in line with what i expected.
Title: Re: 30GB partition only allowing <1GB ?
Post by: tinypoodle on August 01, 2012, 12:10:58 PM
It is possible to create a fs much smaller than the underlaying partition - rest of disk partition space will be unusable.
Title: Re: 30GB partition only allowing <1GB ?
Post by: gerald_clark on August 01, 2012, 12:19:39 PM
2 pages, and the output of df -h has yet to be posted.
Title: Re: 30GB partition only allowing <1GB ?
Post by: mb0 on August 01, 2012, 12:27:08 PM
nor requested. I guess you want that with sda2 mounted? ..and, the whole lot??

e:

Code: [Select]
Filesystem                Size      Used Available Use% Mounted on
rootfs                  222.8M     93.4M    129.4M  42% /
tmpfs                   123.8M         0    123.8M   0% /dev/shm
/dev/sda1                 7.3G    284.2M      7.1G   4% /mnt/sda1
/dev/loop0               12.4M     12.4M         0 100% /tmp/tcloop/perl5
... many /dev/loop all normal
/dev/loop120              1.1M      1.1M         0 100% /tmp/tcloop/alsa
/dev/sda2               965.1M    957.3M      7.7M  99% /mnt/sda2
Title: Re: 30GB partition only allowing <1GB ?
Post by: gerald_clark on August 01, 2012, 12:39:00 PM
Not requested?
You complain about the output of df but don't think to post it?
Title: Re: 30GB partition only allowing <1GB ?
Post by: tinypoodle on August 01, 2012, 12:45:28 PM
If I were you, I'd copy files from sda2 to sda1 and then just format sda2 from scratch - preferably after first fixing the partition table.
Title: Re: 30GB partition only allowing <1GB ?
Post by: mb0 on August 01, 2012, 12:57:36 PM
> preferably after first fixing the partition table

what /how?

for reference, not a problem to wipe sda2 (unlike sda1)
Title: Re: 30GB partition only allowing <1GB ?
Post by: tinypoodle on August 01, 2012, 01:05:46 PM
"testdisk" is a good tool to fix partition tables.
Title: Re: 30GB partition only allowing <1GB ?
Post by: gerald_clark on August 01, 2012, 01:53:15 PM
If sda2 is an ext filesystem, why not run resize2fs?
Title: Re: 30GB partition only allowing <1GB ?
Post by: tinypoodle on August 01, 2012, 02:04:09 PM
If sda2 is an ext filesystem, why not run resize2fs?

I had been considering suggesting that, but given all the [missing] evidence would consider it more reliable to format from scratch.
Title: Re: 30GB partition only allowing <1GB ?
Post by: curaga on August 01, 2012, 02:25:40 PM
resize2fs can't change inode count IIRC, which may be a problem.
Title: Re: 30GB partition only allowing <1GB ?
Post by: mb0 on August 01, 2012, 05:38:27 PM
so i went through the testdisk procedure, required a restart so i did and now..
Code: [Select]
Syslinux 4.01
Error: no configuration file found
no default or UI configuration directive found!
boot:
Title: Re: 30GB partition only allowing <1GB ?
Post by: mb0 on August 01, 2012, 08:28:32 PM
soo.. is there anything i can enter at the boot prompt?

The deafening silence makes me think i'm probably screwed?
Title: Re: 30GB partition only allowing <1GB ?
Post by: Rich on August 01, 2012, 08:38:39 PM
Hi mb0
The error message makes it sound like just the config file for the bootloader is missing, though I suspect it may
be worse than that. My recommendation is that you boot the machine using a CD or a USB thumb drive. Then
mount sda1 and sda2, and check what is left of the directory structure.
Title: Re: 30GB partition only allowing <1GB ?
Post by: curaga on August 02, 2012, 05:43:37 AM
Yes, you likely just need to reinstall the bootloader from a live cd.
Title: Re: 30GB partition only allowing <1GB ?
Post by: mb0 on August 02, 2012, 11:02:32 AM
Well, that was weird..
my former /dev/sda2 became /dev/sda1  ..not so crazy..

/dev/sda2 however, was a partition that i had deleted *before* i repartitioned (ie before i ever started this post). And former-/dev/sda1 (you know, the one with all the useful stuff on) was nowhere.

So i started again. FFS...

so, that over with, what can i do before i invest all the time to redo everything, again, to make sure everything is in good shape??
Title: Re: 30GB partition only allowing <1GB ?
Post by: Rich on August 02, 2012, 11:52:46 AM
Hi nb0
Anytime I need to mess with partitions I use  gparted. It handles partiton sizing, formatting and I believe it
also lets you set the label.