1
$ sudo fdisk -l
Disk /dev/ram0: 64 MiB, 67108864 bytes, 131072 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

.. repeat this for ram1 - ram14, it's 1 stick of 8 GB DDR4 2400MHz RAM.

Disk /dev/ram15: 64 MiB, 67108864 bytes, 131072 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 /dev/sda: 1.8 TiB, 2000398934016 bytes, 3907029168 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 /dev/sdb: 111.8 GiB, 120034123776 bytes, 234441648 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
Disklabel type: dos
Disk identifier: 0xb33628b2

Device     Boot     Start       End   Sectors   Size Id Type
/dev/sdb1  *         2048 217886719 217884672 103.9G 83 Linux
/dev/sdb2       217888766 234440703  16551938   7.9G  5 Extended
/dev/sdb5       217888768 234440703  16551936   7.9G 82 Linux swap / Solaris

I mkdir'ed /mnt/hdd earlier.

$ sudo mount /dev/sda /mnt/hdd
mount: wrong fs type, bad option, bad superblock on /dev/sda,
       missing codepage or helper program, or other error

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

$ dmesg | tail
[    3.128350] input: HDA Intel PCH HDMI/DP,pcm=3 as /devices/pci0000:00/0000:00:1f.3/sound/card0/input12
[    3.128380] input: HDA Intel PCH HDMI/DP,pcm=7 as /devices/pci0000:00/0000:00:1f.3/sound/card0/input13
[    3.128413] input: HDA Intel PCH HDMI/DP,pcm=8 as /devices/pci0000:00/0000:00:1f.3/sound/card0/input14
[    3.134172] r8169 0000:01:00.0 enp1s0: link down
[    3.134200] r8169 0000:01:00.0 enp1s0: link down
[    3.135342] IPv6: ADDRCONF(NETDEV_UP): enp1s0: link is not ready
[    3.197717] cgroup: new mount options do not match the existing superblock, will be ignored
[    3.287237] random: nonblocking pool is initialized
[    5.927328] r8169 0000:01:00.0 enp1s0: link up
[    5.927336] IPv6: ADDRCONF(NETDEV_CHANGE): enp1s0: link becomes ready

