LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices

Reply
 
Search this Thread
Old 10-09-2003, 09:37 AM   #1
mrtwice
Member
 
Registered: Feb 2002
Distribution: xubuntu 8.10
Posts: 225

Rep: Reputation: 31
boot root partition read only


I need to change my partition type from ext3 to ext2 in order to use partition magic on it so I can resize (who knew I would like linux this much).

tune2fs can do the conversion for me, but when I try to do it it tells me that the partition needs to be mounted read only. Well, I just can't seem to make it do that. I have tried modifying fstab and passing the readonly command to lilo at boot, but whenenver I run `mount` it shows that / is mounted rw.

Some help please and thank you in advance.
 
Old 10-09-2003, 07:33 PM   #2
J.W.
LQ Veteran
 
Registered: Mar 2003
Location: Milwaukee, WI
Distribution: Mint
Posts: 6,642

Rep: Reputation: 69
Dude - I'm reasonably sure it's impossible to do what you're describing. The root directory "/" is owned by root, and root also always has all permissions all the time.

What it sounds like you're trying to do is to revoke write privs on root's own directory from root itself, ie, you want to put limits what root would be permitted to do. As far as I'm aware that's impossible since root is all-powerful, plus, and probably more importantly, the "/" directory contains both static and dynamic data and therefore write privs must be open on it (to root). (Note: If anyone has information to the contrary, please share that info.)

In any event, there is a paritioning tool called Boot IT NG which supports a resize function. Whether it would work under the root directory or not is unknown to me as I have never tried it, but I have resized Windows paritions before with it and it worked like a charm. Obviously before attempting any resizing work, you would want to delete any unnecessary data in order to maximize the amount of free space. (Note however that what would really matter is the amount of contiguous free space, but clearly deleting files you know are just clutter would be helpful.)

Hopefully some of this may be useful, good luck with it. -- J.W.
 
Old 10-09-2003, 09:09 PM   #3
jimveta
Member
 
Registered: Oct 2003
Location: los angeles
Posts: 32

Rep: Reputation: 15
well, if you boot up with the root partition mounted read only
nothing will work (i know firsthand )--unless you have a seperate
partition for all the dirs containing config file that's touched

if you have a method of booting from something else, then you can
mount root readonly. for example, like booting of cd; or booting of
a second hard disk with a linux installtion.
 
Old 10-09-2003, 09:27 PM   #4
quatsch
LQ Addict
 
Registered: Aug 2003
Location: New York, NY
Distribution: gentoo, gentooPPC
Posts: 1,661

Rep: Reputation: 47
you can remount it read-only by
mount -o ro -o remount /

I'm not sure it's a good idea though. For one, PM might seriously hose your system. I've heard bad things about linux file systems and pm.
 
Old 10-09-2003, 10:18 PM   #5
DavidPhillips
Guru
 
Registered: Jun 2001
Location: South Alabama
Distribution: Fedora / RedHat / SuSE
Posts: 7,154

Rep: Reputation: 56
you need to change fstab to show ext2 and reboot



perl -i -wpe 's/ext3/ext2/g' /etc/fstab; reboot

Last edited by DavidPhillips; 10-09-2003 at 10:34 PM.
 
Old 10-09-2003, 10:36 PM   #6
quatsch
LQ Addict
 
Registered: Aug 2003
Location: New York, NY
Distribution: gentoo, gentooPPC
Posts: 1,661

Rep: Reputation: 47
You can't boot up and expect the root partition to be mounted read-only no matter what you have in fstab or kernel parameters. What you must do is to remount the file system once you're done with the boot in the way I describe above. The trouble with having the / partition mounted read only is that the system might need to write to it to function, especially if /var and /tmp are on the same partition. To mininmize risk, I would go into single user mode and then remount / as read only.
 
Old 10-09-2003, 10:45 PM   #7
DavidPhillips
Guru
 
Registered: Jun 2001
Location: South Alabama
Distribution: Fedora / RedHat / SuSE
Posts: 7,154

Rep: Reputation: 56
it's not going to be read-only it's going to be ext2

or is that not what we're trying to do?
 
Old 10-09-2003, 10:49 PM   #8
DavidPhillips
Guru
 
Registered: Jun 2001
Location: South Alabama
Distribution: Fedora / RedHat / SuSE
Posts: 7,154

Rep: Reputation: 56
why don't you use parted to resize it
 
Old 10-09-2003, 10:53 PM   #9
quatsch
LQ Addict
 
Registered: Aug 2003
Location: New York, NY
Distribution: gentoo, gentooPPC
Posts: 1,661

Rep: Reputation: 47
even parted won't be able to work on a rw-mounted partiton, will it? The thing needs to be remounted read-only.
 
Old 10-09-2003, 11:32 PM   #10
DavidPhillips
Guru
 
Registered: Jun 2001
Location: South Alabama
Distribution: Fedora / RedHat / SuSE
Posts: 7,154

Rep: Reputation: 56
I think if I was going to use parted I would get partboot and make a floppy disk set


ftp://ftp.gnu.org/gnu/parted/bootdisk



the readme...



If you want run Parted on a machine without GNU/Linux installed, or you
want to resize a root partition, you will need to use a boot disk.

Boot disk images are available from:

ftp://ftp.gnu.org/gnu/parted/bootdisk

You need to download the boot image (partboot.img) that doesn't change
between Parted releases, and a root image (eg: partroot-1.6.1.img).

To create the disks, type (in GNU/Linux)

# cp partboot.img /dev/fd0
# cp partroot-1.6.1.img /dev/fd0

Obviously, you need to insert a new disk in the middle

If you DOS/Windows, you can use RAWRITE.EXE.

To use the disks, boot off the partboot disk, and insert the partroot
disk when it asks.




As far as PM goes I don't know, never used it

Last edited by DavidPhillips; 10-09-2003 at 11:37 PM.
 
Old 10-10-2003, 02:21 AM   #11
J.W.
LQ Veteran
 
Registered: Mar 2003
Location: Milwaukee, WI
Distribution: Mint
Posts: 6,642

Rep: Reputation: 69
I welcome comments about this, but as I posted previously, from what I understand, / cannot be mounted RO. The reference source I'm using is the Filesystem Hierarchical Standard, v2.2 by Rusty Russell and Daniel Quinlan.

Specifically, I refer to this page: http://www.pathname.com/fhs/2.2/fhs-2.html

which states that / cannot be mounted RO. Am I missing things, or is this source inaccurate?? I welcome any feedback. -- J.W.
 
Old 10-10-2003, 08:26 AM   #12
mrtwice
Member
 
Registered: Feb 2002
Distribution: xubuntu 8.10
Posts: 225

Original Poster
Rep: Reputation: 31
Quote:
Originally posted by quatsch
you can remount it read-only by
mount -o ro -o remount /
I tried that, no such luck. It told me / was busy.

I ended up using my slackware install cd and just booted from that. I tried several ways to boot / and none of them work (well one "worked" but the OS didn't load right and was useless). I don't think it is possible.

Like I said, I just booted from the slack cd and used tune2fs from there. Worked like a charm.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
1 can't (root can) read from partition created by fedora during install Ace2005 Fedora 8 06-24-2005 08:08 AM
Fedora core 3 apparently not remounting root filesystem read-write during boot amundsen_eric Fedora 3 05-17-2005 05:46 AM
Can't change the read permissions on an NTFS partition as root? EOHooligan Linux - Newbie 4 01-09-2005 06:48 AM
dual boot--partition both can read yarrgh Linux - General 5 08-20-2003 12:08 PM
Read-only root filesystem at the boot karimson Linux - General 0 03-20-2003 05:01 AM


All times are GMT -5. The time now is 08:22 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration