0

I just installed Debian but I had some problem during the installation. I first installed my OS on HDD cause I wanted a dualboot with Windows (which WAS located on the SSD) but I couldn't complete it so I decided to say goodbye to Windows and install Debian it again on SSD.

Now in my desktop I can see both hard drives but I can't mount the HDD.

I'll paste some relevant information:

$ sudo fdisk -l Disk /dev/sdb: 89.4 GiB, 96029466624 bytes, 187557552 sectors Disk model: KINGSTON RBU-SNS 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: 0x34f08e2e Device Boot Start End Sectors Size Id Type /dev/sdb1 * 2048 185556991 185554944 88.5G 83 Linux /dev/sdb2 185559038 187555839 1996802 975M 5 Extended /dev/sdb5 185559040 187555839 1996800 975M 82 Linux swap / Solaris Disk /dev/sda: 931.5 GiB, 1000204886016 bytes, 1953525168 sectors Disk model: ST1000LM024 HN-M Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 4096 bytes I/O size (minimum/optimal): 4096 bytes / 4096 bytes Disklabel type: dos Disk identifier: 0x55786839 Device Boot Start End Sectors Size Id Type /dev/sda1 2048 1951522815 1951520768 930.6G 83 Linux /dev/sda2 1951524862 1953523711 1998850 976M 5 Extended /dev/sda5 1951524864 1953523711 1998848 976M 82 Linux swap / Solaris Partition 2 does not start on physical sector boundary. 

The drive I'm trying to access is /dev/sda

$ df -h Filesystem Size Used Avail Use% Mounted on udev 5.8G 0 5.8G 0% /dev tmpfs 1.2G 9.4M 1.2G 1% /run /dev/sdb1 87G 5.4G 77G 7% / tmpfs 5.9G 60M 5.8G 1% /dev/shm tmpfs 5.0M 4.0K 5.0M 1% /run/lock tmpfs 5.9G 0 5.9G 0% /sys/fs/cgroup tmpfs 1.2G 20K 1.2G 1% /run/user/1000 

Here's what I tried:

~$ sudo fsck.ext4 -f /dev/sda e2fsck 1.44.5 (15-Dec-2018) ext2fs_open2: Bad magic number in super-block fsck.ext4: Superblock invalid, trying backup blocks... fsck.ext4: Bad magic number in super-block while trying to open /dev/sda The superblock could not be read or does not describe a valid ext2/ext3/ext4 filesystem. If the device is valid and it really contains an ext2/ext3/ext4 filesystem (and not swap or ufs or something else), then the superblock is corrupt, and you might try running e2fsck with an alternate superblock: e2fsck -b 8193 <device> or e2fsck -b 32768 <device> Found a dos partition table in /dev/sda ~$ sudo resize2fs /dev/sda 8193 resize2fs 1.44.5 (15-Dec-2018) resize2fs: Bad magic number in super-block while trying to open /dev/sda Couldn't find valid filesystem superblock. ~$ sudo resize2fs /dev/sda 32768 resize2fs 1.44.5 (15-Dec-2018) resize2fs: Bad magic number in super-block while trying to open /dev/sda Couldn't find valid filesystem superblock. 

inside mount output I fount the other drive infos:

/dev/sdb1 on / type ext4 (rw,relatime,errors=remount-ro) 

So I wrote:

sudo mount /dev/sda1 / 

And the hard disk icon on my desktop disappeared. After a reboot everything's back as it was, I can see the icon, I can't access the driver. If I click on the Icon:

Failed to mount "999 GB Volume" Not authorized to perform operation

Please help

2
  • 2
    I think you should not mount the hard drive to /. You should make a directory in your directory structure and mount a hard drive there. Like this: sudo mkdir /hdd; sudo mount /dev/sda1 /hdd. You will have the contents of your hard drive in /hdd folder then. Read this: redhat.com/sysadmin/linux-filesystem-windows. Commented Mar 9, 2021 at 11:28
  • If you have a bad superblock you might need to restore the superblock from a different inode. This explains how to do that: linuxexpresso.wordpress.com/2010/03/31/… Commented Mar 9, 2021 at 11:43

1 Answer 1

0

Since you just installed Debian and have no important data on this computer, I guess you can experience and afford to make mistakes. You don't understand filesystems and mounting at all, and this is your chance to learn about it.

First, /dev/sda is partitioned. According to your fdisk output, the partitions are

/dev/sda1 2048 1951522815 1951520768 930.6G 83 Linux /dev/sda2 1951524862 1953523711 1998850 976M 5 Extended /dev/sda5 1951524864 1953523711 1998848 976M 82 Linux swap / Solaris 

I guess that /dev/sda1 has already been formatted as a filesystem. To be certain, and if there is nothing worth keeping on that disk, you can create a filesystem yourself:

mkfs -t ext4 /dev/sda1 

If /dev/sda1 contains a filesystem already, the command will complain, since it doesn't want overwrite potentially important data. You can force mkfs to overwrite data, but I'd say to leave it if you get complaints.

Next, to use the filesystem, you must mount it. Mounting means integrating a separate filesystem in your existing filesystem tree. To do that, you need a so-called mount point. You create a directory, for example /mnt/data, which will be your mount point. It should be empty, since mounting a filesystem will hide (though not remove) all files and directories that exist in the mount point. Therefore, try this:

mkdir /mnt/data mount /dev/sda1 /mnt/data 

Now it's mounted, and the df command will list it. You can cd /mnt/data and create files and directories. Whatever you create under /mnt/data will reside on /dev/sda1 (as long as it's mounted).

5
  • ~$ sudo mksf -t ext4 /dev/sda1 --> sudo: mksf: command not found ||| I installed xfsprogs packets but I still cant run the command, what should I install more to run it? Commented Mar 9, 2021 at 12:57
  • No need to install anything. Just find the typo. By the way, xfsprog is for XFS filesystems, not ext4. Commented Mar 9, 2021 at 13:11
  • Your method mounted the hard-disk at first but I can't see the disk on the desktop anymore after that. Futhermore after a reboot every change went discarded and I see the disk again "not mounted" on the desktop Commented Mar 9, 2021 at 13:36
  • If you mount at /mnt/data or /hdd you have to start & / & look for the folders. It will not be shown automatically in file browser. You can also mount into /home, if desired but must unmount any other mount first. You may also have to give yourself ownership & permissions. askubuntu.com/questions/1013677/… & askubuntu.com/questions/1058756/… Commented Mar 9, 2021 at 13:50
  • I can't comment on the desktop. However, it is true that a manual mount will be forgotten at reboot. One method of making a mount persistent is putting it into the /etc/fstab file. I don't know if your desktop has ways to do that, or perhaps it may use other methods to achieve persistence. Commented Mar 9, 2021 at 14:42

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.