Results 1 to 10 of 10
hey everyone,
I am needing to run a few commands each time I boot up and was wondering what is the correct way to go about this. I have heard ...
- 12-11-2006 #1Linux Newbie
- Join Date
- Oct 2006
- Posts
- 101
running commands on boot/login
hey everyone,
I am needing to run a few commands each time I boot up and was wondering what is the correct way to go about this. I have heard a range of things that usually include rc.d. I need to run commands to 1.) mount my hard secondary hard drive 2.) set my screen blank time and 3.) set my background with fbsetbg.
any direction/suggestions would be great!
thanks,
Erik
- 12-11-2006 #2execute this code in terminal/konsole and post output here.1.) mount my hard secondary hard drive
Code:su - fdisk -l
can you explain a little bit more?2)set my screen blank time
3)set my background with fbsetbg.
CasperIt is amazing what you can accomplish if you do not care who gets the credit.
New Users: Read This First
- 12-11-2006 #3Linux Newbie
- Join Date
- Oct 2006
- Posts
- 101
devils_casper:
gives me no output.Code:fdisk -l
the commands i do upon login are:
Mounting drive:
Change to no screen blanking time:Code:mount -t ext3 /dev/hdd1 /maxtor
Change to: no standby, no suspend time, and 30000 sec monitor off time:Code:xset s blank xset s 0
Code:xset dpms 0 0 30000
- 12-11-2006 #4
you must be root to execute fdisk command.
add this line in /etc/fstab filemount -t ext3 /dev/hdd1 /maxtor
Code:/dev/hdd1 /maxtor ext3 defaults,umask=0 0 0
CasperIt is amazing what you can accomplish if you do not care who gets the credit.
New Users: Read This First
- 12-11-2006 #5Linux Newbie
- Join Date
- Oct 2006
- Posts
- 101
thanks Casper.
I'm still getting nothing for the fdisk command even when root... any ideas?
- 12-11-2006 #6
thats weird ! did you add code in /etc/fstab file? it should mount hdb1 at boot up.
try '/sbin/fdisk -l'.
i asked for output of fsidk coz i didn't know the partition structure of second harddisk. you are mounting only one partition of second disk. it means, second disk has only one partition and i posted code for that.
CasperIt is amazing what you can accomplish if you do not care who gets the credit.
New Users: Read This First
- 12-11-2006 #7Linux Newbie
- Join Date
- Oct 2006
- Posts
- 101
this is quite strange....
it seems to be going into fdisk alright but it wont do fdisk -lCode:debian:~# fdisk Usage: fdisk [-l] [-b SSZ] [-u] device E.g.: fdisk /dev/hda (for the first IDE disk) or: fdisk /dev/sdc (for the third SCSI disk) or: fdisk /dev/eda (for the first PS/2 ESDI drive) or: fdisk /dev/rd/c0d0 or: fdisk /dev/ida/c0d0 (for RAID devices) ...
I however can do fdisk -l /dev/hdd which gives me:
yet I don't know why it would be FAT12? I formatted to ext3 and when i mount it is ext3Code:debian:~# fdisk -l /dev/hdd Disk /dev/hdd: 300.0 GB, 300090728448 bytes 255 heads, 63 sectors/track, 36483 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Device Boot Start End Blocks Id System /dev/hdd1 1 36483 293049666 1 FAT12
also my hard drive didn't mount when i booted up... I do only have one partition on the drive
strange stuff... if you have any other thoughts they would be greatly appreciated!
- 12-11-2006 #8
For your xset commands, you can make an init script. Or if you're using KDE, making an Autostart script is slightly easier. The script will be the same either way:
Just copy and paste that into a blank text file, save the file and make it executable (chmod +x filename). For KDE, put the file into your ~/.kde/Autostart directory. Every time KDE starts, those commands will be run.Code:#!/bin/sh xset s blank xset s 0 xset dpms 0 0 30000
A more universal way to do it (at least for Debian and Debian-based distros) is to put the script into /etc/init.d and make a symlink in the rc directory for whatever runlevel you want to run the commands. IIRC, Debian defaults to runlevel 2, so do something like this as root:
If you want to be sure it runs regardless of what runlevel you boot into, do the above command for rc2.d through rc5.d.Code:ln -s /etc/init.d/filename /etc/rc2.d/S99filename
Stand up and be counted as a Linux user!
- 12-12-2006 #9Linux User
- Join Date
- Feb 2006
- Posts
- 484
maybe delete the partition and create a new one if it possible
use cfdisk command
and than run "mkfs.ext3"
- 12-12-2006 #10Linux Newbie
- Join Date
- Oct 2006
- Posts
- 101
I've got a ton of stuff on therer it's really not worth making the transfer. I'm gonna mess around with those rc.d files when I've got some time. Thanks for all the input guys


Reply With Quote
