You are not logged in.

#1 2006-10-10 04:57:51

Pudge
Arch Linux f@h Team Member
Registered: 2006-01-23
Posts: 300

How to prevent mounting SATA hard drive at boot up [SOLVED]

I have two hard drives attached to an Arch computer.  One is a IDE PATA drive which has Arch Linux on it.  One is a SATA drive which has Windows XP on it.  If I do nothing, Arch boots up.  If during boot I hit F11 and temporaily change the boot order, Windows boots up.

Here's my problem.  When I boot Arch, udev (at least I think it's udev) recognizes and mounts the SATA partitions which are NTFS. I don't want them mounted, so the first thing I do after a boot is unmount the three SATA (Windows) partitions.

So I did some research on how to prevent the SATA drive from being mounted at boot up.  First I looked in /etc/fstab.  The SATA drive (SDA1, SDA2, and SDA3) weren't in the fstab.

Next, I read the readme-udev-arch.txt file located in /etc/udev.  It said that if I blacklisted modules in the /etc/rc.conf file, the modules would never be loaded.  So I blacklisted the sata_nv module and blacklisted the ntfs module.  I figured without these modules, the SATA hard drive wouldn't be recognized.  After a reboot, I did a lsmod, and the sata_nv and ntfs modules were still listed.  I don't know why unless the sata_nv and ntfs modules are integrated into the kernel itself and thus the blacklist has no effect on them.

I did a udevinfo --export and the SATA partitions were listed in the output.  I really didn't want to play around with udev rules on a hard drive when i don't know what I'm doing.  I'm not really interested in reloading Windows right now.

So, does anyone know how to prevent the SATA hard drive from being mounted at boot time?

Pudge

Offline

#2 2006-10-10 12:02:00

lanrat
Member
From: Poland
Registered: 2003-10-28
Posts: 1,274

Re: How to prevent mounting SATA hard drive at boot up [SOLVED]

Are you using any autodetection in /etc/mkinitcpio.conf ?

Maybe they are loaded and mounted during boot time not from /etc/rc.conf and /etc/fstab?

Offline

#3 2006-10-10 12:34:24

brain0
Developer
From: Aachen - Germany
Registered: 2005-01-03
Posts: 1,382

Re: How to prevent mounting SATA hard drive at boot up [SOLVED]

Udev does NOT mount any partitions on its own. Check your fstab and any automounters that may be installed.

Offline

#4 2006-10-10 18:52:44

Pudge
Arch Linux f@h Team Member
Registered: 2006-01-23
Posts: 300

Re: How to prevent mounting SATA hard drive at boot up [SOLVED]

brain0 wrote:

Udev does NOT mount any partitions on its own. Check your fstab and any automounters that may be installed.

Thanks Brain0 for the udev clarification.  I have already checked /etc/fstab and didn't see anything there.

I am drawing a blank on the automounters.

Pudge

Offline

#5 2006-10-10 19:38:21

Pudge
Arch Linux f@h Team Member
Registered: 2006-01-23
Posts: 300

Re: How to prevent mounting SATA hard drive at boot up [SOLVED]

I don't want the SATA hard drive mounted at Arch boot up.  Since the SATA hard drive is the only SATA device I have, I came up with this work around for now.

After backing up mkinitcpio.conf I edited the following line:

HOOKS="base udev autodetect ide scsi sata filesystems

and removed the sata entry.  I ran
mkinitcpio -g IMAGE
and made an image.  After backing up /boot/kernel26.img
I copied my new image to kernel26.img

This disables the SATA and the SATA hard drive is not detected.

Booted up, and the SATA hard drive was not mounted.

This is not totally how I wanted to do this, because if I ever add another SATA device such as a SATA CD/DVD drive, disabling the SATA sub system won't work.

I'm still open to any ideas on how to not mount the SATA hard drive without totally disabling SATA.

Pudge

Offline

#6 2006-10-10 19:52:33

brain0
Developer
From: Aachen - Germany
Registered: 2005-01-03
Posts: 1,382

Re: How to prevent mounting SATA hard drive at boot up [SOLVED]

The SATA drive is still detected after init has been started and the system boots. I really don't know why it was mounted though. Just curious: Where was it mounted before?

Offline

#7 2006-10-10 20:38:12

Pudge
Arch Linux f@h Team Member
Registered: 2006-01-23
Posts: 300

Re: How to prevent mounting SATA hard drive at boot up [SOLVED]

@brain0
the three SATA NTFS partitions were mounted at
/media/Win XP
/media/Apps
/media/MP3

as the partitions were named Win XP, Apps, and MP3 in Windows XP.

I have found a solution, and I made this out to be much harder than necessary for some reason.  Mainly because I didn't totally understand how udev and initcpio worked.

I put everything back to the way it originally was.

Originally, /etc/fstab had no entries at all for /dev/sda1 /dev/sda2 or /dev/sda3.  So after looking at the output of udevinfo --query and reading the man pages for fstab and nfs, I added the following lines to /etc/fstab

/dev/sda1              /media/Win    nfs         noauto            0      0
/dev/sda6              /media/MP3    nfs         noauto            0      0
/dev/sda5              /media/Apps   nfs         noauto            0      0

bear in mind that the forums software eliminates excess spaces.

The noauto option prevented the SATA partitions from being mounted.  I haven't figured out why they were mounted with no fstab entries.  Since there were no fstab entries for the partitions and the partions were being mounted anyway, I cncluded something must be over riding fstab.  I jumped to the conclusion it had to be udev or initcpio.  Oh well, it now works exactly the way I want and I learned from the experience.

Pudge

EDIT: If I click on the "Computer" icon on the desktop, Nautilus still shows the three SATA partitions.  If I click on one of the partitions, I get a dialog saying

Unble to mount the selected volume
mount: only root can mount /dev/sda6 on /media/Mp3

So the partitions are still being detected, but my fstab entries are preventing them from being mounted.  Which is OK

Offline

Board footer

Powered by FluxBB