LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
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


Reply
  Search this Thread
Old 05-06-2020, 11:09 AM   #1
piobair
Member
 
Registered: Aug 2013
Distribution: Debian, Ubuntu
Posts: 271

Rep: Reputation: Disabled
cannot recognize new HD


Adding a second hard drive (/dev/sdb) to Debian Stable
I partitioned the new drive using parted.
I have the following diagnostics:
Quote:
root@geeves:~# parted -l
Model: ATA Samsung SSD 840 (scsi)
Disk /dev/sda: 120GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Disk Flags:

Number Start End Size Type File system Flags
1 1049kB 111GB 111GB primary ext4 boot
2 111GB 120GB 8550MB extended
5 111GB 120GB 8550MB logical linux-swap(v1)


Model: ATA WDC WD2005FBYZ-0 (scsi)
Disk /dev/sdb: 2000GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags:

Number Start End Size File system Name Flags
1 1049kB 2000GB 2000GB primary


Warning: Unable to open /dev/sr0 read-write (Read-only file system). /dev/sr0
has been opened read-only.
Error: /dev/sr0: unrecognised disk label
Model: ATAPI iHAS124 W (scsi)
Disk /dev/sr0: 498MB
Sector size (logical/physical): 2048B/2048B
Partition Table: unknown
Disk Flags:

root@geeves:~# blkid
/dev/sda1: UUID="baba1d66-1d46-4fc8-a6ea-50135e908f3f" TYPE="ext4" PARTUUID="59d061e6-01"
/dev/sda5: UUID="bdf2e381-a31b-46b2-9487-e86affe9a201" TYPE="swap" PARTUUID="59d061e6-05"
/dev/sdb1: PARTLABEL="primary" PARTUUID="b2846836-477f-4a04-bfef-5b0250d81771"
root@geeves:~# cat /etc/fstab
# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point> <type> <options> <dump> <pass>
# / was on /dev/sda1 during installation
UUID=baba1d66-1d46-4fc8-a6ea-50135e908f3f / ext4 errors=remount-ro 0 1
# swap was on /dev/sda5 during installation
UUID=bdf2e381-a31b-46b2-9487-e86affe9a201 none swap sw
0 0

#UUID=5a30e832-43f0-4c0e-b72f-55db19970ba0 /common ext4 defaults 0 2 (dead HD)
UUID=b2846836-477f-4a04-bfef-5b0250d81771 /common ext4 defaults 0 2
/dev/sr1 /media/cdrom0 udf,iso9660 user,noauto 0 0
/dev/sr0 /media/cdrom1 udf,iso9660 user,noauto 0 0
Rebooting, the system says that it cannot recognize the new hard drive.

??
 
Old 05-06-2020, 11:19 AM   #2
berndbausch
LQ Addict
 
Registered: Nov 2013
Location: Tokyo
Distribution: Mostly Ubuntu and Centos
Posts: 6,316

Rep: Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002
You try to mount sdb1, but it has no filesystem.
 
Old 05-06-2020, 11:33 AM   #3
smallpond
Senior Member
 
Registered: Feb 2011
Location: Massachusetts, USA
Distribution: Fedora
Posts: 4,162

Rep: Reputation: 1268Reputation: 1268Reputation: 1268Reputation: 1268Reputation: 1268Reputation: 1268Reputation: 1268Reputation: 1268Reputation: 1268
You can either run
Code:
mkfs.ext4 /dev/sdb1
or for more flexibility, create a logical volume from part of the space and build the filesystem there. That lets you expand or move filesystems later as needed.
 
Old 05-06-2020, 11:47 AM   #4
piobair
Member
 
Registered: Aug 2013
Distribution: Debian, Ubuntu
Posts: 271

Original Poster
Rep: Reputation: Disabled
When I typed
Quote:
# mkfs -t ext4 /dev/sdb
the system responded:
Quote:
found a gpt partition table in /dev/sdb
Proceed anyway? (y,N)
??
 
Old 05-06-2020, 11:58 AM   #5
rnturn
Senior Member
 
Registered: Jan 2003
Location: Illinois (SW Chicago 'burbs)
Distribution: openSUSE, Raspbian, Slackware. Previous: MacOS, Red Hat, Coherent, Consensys SVR4.2, Tru64, Solaris
Posts: 2,820

Rep: Reputation: 550Reputation: 550Reputation: 550Reputation: 550Reputation: 550Reputation: 550
Quote:
Originally Posted by piobair View Post
When I typed

the system responded:


??
You have to create the filesystem on the partition -- /dev/sdbN (where N, presumably, == 1) -- and not on the entire drive.

HTH...
 
Old 05-06-2020, 02:34 PM   #6
piobair
Member
 
Registered: Aug 2013
Distribution: Debian, Ubuntu
Posts: 271

Original Poster
Rep: Reputation: Disabled
mkfs does not seem to work with the gpt file system.

I have tried
mkfs.ext4 /dev/sdb1
mkfs -t ext4 /dev/sdb

Both of those commands result in a corrupted file system.
 
Old 05-06-2020, 04:25 PM   #7
jefro
Moderator
 
Registered: Mar 2008
Posts: 22,023

Rep: Reputation: 3632Reputation: 3632Reputation: 3632Reputation: 3632Reputation: 3632Reputation: 3632Reputation: 3632Reputation: 3632Reputation: 3632Reputation: 3632Reputation: 3632
Any chance you have gparted available? Could your version of parted be old?
Does the motherboard fully support the size of disk you installed and does it show in bios correctly?
 
Old 05-06-2020, 05:44 PM   #8
berndbausch
LQ Addict
 
Registered: Nov 2013
Location: Tokyo
Distribution: Mostly Ubuntu and Centos
Posts: 6,316

Rep: Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002
Quote:
Originally Posted by piobair View Post
mkfs does not seem to work with the gpt file system.

I have tried
mkfs.ext4 /dev/sdb1
mkfs -t ext4 /dev/sdb

Both of those commands result in a corrupted file system.
GPT is a partitioning format, not a filesystem. And it's widely used. mkfs works very well with GPT disks.
How do you know it's corrupted?
 
Old 05-06-2020, 06:34 PM   #9
ehartman
Senior Member
 
Registered: Jul 2007
Location: Delft, The Netherlands
Distribution: Slackware
Posts: 1,674

Rep: Reputation: 888Reputation: 888Reputation: 888Reputation: 888Reputation: 888Reputation: 888Reputation: 888
Quote:
Originally Posted by piobair View Post
mkfs -t ext4 /dev/sdb

Both of those commands result in a corrupted file system.
The last one is wrong, you're formatting the whole disk again, not the partition, so overwriting all of the gpt info (which is in the beginning part of the disk, between block 1 and the start of the sdb1 partition itself).
Normally the first partition starts at about a MB (2048 blocks) from the beginning of the disk.
 
Old 05-06-2020, 07:20 PM   #10
piobair
Member
 
Registered: Aug 2013
Distribution: Debian, Ubuntu
Posts: 271

Original Poster
Rep: Reputation: Disabled
Problem solved:
I thank y'all for pointing me in the right direction.
Quote:
~# parted /dev/sdb
(parted) mklabel gpt
(parted) mkpart primary 0% 100%
(parted) q
~# mkfs -t ext4 /dev/sdb1
That gave me a page of error messages, which threw me off completely. However, it was successful.

Quote:
# /sbin/blkid
/dev/sda1: UUID="baba1d66-1d46-4fc8-a6ea-50135e908f3f" TYPE="ext4" PARTUUID="59d061e6-01"
/dev/sda5: UUID="bdf2e381-a31b-46b2-9487-e86affe9a201" TYPE="swap" PARTUUID="59d061e6-05"
/dev/sdb1: UUID="e23a4462-80d1-4430-b45e-bd300581250c" TYPE="ext4" PARTLABEL="primary" PARTUUID="a5a4c06b-5ebc-4acf-ab68-d19109bb72b1"
Then copy the "UUID=... " for /dev/sdb1 into fstab.
Success.

One minor problem: The directory (dolphin) lists the new drive as "primary", the alternative being "logical?". This could be confusing.
 
Old 05-06-2020, 08:15 PM   #11
berndbausch
LQ Addict
 
Registered: Nov 2013
Location: Tokyo
Distribution: Mostly Ubuntu and Centos
Posts: 6,316

Rep: Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002
Quote:
Originally Posted by piobair View Post
That gave me a page of error messages, which threw me off completely. However, it was successful.
It's great that your problem is solved. I strongly doubt these were error messages, though. If they were, you should not ignore them.
Quote:
One minor problem: The directory (dolphin) lists the new drive as "primary", the alternative being "logical?". This could be confusing.
I don't know if the concepts of primary and logical partitions make sense in the context of a GPT disk, but it is true that parted considers the partition primary, because you told it so:
Code:
(parted) mkpart primary 0% 100%
 
Old 05-06-2020, 08:42 PM   #12
piobair
Member
 
Registered: Aug 2013
Distribution: Debian, Ubuntu
Posts: 271

Original Poster
Rep: Reputation: Disabled
I was working command line at the time, and the messages had something to do with buffer overflow. Not terribly surprising, since the disk is about eight years younger than the motherboard.

The gpt system apparently allows for being subdivided into a very large number of logical disks. Given that GPT can allow for something like 1000 petabytes, that is not too surprising.

One thing that I learned in passing is that portable storage devices should probably be formatted with ext3 instead of ext4 if you are going to be shuttling that drive from one machine to another. Ext4 wants to re-mount to the previous user.

Quote:
Originally Posted by berndbausch View Post
It's great that your problem is solved. I strongly doubt these were error messages, though. If they were, you should not ignore them.

I don't know if the concepts of primary and logical partitions make sense in the context of a GPT disk, but it is true that parted considers the partition primary, because you told it so:
Code:
(parted) mkpart primary 0% 100%
 
  


Reply



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
DDD Cannot recognize executabe jonty_11 Programming 4 05-08-2012 09:13 PM
HELP: Cannot Configure CUPS to Recognize Parallel Printer Port as a Printing Device! glaucon829 Linux - Newbie 4 06-05-2007 09:38 AM
Cannot get wine to recognize my exiting windows installation jeep4wd Linux - Software 3 08-10-2005 09:31 PM
Cannot get Mozilla to recognize Java plugin DoThatPlan Linux - Software 2 09-09-2004 01:11 PM
lspci detects network card, but ifconfig cannot recognize it veritas Linux - Networking 1 03-03-2004 05:38 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware

All times are GMT -5. The time now is 09:31 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