LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 08-27-2017, 03:48 PM   #1
sim085
LQ Newbie
 
Registered: Aug 2017
Posts: 6

Rep: Reputation: Disabled
Format disk previously part of RAID setup


Hello, I got two disks that were previously part of a RAID setup. On my current setup I have no RAID so I just want to format and mount to move some files onto these disks.

What I did is the following:

Selected the disk using fdisk (fdisk /dev/sdc), deleted all partitions (d), created a new primary partition (n, p), changed the partition type to Linux (t, 83) and write the changes to disk (w).

This created partition /dev/sdc1. I can see this correctly when I use "fdisk -l".

However when I try to format the disk using the command "mkfs.ext4 /dev/sdc1" I get the error message "/dev/sdc1 is apparently in use by the system; will not make a filesystem here!".

What I find strange is that if I try to mount (mount /dev/sdc1 /media/backup) I get the error message "mount: unknown filesystem type 'linux_raid_member'".

Can someone help me?

How can I format these disks?
 
Old 08-27-2017, 04:24 PM   #2
wpeckham
Senior Member
 
Registered: Apr 2010
Location: Continental USA
Distribution: Debian, Ubuntu, Fedora, RedHat, DSL, Puppy, CentOS, Knoppix, Mint-DE, Sparky, Vsido, tinycore, Q4OS
Posts: 3,804

Rep: Reputation: 1728Reputation: 1728Reputation: 1728Reputation: 1728Reputation: 1728Reputation: 1728Reputation: 1728Reputation: 1728Reputation: 1728Reputation: 1728Reputation: 1728
I suspect that you were on the correct track. Use fdisk (Actually a recent version of gparted may be better) and create a DOS partition table, then define a partition type linux and write out the changes. Now reboot the machine. No, this is not reasonable or logical but I have seen it help before.

THEN, after the reboot, see if you can use mkfs to format the partition.

Couple of key points here:
1. do NOT just manipulate the partitions in the existing table, actually overwrite the partition table with a new one.
2. If the disk is too large, you may have issues with older programs or formats. You did not present information about what your base install consists of or the disk details.
3. on a very few disks I have had to scrub the disk (this can be done with dd, but there are programs that specifically take care of this) to remove all formatting and all partition table (as well as zapping the MBR space).
4. If that all fails, consider if you have a hardware mismatch or failure issue. Why were these retired from the raid array? If they are SMART drives, a diagnostic run may be in order.

Last edited by wpeckham; 08-27-2017 at 04:26 PM.
 
Old 08-27-2017, 05:44 PM   #3
jefro
Moderator
 
Registered: Mar 2008
Posts: 20,859

Rep: Reputation: 3386Reputation: 3386Reputation: 3386Reputation: 3386Reputation: 3386Reputation: 3386Reputation: 3386Reputation: 3386Reputation: 3386Reputation: 3386Reputation: 3386
You should be able to use raid tools. Hardware or software may make a difference in tools used.

"If all failed, you may try the powerful dd:

# dd if=/dev/zero of=$DEVICE bs=512 seek=$(( $(blockdev --getsz $DEVICE) - 1024 )) count=1024

"

https://www.systutorials.com/136711/...ures-on-linux/

Be sure you are on correct drive with dd.
 
Old 09-02-2017, 10:15 AM   #4
sim085
LQ Newbie
 
Registered: Aug 2017
Posts: 6

Original Poster
Rep: Reputation: Disabled
In the end I finished using dd, however now when I mount I get the following message:

[root@mylinux ~]# mount /dev/sdc1 /mnt/backup1/
mount: /dev/sdc1 is write-protected, mounting read-only
mount: wrong fs type, bad option, bad superblock on /dev/sdc1,
missing codepage or helper program, or other error

In some cases useful info is found in syslog - try
dmesg | tail or so.

I just used fdisk to create the partition. What did I miss?


Quote:
Originally Posted by jefro View Post
# dd if=/dev/zero of=/dev/sdc bs=512 seek=$(( $(blockdev --getsz $DEVICE) - 1024 )) count=1024
 
Old 09-02-2017, 10:20 AM   #5
wpeckham
Senior Member
 
Registered: Apr 2010
Location: Continental USA
Distribution: Debian, Ubuntu, Fedora, RedHat, DSL, Puppy, CentOS, Knoppix, Mint-DE, Sparky, Vsido, tinycore, Q4OS
Posts: 3,804

Rep: Reputation: 1728Reputation: 1728Reputation: 1728Reputation: 1728Reputation: 1728Reputation: 1728Reputation: 1728Reputation: 1728Reputation: 1728Reputation: 1728Reputation: 1728
After creating a partition, did you create a file system on the partition?
 
Old 09-03-2017, 05:47 PM   #6
sim085
LQ Newbie
 
Registered: Aug 2017
Posts: 6

