You are not logged in.

#1 2013-04-03 21:56:56

Zzipo
Member
From: North Spain
Registered: 2013-01-07
Posts: 61

Recommendations GPT+XFS on 3TB (one partition) - fstab and warnings

Process of creation after buy the Western Digital Caviar Green 3TB

Step 1

http://www.cyberciti.biz/tips/fdisk-una … r-2tb.html

Without mounting the unity.

$ fdisk -l
We see that is the /dev/sdb and recognises 3TB
$ parted /dev/sda
(parted) mklabel gpt
(parted) unit TB
(parted) mkpart primary 0.00TB 3.00TB
(parted) name 1 media
(parted) print
number     start     end     size file     system     name flags
1    0.00TB    3.00TB    3.00TB        media
(parted) quit

Step 2

https://wiki.archlinux.org/index.php/Ma … rmance#XFS

Only this, without any other options or parameters, because by default is "on" the tweaks.

$ mkfs.xfs /dev/sda1
meta-data=/dev/sda1		isize=256	agcount=32, agsize=22892696 blks
	 =			sectsz=4096	attr=2, projid32bit=0
data	 =			bsize=4096	blocks=732566272, imaxpct=5
	 =			sunit=0		swidth=0 blks
naming	 =version 2		bsize=4096	ascii-ci=0
log	 =internal log		bsize=4096	blocks=357698, version 2
	 =			sectsz=4096	sunit=1 blks, lazy-count=1
realtime =none			extsz=4096	blocks=0, rtextents=0

I check with fdisk -l

Everything is normal in fdisk -l but not the related with the /dev/sda disk:

WARNING: GPT (GUID Partition Table) detected on '/dev/sda'! The util fdisk doesn't support GPT. Use GNU Parted.

Disk /dev/sda: 3000.6 GB, 3000592982016 bytes, 5860533168 sectors
Units = sectors of 1 * 512 = 512 bytes
SEctor size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 3096 bytes / 4096 bytes
Disk Identifier: 0x00000000

Device boot	Start	End		Blocks		Id	System
/dev/sda1	1	4294967295	2147483647+	ee	GPT
Partition 1 does not start on physical sector boundary.

   
WARNING: GPT (GUID Partition Table) detected on '/dev/sda'! The util fdisk doesn't support GPT. Use GNU Parted.
Partition 1 does not start on physical sector boundary.



Step 3

Check for inconsistencies and repair:
I read: https://bbs.archlinux.org/viewtopic.php?id=110648
- Searching for: "read if you are new to xfs" because the two links are dead.
http://forum.linhes.org/viewtopic.php?f=3&t=18601

But the "man xfs_check" says:
Note that using xfs_check is NOT recommended. Please use xfs_repair -n  instead, for better scalability and speed.

So, the guide is not updated.

I read "man xfs_repair", and it says with -n "no modify mode", so, Ok.
Should be used with the device unmounted.

So, I do:

$ xfs_repair -n /dev/sda
Phase 1 - find and verify superblock...
bad primary superblock - bad magic number!!!

attempting to find secondary superblock...
.......(until I do Ctrl-c)

My error, repeat with the only one partition:

$ xfs_repair -n /dev/sda1
Phase 1 - find and verify superblock...
Phase 2 - using internal log
	- scan filesystem freespace and inode maps...
	- found root inode chunk
