LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu
User Name
Password
Ubuntu This forum is for the discussion of Ubuntu Linux.

Notices

Reply
 
Search this Thread
Old 11-11-2010, 03:11 AM   #1
512upload
Member
 
Registered: Jul 2007
Distribution: Ubuntu
Posts: 137

Rep: Reputation: 16
Question Just formatted partition (ext4) is 5.4% used!?


I have two ext4 partitions. The first has Ubuntu 64-bits installed. The other, I just formatted it to ext4 so I can use it to store files. However, when I right-click this second partition and check properties, I see:

20,5 GB used

378,9 GB free

total capacity: 399,4 GB

Why is this just formatted partition using so much space?
 
Old 11-11-2010, 03:13 AM   #2
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 12,352

Rep: Reputation: 1042Reputation: 1042Reputation: 1042Reputation: 1042Reputation: 1042Reputation: 1042Reputation: 1042Reputation: 1042
I would suggest you visit the FAQ at the wiki.

Edit: sorry, ignore that; I was thinking btrfs for some reason.
For ext? you have 5% reserved for root by default - set it to zero for data (only) filesystems.

Last edited by syg00; 11-11-2010 at 03:38 AM.
 
Old 11-11-2010, 07:24 AM   #3
512upload
Member
 
Registered: Jul 2007
Distribution: Ubuntu
Posts: 137

Original Poster
Rep: Reputation: 16
How do I set it to zero?
 
Old 11-11-2010, 07:39 AM   #4
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Hanover, Germany
Distribution: Main: Gentoo Others: What fits the task
Posts: 15,592
Blog Entries: 2

Rep: Reputation: 4047Reputation: 4047Reputation: 4047Reputation: 4047Reputation: 4047Reputation: 4047Reputation: 4047Reputation: 4047Reputation: 4047Reputation: 4047Reputation: 4047
You can format it new (if there is no data on it) with
Code:
sudo mkfs -t ext4 -m 0 /dev/sdXX
where you replace XX with the drive you want to format.
Or you can use tune2fs, but I don't know the syntax, maybe it helps to
Code:
man tune2fs
 
1 members found this post helpful.
Old 11-11-2010, 08:45 AM   #5
512upload
Member
 
Registered: Jul 2007
Distribution: Ubuntu
Posts: 137

Original Poster
Rep: Reputation: 16
Under

System > Administration

there is a tool for disk management. Can I use it to set my second partition to zero? If yes, will my files on the second partition be erased?

You can find the information about my two partitions here:

http://img338.imageshack.us/img338/6...turaecra1l.png
http://img403.imageshack.us/img403/6...pturaecra2.png
 
Old 11-11-2010, 11:05 AM   #6
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Hanover, Germany
Distribution: Main: Gentoo Others: What fits the task
Posts: 15,592
Blog Entries: 2

Rep: Reputation: 4047Reputation: 4047Reputation: 4047Reputation: 4047Reputation: 4047Reputation: 4047Reputation: 4047Reputation: 4047Reputation: 4047Reputation: 4047Reputation: 4047
The diskmanagement-tools that run from GUI are mostly very basic when it comes to options for formatting. I would recommend to use the command line.
 
1 members found this post helpful.
Old 11-11-2010, 05:58 PM   #7
512upload
Member
 
Registered: Jul 2007
Distribution: Ubuntu
Posts: 137

Original Poster
Rep: Reputation: 16
I used "sudo mkfs -t ext4 -m 0 /dev/sda2" and it worked, but now, I don't know why, when I right-click this second partition to paste, this option (paste) is greyed (=unavailable). This did not happen when I had this partition formatted in ext4 the regular way.

What is happening?
 
Old 11-13-2010, 11:28 AM   #8
jay73
Guru
 
Registered: Nov 2006
Location: Belgium
Distribution: Ubuntu 11.04, Debian testing
Posts: 5,019

Rep: Reputation: 130Reputation: 130
Reformatting a partition typically discards any write permissions you had before. If that is your problem (just run an ls -l to find out), you can run sudo chown -R username.username on the mount point.

