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
  • 207,228
Diamundo
  • 149
  • 1
  • 4
  • 13

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
  • 73,649