LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian
User Name
Password
Debian This forum is for the discussion of Debian Linux.

Notices


Reply
  Search this Thread
Old 02-03-2015, 10:16 PM   #1
hiero
LQ Newbie
 
Registered: Feb 2015
Posts: 9

Rep: Reputation: Disabled
Wink Problems with mounting drive at boot


Hi,

I have problems with mounting my second drive at boot.
(sorry i am a noob)

When i use the mount command like this:

Code:
mount -t ext3 /dev/sdb2 /mnt/HD/HD_b2
My drive is mounted, the problem is that after a reboot it isnt any more.

I already tryed to add to fstab with.
Code:
nano /etc/fstab
Code:
/dev/sdb2 /mnt/HD/HD_b2 ext3 defaults,errors=remount-ro 0 1
also tryed to add this line.

Code:
UUID=553afede-fa45-4cdc-9972-c0a9aa899509 /mnt/HD/HD_b2 ext3 errors=remount-ro 0 1
But this didnt work, after reboot fstab is empty (normal??)

When i open /etc/mtab

Code:
rootfs / rootfs rw 0 0
/dev/root / ext2 rw,relatime,errors=continue 0 0
sysfs /sys sysfs rw,relatime 0 0
proc /proc proc rw,relatime 0 0
squash /usr/local/tmp ramfs rw,relatime,size=38m 0 0
/dev/loop0 /usr/local/modules squashfs ro,relatime 0 0
/dev/mtdblock5 /usr/local/config jffs2 rw,relatime 0 0
/dev/sda4 /mnt/HD_a4 ext3 rw,relatime,errors=continue,data=writeback 0 0
/dev/sdb4 /mnt/HD_b4 ext2 rw,relatime,errors=continue 0 0
none /proc/bus/usb usbfs rw,relatime 0 0
/dev/sda2 /mnt/HD/HD_a2 ext3 rw,relatime,errors=continue,user_xattr,data=writeback,usrquota,grpquota 0 0
/dev/sdb2 /mnt/HD/HD_b2 ext3 rw,relatime,errors=continue,user_xattr,data=writeback,usrquota,grpquota 0 0
/dev/sda2 /mnt/HD/HD_a2/squeeze/mnt/HD/HD_a2 ext3 rw,relatime,errors=continue,user_xattr,data=writeback,usrquota,grpquota 0 0
/dev/root /mnt/HD/HD_a2/squeeze/mnt/root ext2 rw,relatime,errors=continue 0 0
/dev/root /mnt/HD/HD_a2/squeeze/dev ext2 rw,relatime,errors=continue 0 0
sysfs /mnt/HD/HD_a2/squeeze/sys sysfs rw,relatime 0 0
proc /mnt/HD/HD_a2/squeeze/proc proc rw,relatime 0 0
Output of blkid:

Code:
/dev/loop0: TYPE="squashfs"
/dev/sda1: UUID="e67e5c15-7b8b-9389-c311-e5d4c61326f9" TYPE="linux_raid_member"
/dev/sda2: UUID="09e0e365-0aa6-4214-b571-2bc6b027fd9f" TYPE="ext3"
/dev/sda4: UUID="64038414-136c-4939-bd14-9871a20290bd" TYPE="ext3"
/dev/sdb1: UUID="e67e5c15-7b8b-9389-c311-e5d4c61326f9" TYPE="linux_raid_member"
/dev/sdb2: UUID="553afede-fa45-4cdc-9972-c0a9aa899509" TYPE="ext3"
/dev/sdb4: UUID="bf594be6-ffb6-469d-a3a8-246be66a4d90" TYPE="ext2"
/dev/md0: TYPE="swap"
I have a NAS (DNS-325) where i installed debian squeeze on via this tutorial.

The funny thing is, i already installed it this way 2 years a go, had to reinstall (becaus i F* up trying stuff ;-) ) Then i got it to work, but dont remember how i solved it. Already spent a lot of hours trying to solve it.

Hope you guys can help me out.
 
Old 02-04-2015, 10:19 AM   #2
widget
Senior Member
 
Registered: Oct 2008
Location: S.E. Montana
Distribution: Debian Testing, Stable, Sid and Manjaro, Mageia 3, LMDE
Posts: 2,628

Rep: Reputation: 497Reputation: 497Reputation: 497Reputation: 497Reputation: 497
Simple things first.

Does the directory /mnt/HD/HD_b2 exist?

Run;
Code:
ls /mnt/HD
To find out.

I ask because it is a common error.

Myself, seeing how you have only 6 partitions, I would not have a /mnt/HD directory at all.

I would first; label all partitions; second have a directory in /mnt of each of them.

Labels like 1a, 1b, 2a, 2b and so on. Giving you /mnt/1a, /mnt/1b, etc.

Usual practice has drives and such mounted in /media but that is up to you. My /mnt is pretty much mount points for chroot environments.

And as I have never used raid I will admit things could well be done differently when that is being used.
 
Old 02-04-2015, 10:51 AM   #3
veerain
Senior Member
 
Registered: Mar 2005
Location: Earth bound to Helios
Distribution: Custom
Posts: 2,524

Rep: Reputation: 319Reputation: 319Reputation: 319Reputation: 319
Quote:
Originally Posted by hiero View Post
Hi,

I have problems with mounting my second drive at boot.
(sorry i am a noob)

When i use the mount command like this:

Code:
mount -t ext3 /dev/sdb2 /mnt/HD/HD_b2
My drive is mounted, the problem is that after a reboot it isnt any more.

I already tryed to add to fstab with.
Code:
nano /etc/fstab
Code:
/dev/sdb2 /mnt/HD/HD_b2 ext3 defaults,errors=remount-ro 0 1
also tryed to add this line.

Code:
UUID=553afede-fa45-4cdc-9972-c0a9aa899509 /mnt/HD/HD_b2 ext3 errors=remount-ro 0 1
But this didnt work, after reboot fstab is empty (normal??)

When i open /etc/mtab

Code:
rootfs / rootfs rw 0 0
/dev/root / ext2 rw,relatime,errors=continue 0 0
sysfs /sys sysfs rw,relatime 0 0
proc /proc proc rw,relatime 0 0
squash /usr/local/tmp ramfs rw,relatime,size=38m 0 0
/dev/loop0 /usr/local/modules squashfs ro,relatime 0 0
/dev/mtdblock5 /usr/local/config jffs2 rw,relatime 0 0
/dev/sda4 /mnt/HD_a4 ext3 rw,relatime,errors=continue,data=writeback 0 0
/dev/sdb4 /mnt/HD_b4 ext2 rw,relatime,errors=continue 0 0
none /proc/bus/usb usbfs rw,relatime 0 0
/dev/sda2 /mnt/HD/HD_a2 ext3 rw,relatime,errors=continue,user_xattr,data=writeback,usrquota,grpquota 0 0
/dev/sdb2 /mnt/HD/HD_b2 ext3 rw,relatime,errors=continue,user_xattr,data=writeback,usrquota,grpquota 0 0
/dev/sda2 /mnt/HD/HD_a2/squeeze/mnt/HD/HD_a2 ext3 rw,relatime,errors=continue,user_xattr,data=writeback,usrquota,grpquota 0 0
/dev/root /mnt/HD/HD_a2/squeeze/mnt/root ext2 rw,relatime,errors=continue 0 0
/dev/root /mnt/HD/HD_a2/squeeze/dev ext2 rw,relatime,errors=continue 0 0
sysfs /mnt/HD/HD_a2/squeeze/sys sysfs rw,relatime 0 0
proc /mnt/HD/HD_a2/squeeze/proc proc rw,relatime 0 0
But /etc/mtab shows the second partition of second hard drive /dev/sdb2 as mounted.
 
Old 02-04-2015, 10:51 AM   #4
hiero
LQ Newbie
 
Registered: Feb 2015
Posts: 9

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by widget View Post
Simple things first.

Does the directory /mnt/HD/HD_b2 exist?
Yes, i can mout the drive with the mount command, and explore it, so it does exist.

Quote:
Run;
Code:
ls /mnt/HD
To find out.

I ask because it is a common error.
root@dlink:/mnt/HD# ls
HD_a2 HD_b2



And for the stucture, you are right, but its just consmetic, dont have to work a lot on this NAS. And i am the only 1 that use it (home).

And thanks for the fast replay.
 
Old 02-04-2015, 11:04 AM   #5
hiero
LQ Newbie
 
Registered: Feb 2015
Posts: 9

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by veerain View Post
But /etc/mtab shows the second partition of second hard drive /dev/sdb2 as mounted.
Yes, i know, but that line doesnt, give me a mounted device, i need to use the mount command, and when i look ate the /etc/mtab again, it looks like this, check last line.

Code:
rootfs / rootfs rw 0 0
/dev/root / ext2 rw,relatime,errors=continue 0 0
sysfs /sys sysfs rw,relatime 0 0
proc /proc proc rw,relatime 0 0
squash /usr/local/tmp ramfs rw,relatime,size=38m 0 0
/dev/loop0 /usr/local/modules squashfs ro,relatime 0 0
/dev/mtdblock5 /usr/local/config jffs2 rw,relatime 0 0
/dev/sda4 /mnt/HD_a4 ext3 rw,relatime,errors=continue,data=writeback 0 0
/dev/sdb4 /mnt/HD_b4 ext2 rw,relatime,errors=continue 0 0
none /proc/bus/usb usbfs rw,relatime 0 0
/dev/sda2 /mnt/HD/HD_a2 ext3 rw,relatime,errors=continue,user_xattr,data=writeb$
/dev/sdb2 /mnt/HD/HD_b2 ext3 rw,relatime,errors=continue,user_xattr,data=writeb$
/dev/sda2 /mnt/HD/HD_a2/squeeze/mnt/HD/HD_a2 ext3 rw,relatime,errors=continue,u$
/dev/root /mnt/HD/HD_a2/squeeze/mnt/root ext2 rw,relatime,errors=continue 0 0
/dev/root /mnt/HD/HD_a2/squeeze/dev ext2 rw,relatime,errors=continue 0 0
sysfs /mnt/HD/HD_a2/squeeze/sys sysfs rw,relatime 0 0
proc /mnt/HD/HD_a2/squeeze/proc proc rw,relatime 0 0
/dev/sdb2 /mnt/HD/HD_b2 ext3 rw 0 0
 
Old 02-04-2015, 02:12 PM   #6
Hungry ghost
Senior Member
 
Registered: Dec 2004
Posts: 1,222

Rep: Reputation: 667Reputation: 667Reputation: 667Reputation: 667Reputation: 667Reputation: 667
Quote:
Originally Posted by hiero View Post
after reboot fstab is empty (normal??)
That's not normal; it should properly save the changes you make to it. However, I'm not sure why it happens.

Silly question: are you sure you're saving the file properly after you edit it? BTW, when you say it's empty, you mean the file is completely blank or only the line for this partition has been removed? And one more thing, could you post your complete fstab file here?
 
Old 02-04-2015, 02:48 PM   #7
veerain
Senior Member
 
Registered: Mar 2005
Location: Earth bound to Helios
Distribution: Custom
Posts: 2,524

Rep: Reputation: 319Reputation: 319Reputation: 319Reputation: 319
Quote:
/dev/sdb2 /mnt/HD/HD_b2 ext3 rw,relatime,errors=continue,user_xattr,data=writeb$
See this hiero. It means it's already mounted. If you mount again it would show a new line displaying it in last line.

Did you checked for files and directories in /mnt/HD/HD_b2 before trying manual mount?

Last edited by veerain; 02-04-2015 at 02:51 PM.
 
Old 02-04-2015, 04:51 PM   #8
hiero
LQ Newbie
 
Registered: Feb 2015
Posts: 9

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by odiseo77 View Post
Silly question: are you sure you're saving the file properly after you edit it? BTW, when you say it's empty, you mean the file is completely blank or only the line for this partition has been removed? And one more thing, could you post your complete fstab file here?
When i edit the fstab file, i save it and open it again, to see if it did save, so that one is true, it saves.

Its completely blank. Want to upload the file (fstab) but attachment(site) doesnt let me, but it realy compleetly empty, if i for example put in a compleetly wrong line in the fstab file on purpose, and i type mount -a , i get a error, [mntent]: line 1 in /etc/fstab is bad

So i think fstab is in the right location/ name.


Quote:
Originally Posted by veerain View Post
See this hiero. It means it's already mounted. If you mount again it would show a new line displaying it in last line.

Did you checked for files and directories in /mnt/HD/HD_b2 before trying manual mount?
Yes

Code:
root@dlink:~# cd /mnt/HD/HD_b2
root@dlink:/mnt/HD/HD_b2# ls
root@dlink:/mnt/HD/HD_b2#
Then i do this

Code:
root@dlink:~# mount -t ext3 /dev/sdb2 /mnt/HD/HD_b2
After this i get
Code:
root@dlink:/mnt/HD/HD_b2# ls
Data  dir1  Untitled.png  dir2  temp  dir3  dir4
root@dlink:/mnt/HD/HD_b2#
This is the content of my second drive.
Note: i changed real dir names here to dir1,dir2,dir3,dir4
 
Old 02-04-2015, 11:07 PM   #9
selfprogrammed
Member
 
Registered: Jan 2010
Location: Minnesota, USA
Distribution: Slackware 13.37, 14.2, 15.0
Posts: 635

Rep: Reputation: 154Reputation: 154
Wild guess, you may be trying to mount as a user, so you need user permission in the options.
/etc/fstab
/dev/sdb2 /mnt/HD/HD_b2 ext3 rw,user,errors=remount-ro 0 1
 
Old 02-05-2015, 10:16 AM   #10
hiero
LQ Newbie
 
Registered: Feb 2015
Posts: 9

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by selfprogrammed View Post
Wild guess, you may be trying to mount as a user, so you need user permission in the options.
/etc/fstab
/dev/sdb2 /mnt/HD/HD_b2 ext3 rw,user,errors=remount-ro 0 1
This also didnt work, add your line to fstab, checked if it saved, mount -a, didnt do any thing, also reboot didnt, after reboot fstab was empty again.

Is there a work around that i just use the following mount command at boot? putting it in a script some where?

mount -t ext3 /dev/sdb2 /mnt/HD/HD_b2

because above command works after boot, on the command line, then the partition is mounted

Edit:

I have edit
/boot/linuxrc
i put following line in it
/etc/init.d/mediaservers.sh
in mediaservers.sh i put the following line
su root -c "mount -t ext3 /dev/sdb2 /mnt/HD/HD_b2"

(mediaservers.sh is were i start program's)


now after a reboot the partition is mounted.....

But can i call this a solve? (for this topic) because it solved it for me

Last edited by hiero; 02-05-2015 at 10:56 AM.
 
Old 02-05-2015, 11:31 AM   #11
Hungry ghost
Senior Member
 
Registered: Dec 2004
Posts: 1,222

Rep: Reputation: 667Reputation: 667Reputation: 667Reputation: 667Reputation: 667Reputation: 667
Quote:
Originally Posted by hiero View Post
When i edit the fstab file, i save it and open it again, to see if it did save, so that one is true, it saves.

Its completely blank. Want to upload the file (fstab) but attachment(site) doesnt let me, but it realy compleetly empty, if i for example put in a compleetly wrong line in the fstab file on purpose, and i type mount -a , i get a error, [mntent]: line 1 in /etc/fstab is bad

So i think fstab is in the right location/ name.
I'm surprised your system even boots with a blank fstab file. Could you post the output of the following command?:

Code:
cat /etc/fstab

Last edited by Hungry ghost; 02-05-2015 at 11:33 AM.
 
Old 02-05-2015, 12:11 PM   #12
hiero
LQ Newbie
 
Registered: Feb 2015
Posts: 9

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by odiseo77 View Post
I'm surprised your system even boots with a blank fstab file. Could you post the output of the following command?:

Code:
cat /etc/fstab
Code:
root@dlink:/etc/openvpn# cat /etc/fstab
root@dlink:/etc/openvpn#
 
Old 02-05-2015, 01:14 PM   #13
widget
Senior Member
 
Registered: Oct 2008
Location: S.E. Montana
Distribution: Debian Testing, Stable, Sid and Manjaro, Mageia 3, LMDE
Posts: 2,628

Rep: Reputation: 497Reputation: 497Reputation: 497Reputation: 497Reputation: 497
OK, I'll bite.

Why;
Code:
root@dlink:/etc/openvpn#
?

Just exactly what system are you using? This is a Debian version?

What does your user ($) terminal have to say if you just open it normally? Should look similar to;
Code:
sam@lounge:~$
Assuming it does the run, from the $ prompt;
Code:
cat /etc/fstab
 
Old 02-05-2015, 01:53 PM   #14
hiero
LQ Newbie
 
Registered: Feb 2015
Posts: 9

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by widget View Post
OK, I'll bite.

Why;
Code:
root@dlink:/etc/openvpn#
?

Just exactly what system are you using? This is a Debian version?

What does your user ($) terminal have to say if you just open it normally? Should look similar to;
Code:
sam@lounge:~$
Assuming it does the run, from the $ prompt;
Code:
cat /etc/fstab
Debian GNU/Linux 7


i found the problem.... sorry i am a noob at this.

I am using a NAS DNS-325

in order to run somthing els then the standaard browser, i installed fun_plug , this comes with a file (fun_plug) that you put on your root of you NAS to started

Fun_plug allows the user to start additional programs and tools on the NAS. A Berlin-based developer named “Fonz” created a package called “ffp” (Fonz fun_plug), which includes the script and some extra software which can be invoked by fun_plug.

After i installed Fonz fun_plug, i used this to install debian, this requered a other fun_plug file on my harddisk. After this i updated it to Debian 7.

I totally forgot about that file (fun_plug), this file is responsible for the problems i had, because it rm fstab, and makes a empty fstab.

Code:
#!/bin/sh

# Root DISK1
export DISK1=/mnt/HD/HD_a2
export DISTDIR=squeeze

cd $DISK1

mount --bind $DISK1 $DISTDIR$DISK1
mount --bind / $DISTDIR/mnt/root
mount --bind /dev $DISTDIR/dev
mount --bind /sys  $DISTDIR/sys
#mount --bind /sys/crfs $DISTDIR/sys/crfs
#mount --bind /web $DISTDIR/web
mount --bind /proc $DISTDIR/proc

cp -f /proc/mounts $DISTDIR/etc/mtab
rm -f $DISTDIR/etc/fstab
touch $DISTDIR/etc/fstab
cp -f /etc/resolv.conf $DISTDIR/etc
hostname >$DISTDIR/etc/hostname
cp -f /etc/hosts $DISTDIR/etc

$DISK1/$DISTDIR/boot/chroot $DISK1/$DISTDIR /boot/linuxrc
so problem found.... sorry i am new at this.(yea a newbie)

for
root@dlink:/etc/openvpn#

I am trying to get openvpn to work, so after your question, i run your command, while i was busy with openvpn, thats why you see me in that dir.

Thanks for the help!!!! (all you guys)
 
Old 02-05-2015, 04:39 PM   #15
widget
Senior Member
 
Registered: Oct 2008
Location: S.E. Montana
Distribution: Debian Testing, Stable, Sid and Manjaro, Mageia 3, LMDE
Posts: 2,628

Rep: Reputation: 497Reputation: 497Reputation: 497Reputation: 497Reputation: 497
Did you install nas from that site or from the Wheezy repo?

While this "fun_plug" sounds interesting it would be a better policy to just use packages from the Debian repos. This will give you less trouble and allow you to learn in an unbroken system.

On the other hand;
A> it is your box
B> you learn a lot in a broken system and it is more exciting
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Problems mounting ext3 drive. Unknown drive parameters augur86 Linux - General 2 03-24-2009 05:03 AM
having problems mounting drive and then writing to it sybariten Linux - Hardware 2 01-18-2005 07:34 PM
having problems mounting a DVD-RW drive Earl Parker II Slackware 5 08-10-2004 12:27 AM
slackware 9.1 mounting problems (cd drive, cd writer drive, win partition (ntfs)) mr.gizm0 Slackware 8 05-11-2004 06:23 PM
mounting network drive on boot Acidwarp01 Linux - Networking 5 08-30-2003 08:58 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian

All times are GMT -5. The time now is 02:46 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration