View previous topic :: View next topic |
Author |
Message |
chilos n00b
Joined: 02 Mar 2018 Posts: 19
|
Posted: Sat Mar 10, 2018 5:11 am Post subject: Failed to mount /dev/sda4 |
|
|
Hey, guys. I tried installing gentoo according to the amd64 handbook and I screwed it up. So, I went back to the section with the partitions and remade all my partitions (this time with the mklabel msdos instead of gpt). I thought this might solve my problem. But, now, I am able to mount the other partitions, but not my root partition (/dev/sda4).
when I enter:
#mount /dev/sda4 /mnt/gentoo
It gives me an error: "failed to mount '/dev/sda4' invalid argument."
Any help?
I thought reformatting the drives would give me a clean slate.
-chilos
edit:
I also tried the system rescue cd before reformatting the drives (again) and it hung up on mounting /dev/sda4 as well. |
|
Back to top |
|
|
NeddySeagoon Administrator
Joined: 05 Jul 2003 Posts: 54220 Location: 56N 3W
|
Posted: Sat Mar 10, 2018 12:28 pm Post subject: |
|
|
chilos,
What does show ? _________________ Regards,
NeddySeagoon
Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail. |
|
Back to top |
|
|
chilos n00b
Joined: 02 Mar 2018 Posts: 19
|
Posted: Sat Mar 10, 2018 9:38 pm Post subject: |
|
|
It shows my four partitions with a star for boot next to the /dev/sda2 partition. The type for all 4 partitions is 'Linux'. The id for all four is 83. The partition sizes are 2 M, 128 M, 512 M, and 465.1 G respectively. The first line says: "Disk /dev/sda: 465.8 GiB, 500107862016 bytes, 976773168 sectors."
I can take a picture if this doesn't suffice. |
|
Back to top |
|
|
NeddySeagoon Administrator
Joined: 05 Jul 2003 Posts: 54220 Location: 56N 3W
|
Posted: Sat Mar 10, 2018 9:56 pm Post subject: |
|
|
chilos,
I prefer the link you get from Code: | wgetpaste -c 'fdisk -l /dev/sda' | as I can't copy and paste from a picture.
What you posted sounds correct.
Do you have a /dev/sda4 ?
What does show.
The ? in the command is a wildcard for any one symbol. _________________ Regards,
NeddySeagoon
Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail. |
|
Back to top |
|
|
chilos n00b
Joined: 02 Mar 2018 Posts: 19
|
|
Back to top |
|
|
NeddySeagoon Administrator
Joined: 05 Jul 2003 Posts: 54220 Location: 56N 3W
|
Posted: Sun Mar 11, 2018 12:19 am Post subject: |
|
|
chilos,
That all looks good. What are the permissions on sda4 ?
will show it.
It should be Code: | $ ls -l /dev/sda4
brw-rw---- 1 root disk 8, 4 May 12 2013 /dev/sda4 |
What filesystem type did you make on /dev/sda4 ? _________________ Regards,
NeddySeagoon
Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail. |
|
Back to top |
|
|
chilos n00b
Joined: 02 Mar 2018 Posts: 19
|
Posted: Sun Mar 11, 2018 1:39 am Post subject: |
|
|
yields:
Code: | brw-rw---- 1 root disk 8, 4 Mar 11 01:37 /dev/sda4 |
Looks good, right? What else could it be? |
|
Back to top |
|
|
grumblebear Apprentice
Joined: 26 Feb 2008 Posts: 202
|
Posted: Sun Mar 11, 2018 2:06 am Post subject: |
|
|
Did you forget to create the mountpoint?
mkdir -p /mnt/gentoo
Also, you have to create a filesystem (with mkfs) on the /dev/sda4 partition before trying to mount it. |
|
Back to top |
|
|
chilos n00b
Joined: 02 Mar 2018 Posts: 19
|
Posted: Sun Mar 11, 2018 3:09 am Post subject: |
|
|
I believe I have the mount point already (I have a /mnt/gentoo directory already--is that it?). My /dev/sda4 has a ext4 file system. |
|
Back to top |
|
|
NeddySeagoon Administrator
Joined: 05 Jul 2003 Posts: 54220 Location: 56N 3W
|
Posted: Sun Mar 11, 2018 11:42 am Post subject: |
|
|
chilos,
That's all the right answers so far.
What does Code: | mount -t ext4 /dev/sda4 /mnt/gentoo | tell?
Look at the end of too.
If that mount fails, what does
Do not run that command if the mount works. _________________ Regards,
NeddySeagoon
Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail. |
|
Back to top |
|
|
C5ace Guru
Joined: 23 Dec 2013 Posts: 472 Location: Brisbane, Australia
|
Posted: Sun Mar 11, 2018 12:00 pm Post subject: |
|
|
I had a similar problem when changing from gtp to msdos partitions. My solution was to to run overnight.
Code: |
dd if=/dev/zero of=/dev/sda bs=4096
|
Then partition the drive with fdisk:
Code: |
Disk /dev/sda: 931.5 GiB, 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
Disklabel type: dos
Disk identifier: 0x614c7c1d
Device Boot Start End Sectors Size Id Type
/dev/sda1 * 2048 1026047 1024000 500M 83 Linux
/dev/sda2 1026048 1953525167 1952499120 931G 5 Extended
/dev/sda5 1028096 17805311 16777216 8G 82 Linux swap / Solaris
/dev/sda6 17807360 80721919 62914560 30G 83 Linux
/dev/sda7 80723968 1863303167 1782579200 850G 83 Linux
/dev/sda8 1863305216 1953525167 90219952 43G 83 Linux
|
# Create the File System:
Code: |
mkfs.ext4 -L HP_BOOT /dev/sda1
mkfs.ext4 -L HP_ROOT /dev/sda6
mkfs.ext4 -L HP_HOME /dev/sda7
mkfs.ext4 -L HP_VBOX /dev/sda8
mkswap -L HP_SWAP /dev/sdf5
swapon -L HP_SWAP
|
# /etc/fstab:
Code: |
#<fs> <mountpoint> <type> <opts> <dump/pass>
LABEL=HP_BOOT /boot ext4 noatime 1 2
LABEL=HP_ROOT / ext4 noatime 0 1
LABEL=HP_HOME /home ext4 noatime 0 2
LABEL=HP_VBOX /VirtualBox ext4 noatime 0 2
LABEL=HP_SWAP none swap sw 0 0
/dev/cdrom /mnt/cdrom auto noauto,ro 0 0
|
# Mount the Filesystem:
Code: |
mount LABEL=HP_ROOT /mnt/gentoo
mkdir /mnt/gentoo/boot
mount LABEL=HP_BOOT /mnt/gentoo/boot
mkdir /mnt/gentoo/home
mount LABEL=HP_HOME /mnt/gentoo/home
mkdir /mnt/gentoo/VirtualBox
mount LABEL=HP_VBOX /mnt/gentoo/VirtualBox
cd /mnt/gentoo
|
Bootloader: sys-boot/grub-static
# /boot/grub/grub.conf
Code: |
default 0
timeout 10
title HP Gentoo Linux 4.9.72-gentoo
root (hd0,0)
kernel /boot/kernel-genkernel-HP-x86_64-4.9.72-gentoo net.ifnames=0 real_root=LABEL=HP_ROOT scandelay=5 ro ipv6.disable=1
initrd /boot/initramfs-genkernel-HP-x86_64-4.9.72-gentoo
|
The above is for my HP laptop. |
|
Back to top |
|
|
NeddySeagoon Administrator
Joined: 05 Jul 2003 Posts: 54220 Location: 56N 3W
|
Posted: Sun Mar 11, 2018 1:06 pm Post subject: |
|
|
C5ace,
That seems excessive. Your Code: | dd if=/dev/zero of=/dev/sda bs=4096 | will be very slow too.
dd gets faster with increasing block size up to approximately bs=1M.
The block size here is not your drive physical block size, its the size of the transfers that dd will perform. _________________ Regards,
NeddySeagoon
Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail. |
|
Back to top |
|
|
Jaglover Watchman
Joined: 29 May 2005 Posts: 8291 Location: Saint Amant, Acadiana
|
|
Back to top |
|
|
mike155 Advocate
Joined: 17 Sep 2010 Posts: 4438 Location: Frankfurt, Germany
|
Posted: Sun Mar 11, 2018 1:31 pm Post subject: |
|
|
What makes we wonder is the error message: 'failed to mount '/dev/sda4' invalid argument.'
I tried to reproduce this error - but not matter what I do: I don't get this message. I get 'special device ... does not exist.', 'mount point does not exist', 'mount point is not a directory' and so on - but not 'invalid argument'.
There must be something totally wrong. Maybe C5ace is right... |
|
Back to top |
|
|
NeddySeagoon Administrator
Joined: 05 Jul 2003 Posts: 54220 Location: 56N 3W
|
Posted: Sun Mar 11, 2018 1:37 pm Post subject: |
|
|
mike155,
I tried to provoke that error and failed too. _________________ Regards,
NeddySeagoon
Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail. |
|
Back to top |
|
|
Tony0945 Watchman
Joined: 25 Jul 2006 Posts: 5127 Location: Illinois, USA
|
Posted: Sun Mar 11, 2018 3:43 pm Post subject: |
|
|
I had this problem last week. Unfortunately the filesystem was bad. The first thing that fsck reported was that the partition size reported exceeded the size of the disk. |
|
Back to top |
|
|
Hu Moderator
Joined: 06 Mar 2007 Posts: 21607
|
Posted: Sun Mar 11, 2018 4:33 pm Post subject: |
|
|
On the speculation that Tony's issue might be the one that the OP is experiencing, the output of dumpe2fs -h /dev/sda4 might be interesting.
Also, OP, what exactly did you do when you "reformatted" the drives? What commands did you run, and in what order? |
|
Back to top |
|
|
chilos n00b
Joined: 02 Mar 2018 Posts: 19
|
Posted: Sun Mar 11, 2018 8:08 pm Post subject: |
|
|
NeddySeagoon wrote: | chilos,
That's all the right answers so far.
What does Code: | mount -t ext4 /dev/sda4 /mnt/gentoo | tell?
Look at the end of too.
If that mount fails, what does
Do not run that command if the mount works. |
ok
Code: | # mount -t ext4 /dev/sda4 /mnt/gentoo |
gives error: "mount: /mnt/gentoo: wrong fs type, bad option, bad superblock on /dev/sda4, missing codepage or helper program, or other error."
at the bottom of
I have a line that says, "EXT4-fs (sda4): can't read group descriptor 1"
says: fsck.ext2: Attempt to read block from filesystem resulted in short read while trying to open /dev/sda4. Could this be a zero-length partition?
Hu wrote: | On the speculation that Tony's issue might be the one that the OP is experiencing, the output of dumpe2fs -h /dev/sda4 might be interesting.
Also, OP, what exactly did you do when you "reformatted" the drives? What commands did you run, and in what order?
|
I just followed the amd64 handbook. I first used then to delete the partitions then I remade them with mkpart.
Code: | dumpe2fs -h /dev/sda4 |
gives error: dump2fs: Attempt to read block from filesystem resulted in short read while trying to open /dev/sda4. Couldn't find valid filesystem superblock.
Thanks for the help so far guys. |
|
Back to top |
|
|
NeddySeagoon Administrator
Joined: 05 Jul 2003 Posts: 54220 Location: 56N 3W
|
Posted: Sun Mar 11, 2018 8:15 pm Post subject: |
|
|
chilos,
Either sda4 is an extended partition, which is just a fake to reserve space or the filesystem is corrupt.
Try remaking the filesystem.
Code: | mke2fs -t ext4 /dev/sda4 |
Post the output if you can. _________________ Regards,
NeddySeagoon
Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail. |
|
Back to top |
|
|
chilos n00b
Joined: 02 Mar 2018 Posts: 19
|
Posted: Sun Mar 11, 2018 9:58 pm Post subject: |
|
|
Can't post it all very easily. The last lines are:
Allocating group tables: done
Writing inode tables: done
Creating journal: done
Writing super blocks and filesystem accounting information: done
Looks like it worked, right?
Should I go ahead and try to mount my root partition again? |
|
Back to top |
|
|
NeddySeagoon Administrator
Joined: 05 Jul 2003 Posts: 54220 Location: 56N 3W
|
Posted: Sun Mar 11, 2018 10:35 pm Post subject: |
|
|
chilos,
Yes, that looks good. You would have got an error trying that on an extended partition.
You should be good to mount /dev/sda4 now. _________________ Regards,
NeddySeagoon
Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail. |
|
Back to top |
|
|
chilos n00b
Joined: 02 Mar 2018 Posts: 19
|
Posted: Sun Mar 11, 2018 10:41 pm Post subject: |
|
|
Thanks! No error message when I mounted it. Anyway to verify it worked though? |
|
Back to top |
|
|
NeddySeagoon Administrator
Joined: 05 Jul 2003 Posts: 54220 Location: 56N 3W
|
Posted: Sun Mar 11, 2018 10:43 pm Post subject: |
|
|
chilos,
Look in _________________ Regards,
NeddySeagoon
Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail. |
|
Back to top |
|
|
|