I'd rather not wipe the entire thing as I haven't recently checked if there was anything on it (I believe not, haven't used the drive in years prior to installing it in my new server) but I'd like to take a peek just to be sure.

During the installation, it did acknowledge both drives as I had the option to install the OS and later put the boot (what'sitsname) on either. So far I've installed EVERYTHING on the SSD (/dev/sdb), but would like to move the generated files on the SSD to the HDD with a cronjob (I'll figure that out myself, primary goal is to be able to mount to the drive first).

To be clear:
/dev/sdb

  • Ubuntu Server 16.04
  • No other OS'es (wiped the previous ones when I installed the OS the first time, and had to reinstall a couple of times because of my fuckups)

/dev/sda

  • Has never been a bootdrive, was an external hard drive in an enclosure. I took it out of the enclosure and it's now an internal hard drive for my server.

How do I do this?

$ sudo parted -l
Error: /dev/sda: unrecognised disk label
Model: ATA WDC WD20EARX-00P (scsi)                                        
Disk /dev/sda: 2000GB
Sector size (logical/physical): 512B/4096B
Partition Table: unknown
Disk Flags: 

Model: ATA KINGSTON SV300S3 (scsi)
Disk /dev/sdb: 120GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Disk Flags: 

Number  Start   End    Size    Type      File system     Flags
 1      1049kB  112GB  112GB   primary   ext4            boot
 2      112GB   120GB  8475MB  extended
 5      112GB   120GB  8475MB  logical   linux-swap(v1)
muru
  • 197,895
  • 55
  • 485
  • 740
Diamundo
  • 149
  • If you are using Nautilus file manager the drive label will appear and you simply cluck on it to access directories. – WinEunuuchs2Unix Jan 31 '17 at 18:10
  • Ubuntu Server 16.04, meaning no GUI. – Diamundo Jan 31 '17 at 19:07
  • Can you post the output of sudo parted -l in the question? (this command should list the partition layout on your disks. I am interested sda. – Nick Sillito Jan 31 '17 at 21:31
  • Added it. Also, Partition Table: unknown. I guess there's the culprit? – Diamundo Jan 31 '17 at 21:38
  • You do not mount drives, but mount formatted partition(s). And you may have to set ownership & permissions to let you use it. http://ubuntuforums.org/showthread.php?t=1983336 Permissions example. http://askubuntu.com/questions/324705/first-full-backup-on-usb-permission-denied/324942#324942 I also suggest using gpt rather than the 35 year old MBR partitioning. But if you ever want Windows on gpt drive it can only be used for booting with UEFI. For data or Ubuntu gpt works.http://askubuntu.com/questions/629470/gpt-vs-mbr-why-not-mbr – oldfred Feb 02 '17 at 14:38

1 Answers1

0

Drives in external enclosures sometimes require reformatting either when put into an external enclosure, or if they're later removed from that same external enclosure. This has everything to do with the USB to SATA bridge card installed in the external enclosure.

To prove this, reinstall the drive back into the same external enclosure and see if its disk label and partition table are now recognizable. If they are recognizable, you'll have to reformat the drive when removed from the enclosure and reinstalled back into your server.

And as a side note... if you're having any ethernet problems... you'll want to replace the r8169 driver with r8168-dkms.


update: after reinstalling the drive into your server, use gparted to install a new (probably GPT) partition table, and then create your new partition. That will wipe out anything that is there and allow you to use the drive.

To make it automount at boot time, you'll need to edit /etc/fstab (sudo -H gedit /etc/fstab) and add a line similar to this example:

# mount ext4 disk
UUID=0C0F93CE58153D42  /media/your_username/My_Data  ext4  defaults   0   0

changing the UUID to the correct UUID for your disk (which can be found using sudo blkid). And changing the file system type from ext4 to something else, if it's not ext4. You may want/need to add some permissions/owner/group/mask identifiers... I'll let you research that on your own.

heynnema
  • 70,711
  • Hmm, that's a bummer. I was hoping I wouldn't have to take the drive out of the case as it's quite tight in there and I also taped it to the case (power connector wouldn't fit if I screwed it as intended by the case manufacturer...). Also why would I need a different ethernet driver? – Diamundo Feb 01 '17 at 09:09
  • The r8169 driver is buggy, and if you're getting ethernet disconnects or can't maintain a reliable connection, then you need the other driver. Regarding the disk drive... please let us know how it goes after you reinstall the drive into the case. – heynnema Feb 01 '17 at 14:12
  • Well I just took out the drive, hooked it up to the circuit that it was attached to in the enclosure, plugged in the power and usb cables and my windows laptop immediately says it's empty (no files on it). So I just put it back into the server and... Now what, exactly? (it's still /dev/sda). Also, I don't have ethernet problems (haven't encountered any yet, will be running a minecraft server so let's see how that goes connection-wise). – Diamundo Feb 01 '17 at 22:48
  • When it was in the external case, did you do a sudo parted -l and note if the disk label, and partition table, were recognized? That was gonna prove that it still worked in the case. If they were recognized, which it sounds like they were, and the system says it's empty, you can just reformat it when you put it back into the server. Please remember to vote/accept my answer(s) if it was helpful. – heynnema Feb 01 '17 at 23:41
  • When it was 'in' the external case (I really just hooked up the circuit, nothing more) I plugged it into my windows laptop, that said it was fine, and the drive was empty. So I then plugged it back into my server without the circuit. The question 'now what' was more intended to how to format, though I could also google that. And yes, I'll accept your answer when it's done, because after formatting i still need to mount it (preferably surviving a reboot or remounting after rebooting) :) – Diamundo Feb 02 '17 at 08:25
  • See the update to my answer. – heynnema Feb 02 '17 at 13:55
  • Even if correctly partitioned for Linux, then Windows will not see it. So checking in a Windows machine is probably not a good test. Some of the newer versions of Windows at least show partitions, but nothing more. And if LInux server, you do not want NTFS. NTFS will require Windows tools for maintenance like chkdsk. So unless dual booting with Windows do not use NTFS. – oldfred Feb 02 '17 at 16:23
  • @oldfred I changed my example fstab entry to ext4 – heynnema Feb 02 '17 at 16:58
  • 20.04 LTS tried command gksudo gedit /etc/fstab and got this: Command 'gksudo' not found, did you mean: – Jon Grah Aug 10 '22 at 04:14
  • @JonGrah use sudo -H gedit /etc/fstab – heynnema Aug 10 '22 at 12:27