Jump to content


Photo

Determine if disk is ext4

HowTo ext4

  • Please log in to reply
5 replies to this topic

#1 Marc-UK

  • Senior Member
  • 39 posts

+1
Neutral

Posted 5 November 2013 - 17:53

Hello all,

 

I converted my internal HDD from ext3 to ext4 last night. The conversion seems to have gone fine and it seems the disk is now in ext4. I searched a little and thought I would share what I found if someone else wants to find this out as well:

 

Method 1: Type mount from a terminal >> It should show your disk as ext4. In my case: /dev/sda1 on /media/hdd type ext4 (rw,relatime,barrier=1,data=writeback)

 

Method 2: Type the following tune2fs -l /dev/sda1 | grep features >> It should show you the extent feature. In my case: has_journal ext_attr resize_inode dir_index filetype needs_recovery extent sparse_super large_file uninit_bg

 

Method 3: Type ls /proc/fs/ext4 >> It should show a folder for your disk. In my case sda1

 

Method 4: Type ls /sys/fs/ext4 >> It should also show a folder for you disk. ln my case sda1

 

You can find more info at the following links:

https://www.kernel.o...ystems/ext4.txt

http://unix.stackexc...t2-ext3-or-ext4

http://www.debian-ad...ext4_filesystem

https://ext4.wiki.ke....php/Ext4_Howto

 



Re: Determine if disk is ext4 #2 MiLo

  • PLi® Core member
  • 14,055 posts

+298
Excellent

Posted 5 November 2013 - 20:44

Method 1: Type mount from a terminal >> It should show your disk as ext4. In my case: /dev/sda1 on /media/hdd type ext4 (rw,relatime,barrier=1,data=writeback)

This one is wrong actually. The ext4 driver also mounts ext2/3 disks, so it will always show up this way.
Real musicians never die - they just decompose

Re: Determine if disk is ext4 #3 betacentauri

  • PLi® Core member
  • 7,185 posts

+323
Excellent

Posted 5 November 2013 - 20:53

And I guess that method 3 and 4 also don't work reliable for the same reason as MiLo mentioned.
Xtrend ET-9200, ET-8000, ET-10000, OpenPliPC on Ubuntu 12.04

Re: Determine if disk is ext4 #4 Marc-UK

  • Senior Member
  • 39 posts

+1
Neutral

Posted 5 November 2013 - 20:56

Method 1: Type mount from a terminal >> It should show your disk as ext4. In my case: /dev/sda1 on /media/hdd type ext4 (rw,relatime,barrier=1,data=writeback)

This one is wrong actually. The ext4 driver also mounts ext2/3 disks, so it will always show up this way.

Thank you MiLo,

 

That's what I thought because when my disk was in ext3, I remember checking this and saw something similar. Since my disk is no longer in ext3, I could not double check this again. That's why I looked for alternative ways to check and found the other 3.

 

One side question: at the end of this article they mention that after converting from ext3 to ext4, you should migrate files to extent. I ran the lsattr command and saw no files with the "e" attribute. If I try to use the proposed chattr +e command, I get an error that "e" is unsupported. Is there a way to perform this or should I just leave my disk as it is now? I thought of moving files from one folder to another to perform a write operation, but I don't know if this would be sufficient (ie. really re-write the file or just some pointer to the folder reference). Any ideas?



Re: Determine if disk is ext4 #5 jackassnl

  • Senior Member
  • 92 posts

+3
Neutral

Posted 5 November 2013 - 21:46

blkid /dev/sda1


Re: Determine if disk is ext4 #6 MiLo

  • PLi® Core member
  • 14,055 posts

+298
Excellent

Posted 6 November 2013 - 08:21

After the "conversion", all existing files on disk are still in ext3 format. Only new files will be written using extents.

If you want a "true" ext4 disk, the best way is to copy the data to another disk, re-initialize it, and copy the data back. If your kernel is recent enough (>=3.2), the initialization will also activate the large cluster feature, which cannot be changed with e2utils.

There isn't much to gain really here - your box won't miraculously speed up or so. The only noticeable difference between the old and new files is that deleting large files that use extents is a lot quicker. Spending several hours on converting existing files just to save a few minutes when deleting them doesn't sound effective to me.
Real musicians never die - they just decompose



Also tagged with one or more of these keywords: HowTo, ext4

1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users