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 |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
05-14-2023, 04:25 PM
|
#1
|
LQ Newbie
Registered: May 2023
Posts: 9
Rep:
|
Error when placing XFS journal on external device
Greetings good folks. I find myself in need of some deep linux voodoo.
My life story: I recently got some drives and repurposed some spare parts as a NAS. I decided that is the perfect excuse to properly get into linux. I have used linux only peripherally before, in my web dev job - a few terminal commands here and there, some light server admin. Starting from the ground up has been fun so far.
I was researching what filesystem to put on my hard drives - I have 2 18TB ones, intended for data and parity (using snapraid).
I wanted to try XFS.
One feature of xfs is that apparently you can put the journal on a different device. This would certainly save some iops and improve perf on spinning rust.
Code:
sudo mkfs.xfs -N -l logdev=/mnt/data-journal/journal,size=100m /dev/sdc
However I have ran into the following error:
Quote:
size 100m specified for log subvolume is too large, maximum is 0 blocks
|
Alternatively, if no size is specified: unable to get size of the log subvolume.
I have ubuntu 22.04 LTS.
First I tried this on xfsprogs v5.13.0
Then I considered maybe this version had a bug and compiled v6.2.0 from source (another first for me).
The error did not go away.
The log's destination is the boot drive (which is an SSD). It's formatted with btrfs if that makes any difference (and the target is a subvolume I made just for the log).
Also, something else that might be relevant - log drive is 512b sectors, hard drives are 4K sectors (no really 4K).
Bonus:
Code:
sudo mkfs.xfs -N -l logdev=/dev/sdb,size=512m /dev/sdc
gives the following: Warning: the log subvolume sector size 512 is less than the sector size reported by the device (4096).
So trying to put it on the other hdd works (save for the warning). The only difference between both commands are
a) The target is a file in one instance and a device in the other.
b) Sector sizes are different.
Last edited by martixy; 05-14-2023 at 04:30 PM.
|
|
|
05-15-2023, 04:25 AM
|
#2
|
LQ Newbie
Registered: May 2023
Posts: 9
Original Poster
Rep:
|
I figured out the problem.
The file needs to be pre-allocated.
Aka sudo truncate -s 256m /mnt/xfs-journal/data-journal
(I'm new to linux so this was not at all obvious to me.)
I created the filesystem.
But of course now there's another problem. Because of course there is...
Code:
sudo mount -t xfs -o logdev=/mnt/xfs-journal/data-journal /dev/sdb1 /mnt/data
Quote:
/mnt/data: the kernel does not recognize /dev/sdb1 as a block device; maybe "modprobe driver" is necessary.
|
|
|
|
05-15-2023, 05:35 AM
|
#3
|
Senior Member
Registered: Apr 2003
Location: Germany
Distribution: openSuSE Tumbleweed-KDE, Mint 21, MX-21, Manjaro
Posts: 4,639
Rep: 
|
Well, I'm certainly no expert here. But you mentioned that the journal is supposed to reside on a btrfs partition. These are called subvolumes in btrfs syntax and are addressed with names containing an @. You might want to read up on that. Sorry to be not more specific but I simply don't know enough about all this, still, just maybe it could help...
|
|
|
05-15-2023, 06:20 AM
|
#4
|
LQ Newbie
Registered: May 2023
Posts: 9
Original Poster
Rep:
|
Quote:
Originally Posted by JZL240I-U
Well, I'm certainly no expert here. But you mentioned that the journal is supposed to reside on a btrfs partition. These are called subvolumes in btrfs syntax and are addressed with names containing an @. You might want to read up on that. Sorry to be not more specific but I simply don't know enough about all this, still, just maybe it could help...
|
For one, I don't think that's true.
But even then, I tried putting the log on a different drive (which was formatted with a working xfs itself). Same error.
If I point it to a block device it mounts:
Code:
sudo mount -t xfs -o logdev=/dev/sda1 /dev/sdb1 /mnt/data
If I point it to a file, it does not mount:
Code:
sudo mount -t xfs -o logdev=/mnt/xfs-journal/data-journal /dev/sdb1 /mnt/data
Last edited by martixy; 05-15-2023 at 06:22 AM.
|
|
|
05-15-2023, 07:27 AM
|
#5
|
Moderator
Registered: Aug 2002
Posts: 26,758
|
I don't know much about the internal workings of xfs either but it would not make sense a log device would be a file. The driver would be calling another filesystem with its own metadata and journal. A separate partition as the log device does make sense.
|
|
1 members found this post helpful.
|
05-15-2023, 10:07 AM
|
#6
|
Senior Member
Registered: Jul 2020
Posts: 1,525
|
Well, yes, device and file are not the same and are not interchangeable, and xfs man page explicitly states that a device is needed for logdev - why the surprise? Incidentally, have you ever heard of loop devices? :)
|
|
1 members found this post helpful.
|
05-15-2023, 11:18 AM
|
#7
|
LQ Newbie
Registered: May 2023
Posts: 9
Original Poster
Rep:
|
I know you can make filesystems inside files. But yea, I eventually arrived at the same conclusion and made a separate partition for it.
Thank you tho! I'm new, but I'm learning. 
|
|
|
05-15-2023, 01:30 PM
|
#8
|
Senior Member
Registered: Jul 2020
Posts: 1,525
|
Loop devices are not for making filesystems in files, they are for making block devices in files, and then you can use these devices for filesystems, yes, but also for xfs journals.
|
|
1 members found this post helpful.
|
05-16-2023, 10:09 AM
|
#9
|
LQ Newbie
Registered: May 2023
Posts: 9
Original Poster
Rep:
|
Quote:
Originally Posted by lvm_
Loop devices are not for making filesystems in files, they are for making block devices in files, and then you can use these devices for filesystems, yes, but also for xfs journals.
|
Oh! Neat.
I will read up on that. Thank you!
|
|
|
05-17-2023, 01:04 PM
|
#10
|
Senior Member
Registered: Apr 2003
Location: Germany
Distribution: openSuSE Tumbleweed-KDE, Mint 21, MX-21, Manjaro
Posts: 4,639
Rep: 
|
Quote:
Originally Posted by martixy
For one, I don't think that's true.
|
Okay. All other more relevant posts aside, this is my /etc/fstab of an openSuse tumbleweed on btrfs:
Code:
UUID=8ff0da0e-4339-4eb8-9090-088b8e646a01 / btrfs defaults 0 0
UUID=8ff0da0e-4339-4eb8-9090-088b8e646a01 /var btrfs subvol=/@/var 0 0
UUID=8ff0da0e-4339-4eb8-9090-088b8e646a01 /usr/local btrfs subvol=/@/usr/local 0 0
UUID=8ff0da0e-4339-4eb8-9090-088b8e646a01 /srv btrfs subvol=/@/srv 0 0
UUID=8ff0da0e-4339-4eb8-9090-088b8e646a01 /root btrfs subvol=/@/root 0 0
UUID=8ff0da0e-4339-4eb8-9090-088b8e646a01 /opt btrfs subvol=/@/opt 0 0
UUID=8ff0da0e-4339-4eb8-9090-088b8e646a01 /home btrfs subvol=/@/home 0 0
UUID=8ff0da0e-4339-4eb8-9090-088b8e646a01 /boot/grub2/x86_64-efi btrfs subvol=/@/boot/grub2/x86_64-efi 0 0
UUID=8ff0da0e-4339-4eb8-9090-088b8e646a01 /boot/grub2/i386-pc btrfs subvol=/@/boot/grub2/i386-pc 0 0
UUID=8ff0da0e-4339-4eb8-9090-088b8e646a01 /.snapshots btrfs subvol=/@/.snapshots 0 0
UUID=7c5b0e30-2117-4c1a-abde-b38953b49a06 swap swap defaults 0 0
UUID=D1CD-79A5 /boot/efi vfat utf8 0 2
#/dev/sda1 /backup ext4 defaults 0 2
UUID=792fc662-3296-4884-8743-4868ce71f55c /backup ext4 defaults 0 2
You can draw your own conclusions...
|
|
|
05-27-2023, 10:13 AM
|
#11
|
LQ Newbie
Registered: May 2023
Posts: 9
Original Poster
Rep:
|
Quote:
Originally Posted by JZL240I-U
Okay. All other more relevant posts aside, this is my /etc/fstab of an openSuse tumbleweed on btrfs:
Code:
UUID=8ff0da0e-4339-4eb8-9090-088b8e646a01 / btrfs defaults 0 0
UUID=8ff0da0e-4339-4eb8-9090-088b8e646a01 /var btrfs subvol=/@/var 0 0
UUID=8ff0da0e-4339-4eb8-9090-088b8e646a01 /usr/local btrfs subvol=/@/usr/local 0 0
UUID=8ff0da0e-4339-4eb8-9090-088b8e646a01 /srv btrfs subvol=/@/srv 0 0
UUID=8ff0da0e-4339-4eb8-9090-088b8e646a01 /root btrfs subvol=/@/root 0 0
UUID=8ff0da0e-4339-4eb8-9090-088b8e646a01 /opt btrfs subvol=/@/opt 0 0
UUID=8ff0da0e-4339-4eb8-9090-088b8e646a01 /home btrfs subvol=/@/home 0 0
UUID=8ff0da0e-4339-4eb8-9090-088b8e646a01 /boot/grub2/x86_64-efi btrfs subvol=/@/boot/grub2/x86_64-efi 0 0
UUID=8ff0da0e-4339-4eb8-9090-088b8e646a01 /boot/grub2/i386-pc btrfs subvol=/@/boot/grub2/i386-pc 0 0
UUID=8ff0da0e-4339-4eb8-9090-088b8e646a01 /.snapshots btrfs subvol=/@/.snapshots 0 0
UUID=7c5b0e30-2117-4c1a-abde-b38953b49a06 swap swap defaults 0 0
UUID=D1CD-79A5 /boot/efi vfat utf8 0 2
#/dev/sda1 /backup ext4 defaults 0 2
UUID=792fc662-3296-4884-8743-4868ce71f55c /backup ext4 defaults 0 2
You can draw your own conclusions...
|
My fstab
Code:
# UUID <mount point> <type> <options> <dump> <pass>
UUID=bc3de0a4-933a-4880-a5cb-9b1b86ad495b /mnt/rootfs-data1 btrfs defaults,subvol=/ 0 2
UUID=bc3de0a4-933a-4880-a5cb-9b1b86ad495b /mnt/data1 btrfs defaults,subvol=/data 0 2
UUID=bc3de0a4-933a-4880-a5cb-9b1b86ad495b /mnt/snapraid-content/data1 btrfs defaults,subvol=/content 0 2
Your turn to draw conclusions.
------------------------------------------------------------
In any case, I attempted to use a loop device as a journal but could not get it to mount. It just says "unknown filesystem 'xfs_external_log'".
I don't know ¯\_(ツ)_/¯
I'm almost done setting up my system, so the time to play around for fun has kinda come to an end.
|
|
|
05-27-2023, 11:27 AM
|
#12
|
Senior Member
Registered: Apr 2003
Location: Germany
Distribution: openSuSE Tumbleweed-KDE, Mint 21, MX-21, Manjaro
Posts: 4,639
Rep: 
|
That's a tough one. I guess those are either equivalents or the @-variant is something like access to directories. Got no real clue here...
|
|
|
All times are GMT -5. The time now is 02:39 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|