LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices


Reply
  Search this Thread
Old 04-26-2014, 02:46 AM   #1
ravisingh1
Member
 
Registered: Apr 2013
Location: Mumbai
Distribution: Ubuntu13.10
Posts: 291

Rep: Reputation: Disabled
Available space & used space of partition not tallying?


I recently purchased WD My passport ultra 1TB from amazon.in. The complete space was formatted with NTFS fs (/dev/sdb1) by the manufacturer where they had stored a few files & directories. I want to use the drive for my Ubuntu. I partitioned the drive & shrank the NTFS partition & created 2nd partition with ext4 fs (/dev/sdb2). I will be using my 2nd partition for work. Now it's a bit unclear why the free space & used spaces for the partitions are as below:
Code:
ravbholua@ravbholua-Aspire-5315:~$ df -Th
Filesystem     Type      Size  Used Avail Use% Mounted on
/dev/sda6      ext4      9.9G  8.4G  976M  90% /
none           tmpfs     4.0K     0  4.0K   0% /sys/fs/cgroup
udev           devtmpfs  489M  4.0K  489M   1% /dev
tmpfs          tmpfs     100M  940K   99M   1% /run
none           tmpfs     5.0M     0  5.0M   0% /run/lock
none           tmpfs     497M  236K  497M   1% /run/shm
none           tmpfs     100M   24K  100M   1% /run/user
/dev/sda5      ext4      284M  157M  113M  59% /boot
/dev/sda8      ext4      5.4G  4.6G  547M  90% /home
/dev/sdb2      ext4      407G   71M  387G   1% /media/ravbholua/Back-up
/dev/sdb1      fuseblk   518G  357M  518G   1% /media/ravbholua/My Passport
Just see the sdb2 & sdb1 partitions.
1) sdb2: size = 407G, used = 71M , available is not equal to 407G - 71M but much less than this. Why so?
2) sdb1: here it is ntfs fs. Here the available space seems to correspond to the size & used space.

I'm working on Ubuntu 13.04
 
Old 04-26-2014, 04:51 AM   #2
Doc CPU
Senior Member
 
Registered: Jun 2011
Location: Stuttgart, Germany
Distribution: Mint, Debian, Gentoo, Win 2k/XP
Posts: 1,099

Rep: Reputation: 344Reputation: 344Reputation: 344Reputation: 344
Hi there,

Quote:
Originally Posted by ravisingh1 View Post
I recently purchased WD My passport ultra 1TB from amazon.in. The complete space was formatted with NTFS fs (/dev/sdb1) by the manufacturer where they had stored a few files & directories. I want to use the drive for my Ubuntu. I partitioned the drive & shrank the NTFS partition & created 2nd partition with ext4 fs (/dev/sdb2). I will be using my 2nd partition for work.
then I wonder why you didn't remove the NTFS partition for good. What do you need it for?

Quote:
Originally Posted by ravisingh1 View Post
Now it's a bit unclear why the free space & used spaces for the partitions are as below:
Code:
ravbholua@ravbholua-Aspire-5315:~$ df -Th
Filesystem     Type      Size  Used Avail Use% Mounted on
  [irrelevant entries removed]
/dev/sdb2      ext4      407G   71M  387G   1% /media/ravbholua/Back-up
/dev/sdb1      fuseblk   518G  357M  518G   1% /media/ravbholua/My Passport
Just see the sdb2 & sdb1 partitions.
1) sdb2: size = 407G, used = 71M , available is not equal to 407G - 71M but much less than this. Why so?
2) sdb1: here it is ntfs fs. Here the available space seems to correspond to the size & used space.
Yes, you see clearly that 71M, far less than a percent of the partition, shouldn't decrease the available space noticeably. It looks like there's 20G lost on that partition, about 5% of the total size. Incidentally, 5% is exactly the default percentage that ext file systems set aside as "reserved space" which is only accessible by kernel processes. This is to avoid stalling the system because of the root file system becoming filled up to the brim.

On a partition that is not mounted as the root file system, this reserved space is unnecessary and undesired.
For those partitions, you can set the reserved percentage to 0:

Code:
# umount /dev/sdb2
# tune2fs -m 0 /dev/sdb2
# mount /dev/sdb2
After that you will see the the magic is gone, a subsequent df should display 407G available on that partition.

Quote:
Originally Posted by ravisingh1 View Post
I'm working on Ubuntu 13.04
... which has run out of support recently. What about upgrading?

[X] Doc CPU

Last edited by Doc CPU; 04-26-2014 at 04:52 AM.
 
1 members found this post helpful.
Old 04-26-2014, 08:21 AM   #3
ravisingh1
Member
 