Phase 3 - for each AG...
	- scan (but don't clear) agi unlinked lists...
	- process known inodes and perform inode discovery...
	- agno = 0
	- agno = 1
	..........
	- agno = 31
	- process newly discovered inodes...
Phase 4 - check for duplicate blocks...
	- setting up duplicate extent list...
	- check for inodes claiming duplicate blocks...
	- agno = 0
	- agno = 3
	- agno = 4
	..........
	- agno = 31
	- agno = 2
	- agno = 1
No modify flag set, skipping phase 5
Phase 6 - check inode connectivity...
	- traversing filesystem ...
	- traversal finished ...
	- moving disconnected inodes to lost+found
Phase 7 - verify link counts...
No modify flag set, skipping filesystem flush and exiting.

Is normal that the phase 3 start from 0 to 31, and the phase 4: 0,3,4...31,2,1?
Also that about the flag set and skipping the phase 5?


I read different links on the Web, and the steps that I have followed, is the recommended.
Should I do another thing?

I read that parted and gdisk are ok to create GPT partitions, and I choosed parted.

The only thing that "confuse" me is the two messages in the xfs_repair -n   and also the fdisk -l message.



And, If we suppose that this is Ok, what is the normal maintenance for xfs?
Just do: xfs_repair -n    and follow that guide: http://forum.linhes.org/viewtopic.php?f=3&t=18601

And for the fstab (when I will install archlinux), as this guide says: https://wiki.archlinux.org/index.php/XFS
Only: nobarrier
Because it says that improves the performance.
I won't use "noatime" and "nodiratime" because of the paragraph (no really results on performance).

But if we see this other guide, it says other things... what to trust?
http://blog.peacon.co.uk/wiki/Creating_ … Partitions
- mkfs.xfs different
- fstab different

My plan is use the whole disk (one partition) to store video/music, and do streaming through DLNA/Plex.

Is because I choosed XFS and not EXT4.

I see that GPT has usually other minor partitions, but I don't know if those are only necessary when you are going to use a bootloader, etc.
I followed the steps of the first link (http://www.cyberciti.biz/tips/fdisk-una … r-2tb.html), is because I only create one partition (no other smalls for LBA...)

Last edited by Zzipo (2013-04-03 22:00:04)

Offline

#2 2013-04-03 22:25:56

elkoraco
Member
Registered: 2013-02-18
Posts: 140

Re: Recommendations GPT+XFS on 3TB (one partition) - fstab and warnings

Zzipo wrote:

Everything is normal in fdisk -l but not the related with the /dev/sda disk:

WARNING: GPT (GUID Partition Table) detected on '/dev/sda'! The util fdisk doesn't support GPT. Use GNU Parted.

This is just a warning saying that fdisk doesn't read GPT properly and can't manipulate it. Use gdisk, sgdisk or similar.

Offline

#3 2013-04-03 22:39:50

s1ln7m4s7r
Member
Registered: 2013-02-22
Posts: 262

Re: Recommendations GPT+XFS on 3TB (one partition) - fstab and warnings

$ fdisk -l
We see that is the /dev/sdb and recognises 3TB
$ parted /dev/sda

I guess you wanted to say:

$ fdisk -l
We see that is the /dev/sda and recognises 3TB
$ parted /dev/sda

.......

WARNING: GPT (GUID Partition Table) detected on '/dev/sda'! The util fdisk doesn't support GPT. Use GNU Parted.

This warning appears because fdisk only supports MBR partition table and you created a GPT partition table with parted, you can edit it using parted or (gdisk;sgdisk;cgdisk) http://www.rodsbooks.com/gdisk/.

Partition 1 does not start on physical sector boundary.

This appears because GPT disks need to have an empty space of 1 MB at the beginning of the table before the first partition. When you edit GPT disks with parted it doesn't allign your partition to it, so you need to do it manually. Instead you can create your partitions with (gdisk;sgdisk;cgdisk), those will allign your partition automatically.

Last edited by s1ln7m4s7r (2013-04-03 22:41:16)

Offline

#4 2013-04-03 22:40:06

Zzipo
Member
From: North Spain
Registered: 2013-01-07
Posts: 61

Re: Recommendations GPT+XFS on 3TB (one partition) - fstab and warnings

Ok.

And the other?

If I do gdisk -l /dev/sda
it says:

MBR: protective
GPT: present

2.7 TiB
Logical sector size; 512 bytes
First usable sector is 34, last usable sector is 5860533134
Partitions will be aligned on 2048-sector boundaries.
Total free space is 2925 sectors (1.4 MiB)

Number      Start(sector)    End(sector)    Size   Code    Name
1             2048           586053223       2.7TiB    0700   media

I have found also this:
https://wiki.archlinux.org/index.php/Advanced_Format

Mine is: WD30EZRX
As I see mine is 4K aligned, so, ok.
But in the below part it says:
Caviar Green HDDS (usually WD20EARS) attempt to park the read heads once every 8 seconds...
I will check if mine does this.

Offline

#5 2013-04-03 22:57:07

Zzipo
Member
From: North Spain
Registered: 2013-01-07
Posts: 61

Re: Recommendations GPT+XFS on 3TB (one partition) - fstab and warnings

s1ln7m4s7r wrote:

$ fdisk -l
We see that is the /dev/sdb and recognises 3TB
$ parted /dev/sda

I guess you wanted to say:

$ fdisk -l
We see that is the /dev/sda and recognises 3TB
$ parted /dev/sda

.......

WARNING: GPT (GUID Partition Table) detected on '/dev/sda'! The util fdisk doesn't support GPT. Use GNU Parted.

This warning appears because fdisk only supports MBR partition table and you created a GPT partition table with parted, you can edit it using parted or (gdisk;sgdisk;cgdisk) http://www.rodsbooks.com/gdisk/.

Partition 1 does not start on physical sector boundary.

This appears because GPT disks need to have an empty space of 1 MB at the beginning of the table before the first partition. When you edit GPT disks with parted it doesn't allign your partition to it, so you need to do it manually. Instead you can create your partitions with (gdisk;sgdisk;cgdisk), those will allign your partition automatically.

Sorry, It was a typo.

OK, so, I should use 1Mb before.

I will use gdisk, but I have some questions.

imagine:

$ gdisk /dev/sda

n
start sector? 34?
last? +1M
type? What is this type? 0700? EF00? (EFI system) EF02?

n
start sector? What now?
last? 3T?
type? 0700

w
q

I see in this forum, that "Delicates" create a 3TB GPT disk, only one partition (type 0700) and starting in the sector 40, finishing in the 5860533127. (Because he says that must finish in multiple8 -1 because of the LBA).
http://forums.gentoo.org/viewtopic-t-838522.html

Should I do the same? Or you specified another thing?
If so, I will only modify the mkfs.ext4 by mkfs.xfs with no parameters (although I have seen in other webs they use -b 4096) but in the wiki of ArchLinux says better without parameters.

Last edited by Zzipo (2013-04-03 23:09:41)

Offline

#6 2013-04-03 22:59:18

s1ln7m4s7r
Member
Registered: 2013-02-22
Posts: 262

Re: Recommendations GPT+XFS on 3TB (one partition) - fstab and warnings

^^

Zzipo wrote:

Ok.

And the other?

If I do gdisk -l /dev/sda
it says:

MBR: protective
GPT: present

2.7 TiB
Logical sector size; 512 bytes
First usable sector is 34, last usable sector is 5860533134
Partitions will be aligned on 2048-sector boundaries.
Total free space is 2925 sectors (1.4 MiB)

Number      Start(sector)    End(sector)    Size   Code    Name
1             2048           586053223       2.7TiB    0700   media

As you can see when you opened the drive with gdisk it aligned your partition!!!
If you want to edit the disk do

cgdisk /dev/sda

instead, because its the easiest way to setup it. Just create a new partition and it will create the boundaries by it self.

xfs_repair -n /dev/sda
Phase 1 - find and verify superblock...
bad primary superblock - bad magic number!!!
...

That's because xfs_repair is to be used on partitions and not raw disks.

Is normal that the phase 3 start from 0 to 31, and the phase 4: 0,3,4...31,2,1?
Also that about the flag set and skipping the phase 5?

That's completely normal. The flag its because you used -n (No modify mode) parameter into xfs_repair and that's why it skips phase 5 .

EDIT:

And, If we suppose that this is Ok, what is the normal maintenance for xfs?
Just do: xfs_repair -n    and follow that guide: http://forum.linhes.org/viewtopic.php?f=3&t=18601

xfs_repair is only to be used if you experience data corruption and not for normal maintenance. And xfs_repair -n won't apply changes to the disk because of the -n parameter you need to follow the guide for the correct syntax.
Also read carefully the xfs wiki http://xfs.org/index.php/Main_Page expecially the FAQ, its very usefull to understand the filesystem.

And for the fstab (when I will install archlinux), as this guide says: https://wiki.archlinux.org/index.php/XFS
Only: nobarrier
Because it says that improves the performance.

Be carefull because this option can lead to data corruption.

You should read what each option does (pros and cons) before applying them.

NEW EDIT:

I see in this forum, that "Delicates" create a 3TB GPT disk, only one partition (type 0700) and starting in the sector 40, finishing in the 5860533127. (Because he says that must finish in multiple8 -1 because of the LBA).
http://forums.gentoo.org/viewtopic-t-838522.html
Should I do the same? Or you specified another thing?
If so, I will only modify the mkfs.ext4 by mkfs.xfs with no parameters (although I have seen in other webs they use -b 4096) but in the wiki of ArchLinux says better without parameters.

First you need to read this to fully understand what it is and what it does:

http://www.bit-tech.net/hardware/storag … ard-disks/

If you want to use the advantages you can create your partition using a multiple of 8. The start sector will be the same 2048 because 2048 is a multiple of 8. About formatting it its better to do as ArchLinux wiki says (no parameters)

Last edited by s1ln7m4s7r (2013-04-04 02:10:37)

Offline

#7 2013-04-03 23:30:37

Zzipo
Member
From: North Spain
Registered: 2013-01-07
Posts: 61

Re: Recommendations GPT+XFS on 3TB (one partition) - fstab and warnings

Thanks.

Ok, so, maybe better no modifications to the fstab.

Because in same places i found noatime, in the wiki it says that better not. Only nobarrier...

I prefer normal performance but avoid data corruption.

I will read about the XFS filesystem... but I don't know how much I will understand.

OK, finally I have done cgdisk /dev/sda and just write. NO modifications. No "Delicates" changes.

Offline

Board footer

Powered by FluxBB