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

Notices


Reply
  Search this Thread
Old 01-07-2006, 07:58 AM   #1
hsimah
Member
 
Registered: Jan 2006
Location: Australia
Distribution: Slackware 12.1
Posts: 173

Rep: Reputation: 30
Formatting Drives


Hi! I am a new user to Slackware, I've finally got it all running and everyhting is sweet. SO I've decided to make it a bit more "perfect" I guess.

In my machine I had two 120gig hard drives formatted to NTFS for XP. One of them had all my media on it, the other had Windows. I installed Slack over the Windows one with the swap, /home, /root partitions as instructed, and Linux even can read the NTFS drive, so I asked it to do that.

Anyways I am not using Windows on this machine anymore, and Linux can't write to NTFS without third party programs (I read), so I thought I would copy the media into /home, wipe the other drive, format it to Linux FS and copy them back.

I deleted the partitons in fdisk, and created a new primary one using all the space. But it isn't working. At first when I loaded KDE it was still an NTFS drive (nothing had changed), so I rebooted and tried again. The next time I couldn't access the drive, even from root.

The same thing happens, and I get an error in the startup about it, but Slack still loads. Also, LILO still asks me if I want to boot into Windows (though there was never a Windows install on this drive).

How can I get my drive back?
 
Old 01-07-2006, 08:29 AM   #2
cwwilson721
Senior Member
 
Registered: Dec 2004
Location: In my house.
Distribution: Ubuntu 10.10 64bit, Slackware 13.1 64-bit
Posts: 2,649
Blog Entries: 1

Rep: Reputation: 67
Sometimes simple is best. Check you BIOS settings for a anti-virus for the MBR, may also just be a write-protect feature. Make sure it is off.

After that, try the Linux fdisk or cfdisk again. Change it to a different type, then reboot, then again back to a linux type 82. Then you need to format it (fdisk only sets up the partion as 'linux' partition type, formatting actually makes the filesystem.

Use the 'mkfs' comammand ("Make FileSytem"). For example:
Code:
 mkfs.ext3 /dev/hdb
This assumes you want a ext3 filesystem on HDb.

Then edit your lilo.conf to get rid of the section mentioning windows, run 'lilo' and reboot

Let us know how it works

Last edited by cwwilson721; 01-07-2006 at 08:31 AM.
 
Old 01-07-2006, 08:48 AM   #3
hsimah
Member
 
Registered: Jan 2006
Location: Australia
Distribution: Slackware 12.1
Posts: 173

Original Poster
Rep: Reputation: 30
OK, I did that. Might I thank you for explaining in detail about the Make Filesystem, all the names of these processes does get overwhelming. Thanks also, it is mounted and looks to be working.

How does one set up the access for such a drive? I would like it to be accessable for all users, not just root. I think it is in fstab or mtab or something. I opened up those as they were in one of the error messages.

EDIT: How can I edit lilo.config? It won't open in any text editor I have tried.

EDIT: Nevermind about liloconfig, its a shell script. Duh.

Last edited by hsimah; 01-07-2006 at 09:00 AM.
 
Old 01-07-2006, 09:44 AM   #4
MMYoung
Member
 
Registered: Apr 2004
Location: Arkansas
Distribution: Ubuntu 8.10
Posts: 365

Rep: Reputation: 30
Quote:
Originally Posted by hsimah
How does one set up the access for such a drive? I would like it to be accessable for all users, not just root. I think it is in fstab or mtab or something. I opened up those as they were in one of the error messages.
Open a terminal and su to root and edit /etc/fstab to add a line for your new HD, something like this:

/dev/hdbx /mnt/name ext3 noauto,user,rw 0 0

Where x is the partition number and name is whatever you want to call the mount point, ext3 is the file system, noauto keeps it from being automounted at boot, user allows any user to mount/unmount it with read/write (rw) permission.

[EDIT]Be sure and create a directory in /mnt called name.[/EDIT]

HTH,
MMYoung

Last edited by MMYoung; 01-07-2006 at 10:02 AM.
 
Old 01-07-2006, 09:47 AM   #5
cwwilson721
Senior Member
 
Registered: Dec 2004
Location: In my house.
Distribution: Ubuntu 10.10 64bit, Slackware 13.1 64-bit
Posts: 2,649
Blog Entries: 1

Rep: Reputation: 67
Nono... /etc/lilo.conf Different beast.

And you're very welcome.

For the permissions, I do not know. I'm the only user of my system, so I can always get to it. Others on this forum, as you'll find out, will be more than willing to help. Wait a few minutes, someone will help.

Can somebody help with his permissions issue?
 
Old 01-07-2006, 10:02 AM   #6
hsimah
Member
 
Registered: Jan 2006
Location: Australia
Distribution: Slackware 12.1
Posts: 173

Original Poster
Rep: Reputation: 30
Yeah, I edited that one too. I did a search for lilo. That problem I have overcome, with your help.

MMYoung, thank you also for explaing exactly what all that meant. I did all that but I still can't seem to put files onto that hard drive. I'll continue to play with it.

What do the two 0's mean? On some of my drives there are 1 1 and 1 2?

Last edited by hsimah; 01-07-2006 at 10:18 AM.
 
Old 01-07-2006, 10:19 AM   #7
cwwilson721
Senior Member
 
Registered: Dec 2004
Location: In my house.
Distribution: Ubuntu 10.10 64bit, Slackware 13.1 64-bit
Posts: 2,649
Blog Entries: 1

Rep: Reputation: 67
Just change the fstab like was told to you on previous post to mine....
 
Old 01-07-2006, 10:23 AM   #8
hsimah
Member
 
Registered: Jan 2006
Location: Australia
Distribution: Slackware 12.1
Posts: 173

Original Poster
Rep: Reputation: 30
Yeah sorry, I missed that when I posted, then I was editing my post. SOrry for that!
 
Old 01-07-2006, 10:27 AM   #9
cwwilson721
Senior Member
 
Registered: Dec 2004
Location: In my house.
Distribution: Ubuntu 10.10 64bit, Slackware 13.1 64-bit
Posts: 2,649
Blog Entries: 1

Rep: Reputation: 67
Yeah. Me too...He snuck it in there pretty quick....lol.
At least they answered the question you needed answered...lol
 
Old 01-07-2006, 10:32 AM   #10
MMYoung
Member
 
Registered: Apr 2004
Location: Arkansas
Distribution: Ubuntu 8.10
Posts: 365

Rep: Reputation: 30
Quote:
Originally Posted by hsimah
What do the two 0's mean? On some of my drives there are 1 1 and 1 2?
I'm at work right now on a Windows 2000 PC. Will have to pull my notes out when I get home in about an hour. The other stuff was from memory but I *think* it has something to do with the partition boot/load order, but don't quote me one that .

Later,
MMYoung
 
Old 01-07-2006, 10:43 AM   #11
odevans
Member
 
Registered: Nov 2005
Location: Columbus, OH, USA
Distribution: Slackware
Posts: 246

Rep: Reputation: 30
Good memory MMYoung! Cut straight from fstab man page:

[snip]
The fifth field, (fs_freq), is used for these filesystems by the dump(8) command to deter-mine which filesystems need to be dumped. If the fifth field is not present, a value of zero is returned and dump will assume that the filesystem does not need to be dumped.

The sixth field, (fs_passno), is used by the fsck(8) program to determine the order in which filesystem checks are done at reboot time. The root filesystem should be specified with a fs_passno of 1, and other filesystems should have a fs_passno of 2. Filesystems within a drive will be checked sequentially, but filesystems on different drives will be checked at the same time to utilize parallelism available in the hardware. If the sixth field is not present or zero, a value of zero is returned and fsck will assume that the filesystem does not need to be checked.
[snip]
 
Old 01-07-2006, 11:32 AM   #12
MMYoung
Member
 
Registered: Apr 2004
Location: Arkansas
Distribution: Ubuntu 8.10
Posts: 365

Rep: Reputation: 30
Quote:
Originally Posted by hsimah
MMYoung, thank you also for explaing exactly what all that meant. I did all that but I still can't seem to put files onto that hard drive. I'll continue to play with it.
No problem. As far as accessing the drive let's do this by the numbers.

1. You edited your fstab to be similar to what I posted above.
2. You created the /mnt/name directory.
3. From the terminal, and as your regular user account, you typed in:
Code:
mount /mnt/name
If that doesn't work, open a terminal and log in as root. Then please post the output of the following:
Code:
dmesg | grep hd
Just the fisrt few lines, for example:
Code:
    ide0: BM-DMA at 0xa000-0xa007, BIOS settings: hda:DMA, hdb:DMA
    ide1: BM-DMA at 0xa008-0xa00f, BIOS settings: hdc:DMA, hdd:DMA
hda: ST380011A, ATA DISK drive
hdb: ST380011A, ATA DISK drive
hdc: LITE-ON DVDRW SOHW-1633S, ATAPI CD/DVD-ROM drive
hdd: LITE-ON DVD SOHD-167T, ATAPI CD/DVD-ROM drive
If your second HD is listed as hdb (and it should unless its SCSI) then run:
Code:
cfdisk /dev/hdb
My output looks like this:
Code:
                                  cfdisk 2.12p

                              Disk Drive: /dev/hdb
                        Size: 80026361856 bytes, 80.0 GB
              Heads: 255   Sectors per Track: 63   Cylinders: 9729

    Name        Flags      Part Type  FS Type          [Label]        Size (MB)
 ------------------------------------------------------------------------------
    hdb1                    Primary   Linux ext3                       10742.22
    hdb5                    Logical   Linux swap                        1077.52
    hdb6                    Logical   Linux ext3                          57.58
    hdb7                    Logical   Linux ext3                        5371.11
    hdb8                    Logical   Linux ext3                       10742.22
    hdb9                    Logical   Linux ext3                       10742.22
    hdb10                   Logical   Linux ext3                          57.58
    hdb11                   Logical   Linux ext3                        5371.11
    hdb12                   Logical   Linux ext3                       10742.22
    hdb13                   Logical   Linux ext3       [/]             10734.00
    hdb14                   Logical   Linux ext3       [/var]           5371.11
This way we can make sure you have the proper /dev/hdwhatever listed in /etc/fstab.

Later,
MMYoung
 
Old 01-07-2006, 11:34 AM   #13
MMYoung
Member
 
Registered: Apr 2004
Location: Arkansas
Distribution: Ubuntu 8.10
Posts: 365

Rep: Reputation: 30
Quote:
Originally Posted by odevans
Good memory MMYoung! Cut straight from fstab man page:

[snip]
The fifth field, (fs_freq), is used for these filesystems by the dump(8) command to deter-mine which filesystems need to be dumped. If the fifth field is not present, a value of zero is returned and dump will assume that the filesystem does not need to be dumped.

The sixth field, (fs_passno), is used by the fsck(8) program to determine the order in which filesystem checks are done at reboot time. The root filesystem should be specified with a fs_passno of 1, and other filesystems should have a fs_passno of 2. Filesystems within a drive will be checked sequentially, but filesystems on different drives will be checked at the same time to utilize parallelism available in the hardware. If the sixth field is not present or zero, a value of zero is returned and fsck will assume that the filesystem does not need to be checked.
[snip]
Well I was close anyway, I knew it had something to do with booting .

Later,
MMYoung
 
Old 01-07-2006, 01:05 PM   #14
shilo
Senior Member
 
Registered: Nov 2002
Location: Stockton, CA
Distribution: Slackware 11 - kernel 2.6.19.1 - Dropline Gnome 2.16.2
Posts: 1,132

Rep: Reputation: 50
Just some thoughts.

I have a similar setup on my home machine, I have two IDE hard drives, both 120G. The first is partitoned up to my liking and is a standard Slackware installation. The second stores media that I want everyuone to have access to. Both drives use reiser (though it doesn't really matter, except that they are NOT vfat or NTFS, any "Linux" filesystem will work similarly).

The solution suggested by MMYoung is very good, but I use a slightly different approach. I don't want users to have to mount the media. It should just "be there" for users to do with as they please. Of course, I have restrictions on what can be done (no need letting the kids accidently delete my mp3 collection). Note I'll abbreviate, since you seem to have mosteverything already primed (if you followed MMYoung's thorough guide).

First, I decide where I want to store my media in the Filesystem Hierarchy. My personal choice is to store it under /usr/share/multimedia. In order to help understand permissions better, I will also say that under /usr/share/multimedia I also have /Pics /Music and /Movies.

Note that differs slightly from MMYoung's post in that I choose not to use /mnt as a mount point. This is because I want a persistant mount, not a temporary one. Note that there is nothing to stop you from using /mnt as a mount point. It just makes more sense to me that a) I keep my media files permanently mounted, and b) permanent mounts really don't belong under /mnt.

Anyway, since I have decided that I am going to mount the second hard drive to /usr/share/multimedia, the first thing to do is created the directory. As root:
Code:
mkdir /usr/share/multimedia
Now comes your first decision. Who can do what in this new directory (which will soon hold the contents of the second hard drive)? Change the permissions/ownership (or don't) accordingly. The important thing to note here is that executable permission on a directory allows one to enter the directory.

For my specific needs (yours may vary), I changed the permissions to:

Code:
root@shilo2:~# ls -l /usr/share |grep multimedia
drwxr-xr-x    7 shilo users    152 2005-10-20 13:51 multimedia/
THis means that I (as user shilo) can do whatever I want inside this directory. Anyone else is dis-allowed from writing to it. Another possible solution would be to make the permissions/ownership look like this:

Code:
root@shilo2:~# ls -l /usr/share |grep multimedia
drwxrwxr-x    7 root users    152 2005-10-20 13:51 multimedia/
THis would allow all members of the users group permission to do whatever they want. There are any number of possibilities available, including creating a new group specifically for the purpose of allowing access to this directory.

Next up, /etc/fstab. Here's the important addition to mine:

Code:
/dev/hdb1  /usr/share/multimedia  reiserfs  defaults    1 2
Now, when I fire up the computer, the second harddrive is mounted right up. Note that I need not give user permission. That affects the user ability to mount the drive and nothing else. Now, the second hard drive is a seemless addition to my system (120G available for media storage under /usr/share/multimedia). Also note that I use "1 2" and not "0 0". If you set up a drive with multiple partitons, you will note that Slackware default all non-root ('root" as in FS, not user) hard drive partitions this same designation, whereas the "0 0" is used for devices that aren't mounted at boot time.

That is really all I have to add. To give a little further demonstration on my setup:

Code:
root@shilo2:~# ls -l /usr/share |grep multimedia
drwxr-xr-x    7 shilo users    152 2005-10-20 13:51 multimedia/
User "shilo" owns this directory. It belongs to the group "users". "shilo" can do anything. Others cannot write to this directory. The group here is largley irrelevant, since group and others share the same permissions (also, all users on my system are a member of the group "users".

Code:
root@shilo2:~# ls -l /usr/share/multimedia
total 22
drwxr-x---    7 shilo wheel   184 2005-06-18 10:45 movies/
drwxr-xr-x  722 shilo users 22392 2006-01-06 18:08 music/
drwxr-x---    7 shilo wheel   200 2005-02-02 15:10 pics/
Now, I have something more interesting. /music is still open to everyone to read. I don't really feel like letting everyone into my /movies and /pics, though. User "shilo" is allowed to do anything in these directories. Members of the group "wheel" just can't write to the directories. Others can't do anything to the directories (no peeking).

Hope this all makes sense. The basic ideas are:

1) You don't need to manually mount added storage. It can be mounted just like the rest of the filesystem.

2) You can mount anywhere in the filesystem. Use whatever makes sense to you. I look at mounting additional hard drives permanently under /mnt as a by-product of using Windows. People tend to think in terms of "Drive C:", "Drive D:", etc. The ability to seemlessly add filesystems to any point is one of the nice things about UNIX systems, IMHO.

3) /etc/fstab is not used to grant file permissions (except in the case of filesystems that don't utlize permissions, i.e. vfat). It CAN be used to limit permissions (i.e. mount read-only), but this is best left for learning after you understand file permissions in general.
 
Old 01-07-2006, 01:30 PM   #15
MMYoung
Member
 
Registered: Apr 2004
Location: Arkansas
Distribution: Ubuntu 8.10
Posts: 365

Rep: Reputation: 30
Show-off .

MMYoung
 
  


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
Adding additional drives/resizing drives in RAID arrays kheldar Linux - Hardware 1 10-19-2005 01:21 PM
Low-level formatting for hard drives totallynewguy Linux - Hardware 2 08-18-2005 08:30 AM
Formatting and mounting hard drives Fear Linux - Hardware 1 01-23-2005 02:37 PM
Give user permission to mount/use cdrom drives or usb drives zwyrbla Linux - Newbie 2 08-23-2004 04:30 PM
Upgrading hard drives on Software raid 1 boot drives. linuxboy123 Linux - General 0 12-11-2003 03:28 PM

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

All times are GMT -5. The time now is 05:39 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