Registered: Apr 2013
Location: Mumbai
Distribution: Ubuntu13.10
Posts: 291

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by Doc CPU View Post
then I wonder why you didn't remove the NTFS partition for good. What do you need it for?
I don't need the NTFS partition at all. I didn't remove it simply because it had those back-up softwares & user-maual pdf guide & a few other files which were provided by the manufacturer WD.
The back-up softwares aren't compatible with Linux though. Simply I want to keep this so that sometimes later I will login to Windows to see how this back-up software works. Though I won't be using it for my work as I'm completely on Linux. I think for keeping the back-up softwares, I need NTFS partition!

Quote:
Originally Posted by Doc CPU View Post
Incidentally, 5% is exactly the default percentage that ext file systems set aside as "reserved space" which is only accessible by kernel processes.
O.K. So that implies ntfs file systems don't reserve space but ext file systems.

Quote:
Originally Posted by Doc CPU View Post
What about upgrading?
Thanks for mentioning this point. OBVIOUSLY, I've to upgrade. Simply it got delayed upgrading as I wasn't having external hdd to back-up my important files from laptop. Now as I've one, I'm ready for upgrading. See what my plan is: I've made bootable usb having Ubuntu 13.10. I will back-up my data from laptop to the newly purchased hdd. Then I will replace the current Ubuntu 13.04 with Ubuntu 13.10 using usb. Then I will upgrade to Ubuntu 14.04 as it's the latest. BTW, I can also download Ubuntu 14.04 now & directly upgrade to this. But I would like to take the former method as Ubuntu 13.04 is already downloaded.
 
Old 04-26-2014, 08:55 AM   #4
Doc CPU
Senior Member
 
Registered: Jun 2011
Location: Stuttgart, Germany
Distribution: Mint, Debian, Gentoo, Win 2k/XP
Posts: 1,099

Rep: Reputation: 344Reputation: 344Reputation: 344Reputation: 344
Hi there,

Quote:
Originally Posted by ravisingh1 View Post
I don't need the NTFS partition at all. I didn't remove it simply because it had those back-up softwares & user-maual pdf guide & a few other files which were provided by the manufacturer WD.
The back-up softwares aren't compatible with Linux though. Simply I want to keep this so that sometimes later I will login to Windows to see how this back-up software works. Though I won't be using it for my work as I'm completely on Linux. I think for keeping the back-up softwares, I need NTFS partition!
not at all. I see your point about keeping the WD-supplied files, but they don't have to waste precious space on a HDD which is regularly in use. I'd back these files up once, then wipe the partition and use all the available space for my purposes.

Quote:
Originally Posted by ravisingh1 View Post
OBVIOUSLY, I've to upgrade. Simply it got delayed upgrading as I wasn't having external hdd to back-up my important files from laptop. Now as I've one, I'm ready for upgrading. See what my plan is: I've made bootable usb having Ubuntu 13.10. I will back-up my data from laptop to the newly purchased hdd. Then I will replace the current Ubuntu 13.04 with Ubuntu 13.10 using usb. Then I will upgrade to Ubuntu 14.04 as it's the latest. BTW, I can also download Ubuntu 14.04 now & directly upgrade to this. But I would like to take the former method as Ubuntu 13.04 is already downloaded.
Looks unnecessarily complicated to me. I'd favor backing up my data, then do a clean install of 14.04 from scratch. Yes, I know you can upgrade from one release to another without completely re-installing, but too often I read about problems arising with that procedure.

By the way, 14.04 is an LTS release again (long term support), which will be supported until 2019.

[X] Doc CPU
 
1 members found this post helpful.
Old 04-27-2014, 03:45 AM   #5
ravisingh1
Member
 
Registered: Apr 2013
Location: Mumbai
Distribution: Ubuntu13.10
Posts: 291

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by Doc CPU View Post
Code:
# umount /dev/sdb2
# tune2fs -m 0 /dev/sdb2
# mount /dev/sdb2
After that you will see the the magic is gone, a subsequent df should display 407G available on that partition.
Yes Doc CPU, the magic is gone & now total 407G is shown as available. Great!

Quote:
Originally Posted by Doc CPU View Post
I'd back these files up once, then wipe the partition and use all the available space for my purposes.
Thanks for sharing your method. I have opened a new thread to discuss this.

Last edited by ravisingh1; 04-27-2014 at 04:09 AM. Reason: added a link
 
  


Reply

Tags
ext4, ntfs, partition, ubuntu13.04


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
partition space and disk space usage and free don't match nsic Linux - Newbie 3 02-22-2013 12:57 PM
can i resize root partition & add space to home? vinnie_vinodh Linux - Newbie 6 08-09-2010 05:35 AM
Division of Logical Memory Space in to User Space and Kernel Space shreshtha Linux - Newbie 2 01-14-2010 09:59 AM
how to call socket prog code written in user space from kernel space???HELP kurt2 Programming 2 07-15-2009 09:56 PM
free space partition creation & MBR question icehenge Slackware 13 03-23-2004 07:54 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware

All times are GMT -5. The time now is 03:36 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration