Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Failed to mount /dev/sda4
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Installing Gentoo
View previous topic :: View next topic  
Author Message
chilos
n00b
n00b


Joined: 02 Mar 2018
Posts: 19

PostPosted: Sat Mar 10, 2018 5:11 am    Post subject: Failed to mount /dev/sda4 Reply with quote

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
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 43186
Location: 56N 3W

PostPosted: Sat Mar 10, 2018 12:28 pm    Post subject: Reply with quote

chilos,

What does
Code:
fdisk -l /dev/sda
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
View user's profile Send private message
chilos
n00b
n00b


Joined: 02 Mar 2018
Posts: 19

PostPosted: Sat Mar 10, 2018 9:38 pm    Post subject: Reply with quote

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
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 43186
Location: 56N 3W

PostPosted: Sat Mar 10, 2018 9:56 pm    Post subject: Reply with quote

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
Code:
ls /dev/sda?
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
View user's profile Send private message
chilos
n00b
n00b


Joined: 02 Mar 2018
Posts: 19

PostPosted: Sat Mar 10, 2018 11:04 pm    Post subject: Reply with quote

https://paste.pound-python.org/show/W1xWuJQXGhccY9ngENLM/

# ls /dev/sda4

yields:

/dev/sda4
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 43186
Location: 56N 3W

PostPosted: Sun Mar 11, 2018 12:19 am    Post subject: Reply with quote

chilos,

That all looks good. What are the permissions on sda4 ?
Code:
ls -l /dev/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
View user's profile Send private message
chilos
n00b
n00b


Joined: 02 Mar 2018
Posts: 19

PostPosted: Sun Mar 11, 2018 1:39 am    Post subject: Reply with quote

Code:
# ls -l /dev/sda4

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
View user's profile Send private message
grumblebear
Tux's lil' helper
Tux's lil' helper


Joined: 26 Feb 2008
Posts: 141

PostPosted: Sun Mar 11, 2018 2:06 am    Post subject: Reply with quote

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
View user's profile Send private message
chilos
n00b
n00b


Joined: 02 Mar 2018
Posts: 19

PostPosted: Sun Mar 11, 2018 3:09 am    Post subject: Reply with quote

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
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 43186
Location: 56N 3W

PostPosted: Sun Mar 11, 2018 11:42 am    Post subject: Reply with quote

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
Code:
dmesg
too.

If that mount fails, what does
Code:
fsck /dev/sda4

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
View user's profile Send private message
C5ace
Apprentice
Apprentice


Joined: 23 Dec 2013
Posts: 277
Location: Brisbane, Australia

PostPosted: Sun Mar 11, 2018 12:00 pm    Post subject: Reply with quote

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
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 43186
Location: 56N 3W

PostPosted: Sun Mar 11, 2018 1:06 pm    Post subject: Reply with quote

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
View user's profile Send private message
Jaglover
Watchman
Watchman


Joined: 29 May 2005
Posts: 7090
Location: Saint Amant, Acadiana

PostPosted: Sun Mar 11, 2018 1:14 pm    Post subject: Reply with quote

Adding a protective MSDOS table to GPT has always worked for me, no need to nuke the whole drive.
_________________
Please learn how to denote units correctly!
Back to top
View user's profile Send private message
mike155
Veteran
Veteran


Joined: 17 Sep 2010
Posts: 1294
Location: Frankfurt, Germany

PostPosted: Sun Mar 11, 2018 1:31 pm    Post subject: Reply with quote

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
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 43186
Location: 56N 3W

PostPosted: Sun Mar 11, 2018 1:37 pm    Post subject: Reply with quote

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
View user's profile Send private message
Tony0945
Advocate
Advocate


Joined: 25 Jul 2006
Posts: 3076
Location: Illinois, USA

PostPosted: Sun Mar 11, 2018 3:43 pm    Post subject: Reply with quote

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
View user's profile Send private message
Hu
Moderator
Moderator


Joined: 06 Mar 2007
Posts: 13842

PostPosted: Sun Mar 11, 2018 4:33 pm    Post subject: Reply with quote

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
View user's profile Send private message
chilos
n00b
n00b


Joined: 02 Mar 2018
Posts: 19

PostPosted: Sun Mar 11, 2018 8:08 pm    Post subject: Reply with quote

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
Code:
dmesg
too.

If that mount fails, what does
Code:
fsck /dev/sda4

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
Code:
 # dmesg


I have a line that says, "EXT4-fs (sda4): can't read group descriptor 1"

Code:
fsck /dev/sda4


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
Code:
mklabel msdos
then
Code:
rm 4
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
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 43186
Location: 56N 3W

PostPosted: Sun Mar 11, 2018 8:15 pm    Post subject: Reply with quote

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
View user's profile Send private message
chilos
n00b
n00b


Joined: 02 Mar 2018
Posts: 19

PostPosted: Sun Mar 11, 2018 9:58 pm    Post subject: Reply with quote

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
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 43186
Location: 56N 3W

PostPosted: Sun Mar 11, 2018 10:35 pm    Post subject: Reply with quote

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
View user's profile Send private message
chilos
n00b
n00b


Joined: 02 Mar 2018
Posts: 19

PostPosted: Sun Mar 11, 2018 10:41 pm    Post subject: Reply with quote

Thanks! No error message when I mounted it. Anyway to verify it worked though?
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 43186
Location: 56N 3W

PostPosted: Sun Mar 11, 2018 10:43 pm    Post subject: Reply with quote

chilos,

Look in
Code:
df

_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Installing Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum