LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Ubuntu (https://www.linuxquestions.org/questions/ubuntu-63/)
-   -   Just formatted partition (ext4) is 5.4% used!? (https://www.linuxquestions.org/questions/ubuntu-63/just-formatted-partition-ext4-is-5-4-used-843621/)

512upload 11-11-2010 03:11 AM

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?

syg00 11-11-2010 03:13 AM

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.

512upload 11-11-2010 07:24 AM

How do I set it to zero?

TobiSGD 11-11-2010 07:39 AM

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

512upload 11-11-2010 08:45 AM

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

TobiSGD 11-11-2010 11:05 AM

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.

512upload 11-11-2010 05:58 PM

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?

jay73 11-13-2010 11:28 AM

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.

512upload 11-13-2010 03:59 PM

Quote:

Originally Posted by jay73 (Post 4157712)
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!

impert 11-13-2010 04:31 PM

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)

512upload 11-13-2010 05:25 PM

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

jay73 11-13-2010 08:46 PM

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.

512upload 11-14-2010 04:00 AM

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.

512upload 11-14-2010 04:02 AM

Just for curiosity: why is it that "you have 5% reserved for root by default"? Does anybody of you know?

cepheus11 11-14-2010 05:18 AM

Quote:

Originally Posted by 512upload (Post 4158239)
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.


All times are GMT -5. The time now is 09:05 PM.