LinuxQuestions.org
Visit Jeremy's Blog.
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 08-01-2020, 06:32 AM   #1
vectrum
Member
 
Registered: Jul 2011
Posts: 80

Rep: Reputation: Disabled
How to create ext4 file system in a partition that was formatted with freeBSD file system(freebsd-ufs)


I want to create a ext4 file system from my slackware 14.2 into partition that was formatted with FreeBSD file system (freebsd-ufs).

I tried the following;
# mkfs -t ext4 /dev/sdb2 but got the message that says something like "It is freebsd ufs partitio. Are you sure to proceed?

Could you please tell me the steps to create and format the partition with slackware 14.2 ext4 file system?

Thank you.
 
Old 08-01-2020, 07:19 AM   #2
hazel
Senior Member
 
Registered: Mar 2016
Location: Harrow, UK
Distribution: LFS, AntiX, Slackware
Posts: 4,487
Blog Entries: 11

Rep: Reputation: 2570Reputation: 2570Reputation: 2570Reputation: 2570Reputation: 2570Reputation: 2570Reputation: 2570Reputation: 2570Reputation: 2570Reputation: 2570Reputation: 2570
Why not just say yes and see what happens?

Probably the program is just being careful, since an already formatted disk might well contain important data that you would not actually wish to overwrite. It is rather easy when using a program like mkfs to give the wrong device name, so this kind of double-checking could prevent a very nasty accident!
 
4 members found this post helpful.
Old 08-01-2020, 08:16 AM   #3
jr_bob_dobbs
Member
 
Registered: Mar 2009
Distribution: Slackware,Linux From Scratch
Posts: 450
Blog Entries: 66

Rep: Reputation: 80
short answer
This is normal. What hazel said is 100% correct.

longer answer
Having been a distro-hopper for years, I do a lot of reformatting, so I know that mke2fs (which is what mkfs will call when given a file system type of ext2, ext3 or ext4) will check the partition for an existing filesystem and will prompt for confirmation if it finds one that it recognizes, as it did for you.

p.s. Your caution is wise and it is always good to double-check when one is uncertain as to how a potentially damage-dealing command works.
 
2 members found this post helpful.
Old 08-01-2020, 09:37 AM   #4
fatmac
Senior Member
 
Registered: Sep 2011
Location: Upper Hale, Surrey/Hants Border, UK
Posts: 3,684

Rep: Reputation: Disabled
Use a disk partition program to change its type - then format it.
 
1 members found this post helpful.
Old 08-01-2020, 11:07 AM   #5
FTIO
Member
 
Registered: Mar 2015
Location: Las Vegas, NV
Distribution: Slackware 14.1_32
Posts: 338

Rep: Reputation: 188Reputation: 188
gparted works well.
 
2 members found this post helpful.
Old 08-01-2020, 02:16 PM   #6
enorbet
Senior Member
 
Registered: Jun 2003
Location: Virginia
Distribution: Slackware = Main OpSys
Posts: 2,952

Rep: Reputation: 3004Reputation: 3004Reputation: 3004Reputation: 3004Reputation: 3004Reputation: 3004Reputation: 3004Reputation: 3004Reputation: 3004Reputation: 3004Reputation: 3004
Quote:
Originally Posted by FTIO View Post
gparted works well.
It most certainly does, but it has it's similar warnings as well. Hazel is correct. Potentially irreversible, dangerous programs should warn and ask and so should those people running them. As Davy Crockett said, according to Disney Studios , "Be sure you're right, then go ahead".
 
Old 08-01-2020, 03:05 PM   #7
upnort
Senior Member
 
Registered: Oct 2014
Distribution: Slackware, Proxmox, Debian, CentOS
Posts: 1,639

Rep: Reputation: 972Reputation: 972Reputation: 972Reputation: 972Reputation: 972Reputation: 972Reputation: 972Reputation: 972
Quote:
I tried the following;
# mkfs -t ext4 /dev/sdb2 but got the message that says something like "It is freebsd ufs partitio. Are you sure to proceed?
"Do I feel lucky? Well, do ya, punk?"
"Go ahead, make my day."
"...you gotta get mean. I mean plumb, mad-dog mean."
"Clockís ticking, Bob. And Iím only getting older."
"Anyone gets hit, sing out. Slap iron to it. Itís the fastest way to stop the blood."
"Improvise, Adapt and Overcome."
"I have a feeling itís really gonna be a good, long battle."
"If you want a guarantee, buy a toaster."
"Everybody's got a right to be a sucker Ö once."
"Wake me up if we crash into the mountain. I wouldn't want to miss that."

 
Old 08-01-2020, 06:15 PM   #8
Darville
LQ Newbie
 
Registered: Mar 2019
Posts: 2

Rep: Reputation: 1
Quote:
Originally Posted by upnort View Post
"Do I feel lucky? Well, do ya, punk?"
Are you gonna pull those pistols or whistle Dixie?

Nothing like a good piece of hickory.
 
Old 08-01-2020, 06:59 PM   #9
thirdm
Member
 
Registered: May 2013
Location: Massachusetts
Distribution: Slackware, OpenBSD, NetBSD
Posts: 192

Rep: Reputation: Disabled
I haven't used FreeBSD, but in general on BSDs partitioning is done differently. At the toplevel you have the usual concept of mbr (or GPT) partitions and you start by creating one of those for your BSD system. But next you (or your install program) run disklabel which subdivides that outer partition (what the BSD people call a slice) into BSD partitions.

I happen to be on my netbsd system now, so I can show you. Here are the slices (what you linux people call partitions):

Code:
BIOS disk geometry:
cylinders: 1022, heads: 255, sectors/track: 63 (16065 sectors/cylinder)
total sectors: 1465149168

Partitions aligned to 16065 sector boundaries, offset 63

Partition table:
0: NetBSD (sysid 169)
    start 4096, size 20983809 (10246 MB, Cyls 0/65/2-1306/111/22), Active
1: Extended partition (sysid 5)
    start 20989950, size 884762626 (432013 MB, Cyls 1306/143/52-56380/125/1)
2: Linux native (sysid 131)
    start 970983424, size 408067065 (199251 MB, Cyls 60440/235/20-85841/235/19)
        PBR is not bootable: All bytes are identical (0x00)
3: Linux native (sysid 131)
    start 1379051520, size 41039872 (20039 MB, Cyls 85841/251/43-88396/153/13), Active
Extended partition table:
E0: Linux native (sysid 131)
    start 20989952, size 585934848 (286101 MB, Cyls 1306/143/54-37779/81/62)
        PBR is not bootable: All bytes are identical (0x00)
E1: Linux swap or Prime or Solaris (sysid 130)
    start 606926848, size 5857280 (2860 MB, Cyls 37779/114/32-38144/12/12)
        PBR is not bootable: All bytes are identical (0x00)
E2: NetBSD (sysid 169)
    start 612786176, size 228589568 (111616 MB, Cyls 38144/44/45-52373/55/34)
        PBR is not bootable: All bytes are identical (0x00)
E3: NetBSD (sysid 169)
    start 841375807, size 1044225 (510 MB, Cyls 52373/55/35-52438/56/34)
        PBR is not bootable: Bad magic number (0x500f)
E4: Linux native (sysid 131)
    start 842420095, size 2104515 (1028 MB, Cyls 52438/56/35-52569/57/34)
        PBR is not bootable: All bytes are identical (0x00)
E5: Linux native (sysid 131)
    start 844524673, size 41945715 (20481 MB, Cyls 52569/57/35-55180/58/34)
        PBR is not bootable: All bytes are identical (0x00)
First active partition: 0
I know, and my room is a mess too. What can I say, this machine has evolved in strange ways as I change my mind about what to run.

Here is the netbsd disklabel that inhabits an early sector of partition 0 (I lied a bit above, in fact the disklabel, though it can have many bsd partitions within one mbr partition (slice), it can also map the sector ranges where the regular mbr/linux partitions live so you can mount those with bsd's ext2/4 compatible mount utility:
Code:
14 partitions:
#        size    offset     fstype [fsize bsize cpg/sgs]
 a:   1843200      4096     4.2BSD      0     0     0  # (Cyl.      4*-   1832*)
 b:   8105984   1847360        cgd                     # (Cyl.   1832*-   9874*)
 c:  20983809      4096     unused      0     0        # (Cyl.      4*-  20821*)
 d: 1465149168         0     unused      0     0        # (Cyl.      0 - 1453520)
 e:   9986049   9953408     4.2BSD      0     0     0  # (Cyl.   9874*-  19781*)
 f:   1048385  19939520     4.2BSD      0     0     0  # (Cyl.  19781*-  20821*)
 g: 408067065 970983424 Linux Ext2      0     0        # (Cyl. 963277*- 1368105*)
 h:  41039872 1379051520 Linux Ext2      0     0        # (Cyl. 1368106*- 1408820*)
 i: 585934848  20989952 Linux Ext2      0     0        # (Cyl.  20823*- 602107*)
 j:   5857280 606926848       swap                     # (Cyl. 602109*- 607920*)
 k: 228589568 612786176     4.2BSD   1024  8192    16  # (Cyl. 607922*- 834698*)
 l:   1044225 841375807     4.2BSD   1024  8192    16  # (Cyl. 834698*- 835734*)
 m:   2104515 842420095 Linux Ext2      0     0        # (Cyl. 835734*- 837822*)
 n:  41945715 844524673 Linux Ext2      0     0        # (Cyl. 837822*- 879434*)
And again, I am a programmer (scripter really) not a sysadmin so don't be too critical about my crazy layout.

Well and proper for gparted to imply you're crazy. Aside from the partition type being wrong for the kind of filesystem you want to create it's possible that making a filesystem on an mbr or gpt partition holding bsd stuff (i.e. a bsd slice) would overwrite several bsd partitions. That's worth a warning fer sure.

Last edited by thirdm; 08-01-2020 at 07:03 PM. Reason: missing letter, wrong letter
 
2 members found this post helpful.
Old 08-02-2020, 01:56 AM   #10
vectrum
Member
 
Registered: Jul 2011
Posts: 80

Original Poster
Rep: Reputation: Disabled
Solved

Quote:
Originally Posted by hazel View Post
Why not just say yes and see what happens?

Probably the program is just being careful, since an already formatted disk might well contain important data that you would not actually wish to overwrite. It is rather easy when using a program like mkfs to give the wrong device name, so this kind of double-checking could prevent a very nasty accident!
Yes, I did and it worked. Thanks to all. Thank you hazel.
 
Old 08-02-2020, 02:24 AM   #11
hazel
Senior Member
 
Registered: Mar 2016
Location: Harrow, UK
Distribution: LFS, AntiX, Slackware
Posts: 4,487
Blog Entries: 11

Rep: Reputation: 2570Reputation: 2570Reputation: 2570Reputation: 2570Reputation: 2570Reputation: 2570Reputation: 2570Reputation: 2570Reputation: 2570Reputation: 2570Reputation: 2570
Quote:
Originally Posted by thirdm View Post
I haven't used FreeBSD, but in general on BSDs partitioning is done differently. At the toplevel you have the usual concept of mbr (or GPT) partitions and you start by creating one of those for your BSD system. But next you (or your install program) run disklabel which subdivides that outer partition (what the BSD people call a slice) into BSD partitions...

Well and proper for gparted to imply you're crazy. Aside from the partition type being wrong for the kind of filesystem you want to create it's possible that making a filesystem on an mbr or gpt partition holding bsd stuff (i.e. a bsd slice) would overwrite several bsd partitions. That's worth a warning fer sure.
Mkfs is a Linux program, so its idea of a partition is an mbr partition or "slice". It wouldn't even recognise the internal bsd partitions; to clear one of those while leaving the others, you'd have to work within bsd. If you run mkfs in Linux, the entire bsd slice gets overwritten with a new Linux file system whose superblock will replace the bsd disklabel. But I gather that's what the OP wanted to do.
 
1 members found this post helpful.
  


Reply

Tags
ext4, freebsd, slackware 14.2


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
Need help recovering formatted LUKS Ext4 partition ridgek_lives Linux - General 4 10-02-2013 01:27 AM
UFS write support enabled in kernel, but UFS partition mouted as read only sguerrini97 Linux - Software 1 02-02-2013 03:37 AM
[SOLVED] crazy partition puzzle (ext4+ntfs+ufs) deswarf *BSD 2 11-26-2012 07:38 AM
[SOLVED] Just formatted partition (ext4) is 5.4% used!? 512upload Ubuntu 16 11-14-2010 11:00 AM
Trouble mounting external usb hard drive ufs formatted hexstar Linux - Hardware 1 05-24-2007 04:13 PM

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

All times are GMT -5. The time now is 10:33 PM.

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
Open Source Consulting | Domain Registration