Last edited by jay73; 11-13-2010 at 11:29 AM.
 
Old 11-13-2010, 03:59 PM   #9
512upload
Member
 
Registered: Jul 2007
Distribution: Ubuntu
Posts: 137

Original Poster
Rep: Reputation: 16
Quote:
Originally Posted by jay73 View Post
Reformatting a partition typically discards any write permissions you had before. If that is your problem (just run an ls -l to find out), you can run sudo chown -R username.username on the mount point.
I'm sorry, I'm not very experienced in Linux so I would like you to explain me what output should I look for after using the command "ls -l" to know if that (the fact that reformatting a partition typically discards any write permissions you had before) is my problem and whether should I have my second partition mounted (through having it listed on /etc/fstab and restarting) before running "ls -l".

Also, I don't understand what you mean by "the mount point".

Thank you for your help!
 
Old 11-13-2010, 04:31 PM   #10
impert
Member
 
Registered: Feb 2009
Posts: 282

Rep: Reputation: 53
Here's an example:
Code:
cam@cwpc:~$ ls -l / 
. . .
lrwxrwxrwx   1 root root     5 2009-11-07 20:38 data -> /SDA4
drwxr-xr-x  24 cam  cam   4096 2010-10-27 14:23 SDA4
. . .
(/SDA4 is the mount point of my partition /dev/sda4)
But perhaps your partition is not mounted. It won't be if it's not in your /etc/fstab file and/or you haven't mounted it manually.
To check if it's mounted:
Code:
cat /etc/mtab
which should give something like:
Code:
/dev/sda4 /SDA4 ext3 rw 0 0
(plus a bit of other stuff if it's mounted. Note:yours will say ext4, not ext3)
If it's not mounted, and you want it mounted at boot time, edit /etc/fstab (using sudo gedit /etc/fstab), and add a line like:
Code:
/dev/sda4 	/SDA4		ext3	defaults	0	2
changing the /dev/sda4 to /dev/sda2, and the mount point to whatever mount point you have. You don't have a mount point? Make one:
Code:
sudo mkdir /data
You can use pretty much any name except one that already exists.
To mount it for the current session only:
Code:
sudo mount -t ext4 /dev/sda2 /data
change name of mount point to suit.
This will only work after you've made a mount point (mkdir as above)
 
Old 11-13-2010, 05:25 PM   #11
512upload
Member
 
Registered: Jul 2007
Distribution: Ubuntu
Posts: 137

Original Poster
Rep: Reputation: 16
After having run "sudo mkfs -t ext4 -m 0 /dev/sda2" I followed the instructions from http://www.linuxquestions.org/questi...tartup-837768/ (first reply) to have the 2nd partition (this time ext4 instead of NTFS) mounted. Then you told me:

"Reformatting a partition typically discards any write permissions you had before. If that is your problem (just run an ls -l to find out), you can run sudo chown -R username.username on the mount point." #8

Which I didn't understand and because of this I replied you with #9 of this post. The problem is that I don't see how #10 clarifies #8/#9

1.1 In other words, I would like to ask: how do I know if my problem is the fact that the formatting I made with "sudo mkfs -t ext4 -m 0 /dev/sda2" discarded the write permissions I had before?
1.2 What tells me this through the output of the command "ls -l"? Is it the fact that my 2nd partition is mounted? Is it the fact that my 2nd partition is not mounted? Is it some other part of the "ls -l" command's output?

2 Does "run sudo chown -R username.username on the mount point" mean the command I should use is "sudo chown -R sf.sf /mnt/cdrive" (sf is my username)?

So that you can better understand my problem, I give you the text from my fstab file and the output of "ls -l", respectively:

# /etc/fstab: static file system information.
#
# Use 'blkid -o value -s UUID' to print the universally unique identifier
# for a device; this may be used with UUID= as a more robust way to name
# devices that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point> <type> <options> <dump> <pass>
proc /proc proc nodev,noexec,nosuid 0 0
/dev/sda1 / ext4 errors=remount-ro 0 1
/dev/fd0 /media/floppy0 auto rw,user,noauto,exec,utf8 0 0
/dev/sda2 /mnt/cdrive auto defaults 0 0

sf@SF-desktop:~$ ls -l
total 36
drwxr-xr-x 6 sf sf 4096 2010-11-13 16:32 Área de Trabalho
drwxr-xr-x 2 sf sf 4096 2010-07-20 21:03 Documentos
-rw-r--r-- 1 sf sf 179 2010-07-20 20:56 examples.desktop
drwxr-xr-x 3 sf sf 4096 2010-08-23 17:48 Imagens
drwxr-xr-x 2 sf sf 4096 2010-07-20 21:03 Modelos
drwxr-xr-x 2 sf sf 4096 2010-07-20 21:03 Música
drwxr-xr-x 2 sf sf 4096 2010-07-20 21:03 Público
drwxr-xr-x 2 sf sf 4096 2010-09-06 14:17 Transferências
drwxr-xr-x 2 sf sf 4096 2010-07-20 21:03 Vídeos
 
Old 11-13-2010, 08:46 PM   #12
jay73
Guru
 
Registered: Nov 2006
Location: Belgium
Distribution: Ubuntu 11.04, Debian testing
Posts: 5,019

Rep: Reputation: 130Reputation: 130
Quote:
2 Does "run sudo chown -R username.username on the mount point" mean the command I should use is "sudo chown -R sf.sf /mnt/cdrive" (sf is my username)?
Yes, that's it. Although you may prefer using a different mount point for that partition. If you create a "Data" folder in your home directory, you can access it from your home directory, which is probably more convenient.You would have to edit /etc/fstab (sudo gedit /etc/fstab) and replace:
/dev/sda2 /mnt/cdrive auto defaults 0 0
with
/dev/sda2 /home/sf/Data auto defaults 0 0

Quote:
Also, I don't understand what you mean by "the mount point".
The "mount point" is the folder through which a partition is accessible. In your case, that would be /mnt/cdrive.

Last edited by jay73; 11-13-2010 at 08:48 PM.
 
2 members found this post helpful.
Old 11-14-2010, 04:00 AM   #13
512upload
Member
 
Registered: Jul 2007
Distribution: Ubuntu
Posts: 137

Original Poster
Rep: Reputation: 16
Thanks a lot to all of you! It worked perfectly! I decided to keep the mount point as "/mnt/cdrive". It really doesn't make any difference to me.
 
Old 11-14-2010, 04:02 AM   #14
512upload
Member
 
Registered: Jul 2007
Distribution: Ubuntu
Posts: 137

Original Poster
Rep: Reputation: 16
Just for curiosity: why is it that "you have 5% reserved for root by default"? Does anybody of you know?
 
Old 11-14-2010, 05:18 AM   #15
cepheus11
Member
 
Registered: Nov 2010
Location: Germany
Distribution: Gentoo
Posts: 141

Rep: Reputation: 39
Quote:
Originally Posted by 512upload View Post
why is it that "you have 5% reserved for root by default"?
From then tune2fs man page:

Quote:
Reserving some number of filesystem blocks for use by privileged processes is done to avoid filesystem fragmentation, and to allow system daemons, such as syslogd(8), to continue to function correctly after non-privileged processes are prevented from writing to the filesystem.
This is especially important for your main system partition (the "/" or "root" filesystem). Not so important for user data.
 
  


Reply


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
[SOLVED] Mounting ext4 partition rusyd Gentoo 3 08-22-2010 02:09 AM
[SOLVED] Space available on ext4 partition jbcoats Linux - General 2 05-15-2010 03:27 AM
ext4 and / partition Pedroski Linux - Hardware 7 11-04-2009 07:44 PM
Ext4 partition corrupted by resized NTFS Vista C:\ partition? graviton-boson Linux - Newbie 2 03-16-2009 01:26 PM
partition formatted on each new installation? timsch75 Linux - Newbie 2 03-01-2004 11:28 AM


All times are GMT -5. The time now is 09:24 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration