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

Notices


Reply
  Search this Thread
Old 03-04-2016, 03:39 PM   #1
Didier Spaier
LQ Addict
 
Registered: Nov 2008
Location: Paris, France
Distribution: Slint64-14.2.1 on Lenovo Thinkpad W520
Posts: 8,492

Rep: Reputation: 3242Reputation: 3242Reputation: 3242Reputation: 3242Reputation: 3242Reputation: 3242Reputation: 3242Reputation: 3242Reputation: 3242Reputation: 3242Reputation: 3242
The installer can't put a btrfs file system in a partition that already contains a file system.


This could be a follow-up of this thread:
http://www.linuxquestions.org/questi...le-4175552433/

Test made with an ISO built from Slackware64-current as of Thu Mar 3 20:05:41 UTC 2016.

When trying to use a partition that already contains a file system as target, if btrfs is chosen to format it this fails with an error message from mkfs.btrfs like e.g.
"/dev/sda2 appears to contain an existing file system (ext4)
use the -f option to force overwrite".

Easy fix:
sed -i "s/mkfs.btrfs/mkfs.btrfs -f/" /usr/lib/setup/SeTpartitions

With the fix applied blkid confirms that the partition contains a btrfs file system.

I assume that if the user wants to format to btrfs another partition (for /home, for instance) the -f option is still needed.


However lilo fails when / contains a btrfs file system, but that's a known issue and not the point here.

Last edited by Didier Spaier; 03-04-2016 at 04:02 PM.
 
Old 03-05-2016, 10:39 AM   #2
ReaperX7
LQ Guru
 
Registered: Jul 2011
Location: California
Distribution: Slackware64-Current
Posts: 6,438
Blog Entries: 15

Rep: Reputation: 2005Reputation: 2005Reputation: 2005Reputation: 2005Reputation: 2005Reputation: 2005Reputation: 2005Reputation: 2005Reputation: 2005Reputation: 2005Reputation: 2005
When I installed 14.2-beta to btrfs I had to precreate a btrfs partition using mkfs.btrfs prior to launching the installer. When I tried using the installer, formatting to btrfs only ended up with an existing ext4 or jfs file system being left as-is from a previous format, even after destroying the table with gdisk, all it would format under is ext4, even with the table cleared. Not certain if related...

The latest kernels allows for better accessibility of the /dev mountpoint for devtmpfs with Grub, so the legacy detection method proposed in a patch from Debian I submitted for usage with gpt partitions and btrfs as /(root) is unnecessary, for now hopefully.

Formatting with btrfs as /(root) with a separate /boot partition with a standard msdos partition table with fdisk does work, gpt does not however, even with a bios boot partition. If you use gpt and btrfs as /(root), you will need syslinux or grub.
 
Old 03-05-2016, 10:58 AM   #3
Didier Spaier
LQ Addict
 
Registered: Nov 2008
Location: Paris, France
Distribution: Slint64-14.2.1 on Lenovo Thinkpad W520
Posts: 8,492

Original Poster
Rep: Reputation: 3242Reputation: 3242Reputation: 3242Reputation: 3242Reputation: 3242Reputation: 3242Reputation: 3242Reputation: 3242Reputation: 3242Reputation: 3242Reputation: 3242
Quote:
Originally Posted by ReaperX7 View Post
When I tried using the installer, formatting to btrfs only ended up with an existing ext4 or jfs file system being left as-is from a previous format, even after destroying the table with gdisk, all it would format under is ext4, even with the table cleared. Not certain if related...
Probably. A quick look to the logs of the installer (Alt+F4) would have told you.

PS I don't quite get you. If by 'the table has been cleared" you mean "no partition left" how could the installer work? It needs at least one partition of type Linux[1] as target for installation.

Quote:
If you use gpt and btrfs as /(root), you will need syslinux or grub.
As written in my previous post that's a known issue. But without a separate partition for /boot it's easy to install grub just after installation and before rebooting: just insure that the root partition be still mounted as /mnt or mount it again, bind mount /dev, /sys and /proc, chroot /mnt and install grub, then reboot.

[1]It could use a partition of type "Microsft basic data" (at least to put an ext4 file system in it, I must admit that I didn't check if it's also possible to equip this type of partition with another Linux file system) but doesn't work that way as is.

Last edited by Didier Spaier; 03-05-2016 at 11:15 AM. Reason: Note [1] added.
 
Old 03-05-2016, 11:39 AM   #4
ReaperX7
LQ Guru
 
Registered: Jul 2011
Location: California
Distribution: Slackware64-Current
Posts: 6,438
Blog Entries: 15

Rep: Reputation: 2005Reputation: 2005Reputation: 2005Reputation: 2005Reputation: 2005Reputation: 2005Reputation: 2005Reputation: 2005Reputation: 2005Reputation: 2005Reputation: 2005
When I recreated the table and used an 8300 type Linux partition, a freshly made one, selecting btrfs only used ext4. If I didn't destroy the table and only recreated a partition it would not reformat but would leave the existing ext4, jfs, or other existing partition as-is.

I kinda thought that would have been picked up without being said directly.
 
Old 03-05-2016, 12:59 PM   #5
Didier Spaier
LQ Addict
 
Registered: Nov 2008
Location: Paris, France
Distribution: Slint64-14.2.1 on Lenovo Thinkpad W520
Posts: 8,492

Original Poster
Rep: Reputation: 3242Reputation: 3242Reputation: 3242Reputation: 3242Reputation: 3242Reputation: 3242Reputation: 3242Reputation: 3242Reputation: 3242Reputation: 3242Reputation: 3242
Quote:
Originally Posted by ReaperX7 View Post
I kinda thought that would have been picked up without being said directly.
Would that had been crystal clear in my small mind I wouldn't have requested you to elaborate, sorry if that bothered you.

Now I made some more tests and here are my findings.

Even if you really wipe out the GUID partition table and blank out the master boot record with gdisk (typing x to switch to the expert menu then z for zap), you do not destroy the file system: for instance blkid still reports the type "ext4". When I recreate a partition table with gdisk (still using the whole device), blkid still reports ext4. and when running setup at the TARGET step, so does mkfs.btrfs.

So, I didn't find a way to reuse a device with a wiped then recreated partition table that has contained a file system to put a btrfs file system in it unless using the -f option of mkfs.btrfs.

It could probably be done zeroing the whole device's content with dd, but I guess that most users would not want to do that.

Last edited by Didier Spaier; 03-05-2016 at 03:31 PM. Reason: Wrong word corrected.
 
1 members found this post helpful.
Old 03-05-2016, 07:33 PM   #6
ReaperX7
LQ Guru
 
Registered: Jul 2011
Location: California
Distribution: Slackware64-Current
Posts: 6,438
Blog Entries: 15

Rep: Reputation: 2005Reputation: 2005Reputation: 2005Reputation: 2005Reputation: 2005Reputation: 2005Reputation: 2005Reputation: 2005Reputation: 2005Reputation: 2005Reputation: 2005
I'm a bit surprised that option -f isn't used either by default, or via an optional dialog output that tries to run mkfs.btrfs, for example, fails, returns with information of an existing file system, then asks a yes/no if you want to destroy the file system and rebuilt it with the -f option.

Has this always been the behavior of mkfs.btrfs, because I don't remember it being this problematic.
 
Old 03-11-2016, 01:13 PM   #7
Didier Spaier
LQ Addict
 
Registered: Nov 2008
Location: Paris, France
Distribution: Slint64-14.2.1 on Lenovo Thinkpad W520
Posts: 8,492

Original Poster
Rep: Reputation: 3242Reputation: 3242Reputation: 3242Reputation: 3242Reputation: 3242Reputation: 3242Reputation: 3242Reputation: 3242Reputation: 3242Reputation: 3242Reputation: 3242
Fixed in Current since Thu Mar 10 23:43:47 UTC 2016.

I mark this thread as [SOLVED]
 
  


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
installation on btrfs file system is not possible Andrey@ Slackware - Installation 5 09-03-2015 07:00 AM
LXer: B Tree File System (BTRFS) LXer Syndicated Linux News 0 08-17-2013 03:13 AM
BTRFS system file zanier Linux - General 2 07-24-2012 09:21 AM
BTRFS file system zanier Linux - Kernel 3 05-27-2012 04:54 PM
LXer: The Btrfs file system LXer Syndicated Linux News 0 07-17-2009 02:00 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 02:57 AM.

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