How do I start slackware without mounting drives, but have drives accessible?
SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
How do I start slackware without mounting drives, but have drives accessible?
Hi all,
This is a basic question, but I'm stumped. I'd like to run fsck on the drive I use to run Slackware. All the advice I've read is to not run fsck on a mounted drive.
So how do I start fsck on my drive without mounting it? I can boot from the Slackware 12.1 installation CD, but that won't read the fstab.
Is there a reason to run fsck? You can force a filesystem check upon a reboot if necessary. Usually you can run manually by booting into single user mode and or passing init=/bin/bash at the lilo prompt.
To force a filesystem check (fsck) upon reboot, just pass the -F option when rebooting:
You just need to boot the Slackware installation CD/DVD (or really, any live CD) and run fsck against the device itself.
So if your normal system is mounting /dev/hda1 as /, and you want to check that, you just boot up to a live media and run "fsck /dev/hda1". The device nodes are going to be the same regardless; fstab has nothing to do with it.
Though if you use a live CD other than the Slackware install CD, you will have to pay a little more attention as many distributions are using the new ATA driver which addresses even PATA devices as sdX. So what is called /dev/hda1 under the default Slackware kernel would be /dev/sda1 under a newer kernel.
You could boot your installed filesystem and pass the 'single' parameter to the kernel. Then perform the 'fsck' on the desired filesystem. As others have pointed out a Livecd or the Slackware install cd/dvd can be used to perform the 'fsck' on the filesystem.
You should 'man fsck';
Code:
excerpt from 'man fsck';
fsck - check and repair a Linux file system
SYNOPSIS
fsck [ -sAVRTMNP ] [ -C [ fd ] ] [ -t fstype ] [filesys ... ] [--] [
fs-specific-options ]
DESCRIPTION
fsck is used to check and optionally repair one or more Linux file sys-
tems. filesys can be a device name (e.g. /dev/hdc1, /dev/sdb2), a
mount point (e.g. /, /usr, /home), or an ext2 label or UUID specifier
(e.g. UUID=8868abf6-88c5-4a83-98b8-bfc24057f7bd or LABEL=root). Nor-
mally, the fsck program will try to handle filesystems on different
physical disk drives in parallel to reduce the total amount of time
needed to check all of the filesystems.
If no filesystems are specified on the command line, and the -A option
is not specified, fsck will default to checking filesystems in
/etc/fstab serially. This is equivalent to the -As options.
Just to clarify a bit, when your normal system first boots, the / partition is mounted read-only at first. Then the FORCEFSCK is done. If this variable is set then the / drive will be checked. Then, shortly afterwards it gets remounted read-write ( /sbin/mount -w -v -n -o remount / )and the init processes continue.
You can see all this happening in the first 100 lines, or so, of /etc/rc.d/rc.S -except for the initial mounting of /, which is done by the kernel itself(using the mount options you pass to the kernel with the bootloader. (The last thing the kernel does after uncompressing itself into RAM, is to mount the specified / partition and then turns control over to /sbin/init).
If you boot passing the 'single' option, or after a normal boot-up you pass 'telinit 1' from the terminal, all processes are killed and networked drives are unmounted (see /etc/rc.d/rc.K for this). If you want to fsck your / partition from here, be sure to make sure it is mounted read-only first by running the 'mount' command without options. If it is already mounted read-write, then you can remount it read-only with this command: '/sbin/mount -r -v -n -o remount /'
It's safe then to be fsck'd. If it was already mounted read-write, the partition is probably not greatly damaged. If a drive is so damamged that it can't even be mounted during bootup, then your only recourse is to boot from a CD or other removable device and run fsck on the drive directly without mounting it at all.
I've had a couple of hard restarts. I use the JFS file system and I get a message on startup that JFS is "replaying the file system journal" (or something similar), but I feel that a file system check is a good idea. I think I need to use jfs_fsck rather than the normal fsck.
I was unaware that telinit 1 followed by remounting read-only would accomplish what I needed. I'll give passing the "single" parameter via the LILO prompt a try too. If I pass the single parameter, would I still need to remount the root partition with
I've had a couple of hard restarts. I use the JFS file system and I get a message on startup that JFS is "replaying the file system journal" (or something similar), but I feel that a file system check is a good idea. I think I need to use jfs_fsck rather than the normal fsck.
I was unaware that telinit 1 followed by remounting read-only would accomplish what I needed. I'll give passing the "single" parameter via the LILO prompt a try too. If I pass the single parameter, would I still need to remount the root partition with
Code:
/sbin/mount -r -v -n -o remount /
?
Thanks,
-Drew
If you don't specify the filesystem the 'fsck' will check serially to find the correct filesystem type. See the excerpt below;
Code:
excerpt from 'man fsck'
NAME
fsck - check and repair a Linux file system
SYNOPSIS
fsck [ -sAVRTMNP ] [ -C [ fd ] ] [ -t fstype ] [filesys ... ] [--] [
fs-specific-options ]
DESCRIPTION
fsck is used to check and optionally repair one or more Linux file sys-
tems. filesys can be a device name (e.g. /dev/hdc1, /dev/sdb2), a
mount point (e.g. /, /usr, /home), or an ext2 label or UUID specifier
(e.g. UUID=8868abf6-88c5-4a83-98b8-bfc24057f7bd or LABEL=root). Nor-
mally, the fsck program will try to handle filesystems on different
physical disk drives in parallel to reduce the total amount of time
needed to check all of the filesystems.
If no filesystems are specified on the command line, and the -A option
is not specified, fsck will default to checking filesystems in
/etc/fstab serially. This is equivalent to the -As options.
The exit code returned by fsck is the sum of the following conditions:
0 - No errors
1 - File system errors corrected
2 - System should be rebooted
4 - File system errors left uncorrected
8 - Operational error
16 - Usage or syntax error
32 - Fsck canceled by user request
128 - Shared library error
The exit code returned when multiple file systems are checked is the
bit-wise OR of the exit codes for each file system that is checked.
In actuality, fsck is simply a front-end for the various file system
checkers (fsck.fstype) available under Linux. The file system-specific
checker is searched for in /sbin first, then in /etc/fs and /etc, and
finally in the directories listed in the PATH environment variable.
Please see the file system-specific checker manual pages for further
details.
Gilbert, I'm not sure how things worked out with passing the "single" option at boot. I think that the / partition was mount rw instead of ro. Remounting read-only worked just fine and the jfs_fsck took only seconds to complete.
Yeah, I hadn't tried the single option myself, so I was unsure whether rc.K would be run *after* rc.S or *instead* of rc.S. If it is run after, then the / partition would have already been remounted read-write. A close look at the boot messages would tell you since the remount command is accompanied by a message.
The 'single' boot parameter that you pass to the inet process provides a means to instruct the init to boot the computer in a single user mode. The init does not launch all the usual daemons.
Therefore you can maintain the system in a fashion without the worry of other users on the system. As root you can then perform maintenance on the system without conflict(s). You can perform the 'fsck' without the worry of r/w to the filesystem you are going to be working on by another user.
Another good one you should be aware of is the 'panic=n'. You can use 'panic=15' to provide a means to recover from a kernel problem. The 'panic=15' provides a delay of 15 seconds or whatever you pass for the parameter then the kernel will reboot after the defined time period. Usually the kernel panic will cause a fault that will require a cold boot.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.