Original Poster
Rep: Reputation: Disabled
I had forgot to do that. Now it works. Many thanks.

I just have one lat question on this; why do I get "WARNING: fdisk GPT support is currently new, and therefore in an experimental phase. Use at your own discretion." on one of the disks when I enter the command fdisk -l?

Quote:
Originally Posted by wpeckham View Post
After creating a partition, did you create a file system on the partition?
 
Old 09-03-2017, 08:23 PM   #7
wpeckham
Senior Member
 
Registered: Apr 2010
Location: Continental USA
Distribution: Debian, Ubuntu, Fedora, RedHat, DSL, Puppy, CentOS, Knoppix, Mint-DE, Sparky, Vsido, tinycore, Q4OS
Posts: 3,804

Rep: Reputation: 1728Reputation: 1728Reputation: 1728Reputation: 1728Reputation: 1728Reputation: 1728Reputation: 1728Reputation: 1728Reputation: 1728Reputation: 1728Reputation: 1728
Quote:
Originally Posted by sim085 View Post
I had forgot to do that. Now it works. Many thanks.

I just have one lat question on this; why do I get "WARNING: fdisk GPT support is currently new, and therefore in an experimental phase. Use at your own discretion." on one of the disks when I enter the command fdisk -l?
The traditional DOS style partition in use since IBM-DOS v1 and still in use today is MBR partition tables. GPT partition tables are the new format released by Microsoft and used by WinXP Pro 64-bit and later, and Windows Server 2003 SP1 and later. GPT became the base for and part of the UEFI definition, and is considered a successor partitioning format for Microsoft systems.

There is support for UEFI and GPT under recent versions of Linux, but the tools are not nearly as mature as those for MBR.

Personally, when I repartition a disk for Linux I always use MBR. There is noting wrong with using GPT, and for certain disks (LARGE ones) that you might want to partition in ways not supported by MBR there can be some significant advantage.

In this case you must have a GPT partition and the tool is letting you know that support for it in that tool is considered experimental. I would not worry about that much. If you can easily repartition using MBR I would, but if that is not convenient you can simply ignore that message.
 
Old 09-03-2017, 09:37 PM   #8
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 19,719

Rep: Reputation: 3550Reputation: 3550Reputation: 3550Reputation: 3550Reputation: 3550Reputation: 3550Reputation: 3550Reputation: 3550Reputation: 3550Reputation: 3550Reputation: 3550
Just an older version of fdisk - current version supports gpt fine.
FWIW, I always prefer gpt, it has several advantages not always appreciated.
 
Old 09-04-2017, 11:29 AM   #9
sim085
LQ Newbie
 
Registered: Aug 2017
Posts: 6

Original Poster
Rep: Reputation: Disabled
I get this message under /dev/sdc which is the drive which I dd'd and created a new partition using fdisk. Also I did the same proceedure on another disk (/dev/sdd) but that one doesn't show such a message.

Code:
...

Disk /dev/sdd: 1000.2 GB, 1000204886016 bytes, 1953525168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk label type: dos
Disk identifier: 0x7884bfa6

   Device Boot      Start         End      Blocks   Id  System
/dev/sdd1            2048  1953525167   976761560   83  Linux

Disk /dev/sdc: 1000.2 GB, 1000204886016 bytes, 1953525168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk label type: dos
Disk identifier: 0xad3f14c7

   Device Boot      Start         End      Blocks   Id  System
/dev/sdc1            2048  1953525167   976761560   83  Linux
WARNING: fdisk GPT support is currently new, and therefore in an experimental phase. Use at your own discretion.
Quote:
Originally Posted by wpeckham View Post
In this case you must have a GPT partition and the tool is letting you know that support for it in that tool is considered experimental. I would not worry about that much. If you can easily repartition using MBR I would, but if that is not convenient you can simply ignore that message.
 
Old 09-04-2017, 06:06 PM   #10
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 19,719

Rep: Reputation: 3550Reputation: 3550Reputation: 3550Reputation: 3550Reputation: 3550Reputation: 3550Reputation: 3550Reputation: 3550Reputation: 3550Reputation: 3550Reputation: 3550
Residual/random data that looks like gpt header. Easiest way to remove it (properly) is to use gdisk and zap the offending bits.
 
  


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
[SOLVED] Question about Raid disk format vdemuth Slackware 3 12-08-2012 02:54 AM
Create Single Disk Image from 5 disk RAID 5 setup? slimjim Linux - Software 3 12-13-2011 05:34 AM
System thinks disk is part of RAID adam999 Linux - Hardware 5 09-06-2009 08:35 AM
redhat - format and then re-mount 4tb raid 5 part. ? raf_iso Linux - Software 1 10-25-2007 06:29 AM
format part of disk/repartition? mrburrito00 Linux - Hardware 3 09-28-2002 01:26 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 11:39 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
Open Source Consulting | Domain Registration