Powerphil
Posts: 72
Joined: Sat Aug 04, 2012 9:36 pm

deleting files, but storage space not changing

Sat Jun 15, 2013 6:31 pm

Hi all,
I have been moving files into the trash can on the raspberry pi, and when i empty the trash, the storage space on the SD card doesn't change. I have emptied the trash as both a root user and pi user. I've also tried sudo apt-get clean, but nothing changes. At the moment, i'm trying to "release" approx 3gig, so a significant amount.

Can anyone advise what I've done wrong?

sprinkmeier
Posts: 410
Joined: Mon Feb 04, 2013 10:48 am
Contact: Website

Re: deleting files, but storage space not changing

Sat Jun 15, 2013 10:21 pm

You can use the following commands to see where the space is being used:

Code: Select all

$ alias DU='du --block-size=1M --max-depth=2 --one-file-system'
$ alias s0rt='sort --numeric'
$ cd /some/directory/where/you/thing/the/junk/is
$ DU | s0rt | tail
good candidates are /tmp and /home/pi

If you prefer a GUI try baobab (I haven't used it on the Pi but it's in the repo so it should work)

It's possible the filesystem is in a bit of pain, especially if the Pi has been shut down abruptly.
You can force a file-system check with

Code: Select all

$ sudo touch /forcefsck
$ sudo reboot
(usual disclaimer/warning about commands with sudo in them ...)

Powerphil
Posts: 72
Joined: Sat Aug 04, 2012 9:36 pm

Re: deleting files, but storage space not changing

Mon Jun 17, 2013 6:29 pm

Hi,
I've used teh GUI, but I still can't see where the space is being taken up. All the files have been deleted, the trash can empties, but the space not released.
Any other ideas??

sprinkmeier
Posts: 410
Joined: Mon Feb 04, 2013 10:48 am
Contact: Website

Re: deleting files, but storage space not changing

Mon Jun 17, 2013 7:43 pm

Did you try the forcefsck thing?
Post the output of sudo du --block-size=1M --max-depth=2 --one-file-system / | sort -n | tail and sudo fdisk -l

Powerphil
Posts: 72
Joined: Sat Aug 04, 2012 9:36 pm

Re: deleting files, but storage space not changing

Mon Jun 17, 2013 8:30 pm

Hi,
Output is:
50 /lib
68 /var/lib
98 /usr/bin
213 /var
454 /usr/lib
670 /usr/share
1248 /usr
3131 /root/.local
3132 /root
4696 /

Powerphil
Posts: 72
Joined: Sat Aug 04, 2012 9:36 pm

Re: deleting files, but storage space not changing

Mon Jun 17, 2013 8:31 pm

Output from fdisk:


Warning: ignoring extra data in partition table 5

Disk /dev/mmcblk0: 7888 MB, 7888437248 bytes
4 heads, 16 sectors/track, 240736 cylinders, total 15407104 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: 0x000bc8f9

Device Boot Start End Blocks Id System
/dev/mmcblk0p1 2048 2332031 1164992 e W95 FAT16 (LBA)
/dev/mmcblk0p2 2334720 15407103 6536192 85 Linux extended
/dev/mmcblk0p5 2342912 2457599 57344 c W95 FAT32 (LBA)

Disk /dev/sda: 32.0 GB, 32015679488 bytes
255 heads, 63 sectors/track, 3892 cylinders, total 62530624 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/sda1 2 62530623 31265311 b W95 FAT32

sprinkmeier
Posts: 410
Joined: Mon Feb 04, 2013 10:48 am
Contact: Website

Re: deleting files, but storage space not changing

Mon Jun 17, 2013 8:41 pm

Code: Select all

3131 /root/.local
3G in that directory...

Code: Select all

Disk /dev/mmcblk0: 7888 MB, 7888437248 bytes
... that's close to half your SD card.

Powerphil
Posts: 72
Joined: Sat Aug 04, 2012 9:36 pm

Re: deleting files, but storage space not changing

Mon Jun 17, 2013 8:43 pm

The SD card is a 8Gb card

Powerphil
Posts: 72
Joined: Sat Aug 04, 2012 9:36 pm

Re: deleting files, but storage space not changing

Mon Jun 17, 2013 8:49 pm

sorry, read your last post wrong. Can I delete that directory or not?

sprinkmeier
Posts: 410
Joined: Mon Feb 04, 2013 10:48 am
Contact: Website

Re: deleting files, but storage space not changing

Mon Jun 17, 2013 8:56 pm

I'd check to see what was in it first :-)

Return to “Beginners”