I・O DATA LANDISK HDL-GX300 aptの保存場所を変更

上記sshaptitudeインストールの際に、エラーが生じた。

オープンできませんでした - open (30 読み込み専用ファイルシステムです)

読み書き可能であるにも関わらず。

理由は、aptやdpkgのファイルが置いてある/mnt/hda5が満杯になってしまったためであった。

landisk:/var/cache/apt/archives/partial# df
Filesystem           1K-ブロック    使用   使用可 使用% マウント位置
rootfs                  396608    273402    119111  70% /
/dev/root               396608    273402    119111  70% /
/dev/shm                 62924      9444     53480  16% /mnt/ram0
tmpfs                    62924         0     62924   0% /dev/shm
/dev/md1                202208     20720    179404  11% /boot
/dev/md5                202219    145287     46492  76% /mnt/hda5
/dev/md6             1921515444 264174920 1559733204  15% /mnt/hda6

ということで、いま置いてある

landisk:/mnt/hda5/landisk# ls -l
合計 5
drwxr-xr-x  3 root root 1024 2010-01-08 03:04 apt
drwxr-xr-x  3 root root 1024 2010-01-08 18:43 apt-cache
drwxr-xr-x  2 root root 1024 2008-12-05 23:30 conffiles
drwxr-xr-x  7 root root 1024 2010-01-08 16:10 dpkg
drwxr-xr-x  3 root root 1024 2008-12-05 23:32 samba

からapt, apt-cache, dpkgを/mnt/hda6/landiskへ移動させる。

landisk:~# cp -av /mnt/hda5/landisk/apt /mnt/hda6/landisk/
(略)
landisk:~# cp -av /mnt/hda5/landisk/apt-cache /mnt/hda6/landisk/
(略)
landisk:~# cp -av /mnt/hda5/landisk/dpkg /mnt/hda6/landisk/
(略)

続いてシンボリックリンクを削除してから再度張り直す。

landisk:/mnt/hda6/landisk# rm /var/lib/dpkg
landisk:/mnt/hda6/landisk# rm /var/lib/apt
landisk:/mnt/hda6/landisk# rm /var/cache/apt
landisk:/mnt/hda6/landisk# ln -s /mnt/hda6/landisk/dpkg /var/lib/dpkg
landisk:/mnt/hda6/landisk# ln -s /mnt/hda6/landisk/apt /var/lib/apt
landisk:/mnt/hda6/landisk# ln -s /mnt/hda6/landisk/apt-cache /var/cache/apt

そして満杯の/mnt/hda5/landisk以下のapt&dpkg関係ファイルを削除。

landisk:/mnt/hda5/landisk# df
Filesystem           1K-ブロック    使用   使用可 使用% マウント位置
rootfs                  396608    276222    116291  71% /
/dev/root               396608    276222    116291  71% /
/dev/shm                 62924      4232     58692   7% /mnt/ram0
tmpfs                    62924         0     62924   0% /dev/shm
/dev/md1                202208     20720    179404  11% /boot
/dev/md5                202219    170887     20892  90% /mnt/hda5
/dev/md6             1921515444 264323408 1559584716  15% /mnt/hda6
landisk:/mnt/hda5/landisk# rm -r apt
landisk:/mnt/hda5/landisk# df
Filesystem           1K-ブロック    使用   使用可 使用% マウント位置
rootfs                  396608    276222    116291  71% /
/dev/root               396608    276222    116291  71% /
/dev/shm                 62924      4232     58692   7% /mnt/ram0
tmpfs                    62924         0     62924   0% /dev/shm
/dev/md1                202208     20720    179404  11% /boot
/dev/md5                202219     34828    156951  19% /mnt/hda5
/dev/md6             1921515444 264323408 1559584716  15% /mnt/hda6
landisk:/mnt/hda5/landisk# rm -r apt-cache/
landisk:/mnt/hda5/landisk# rm -r dpkg/
landisk:/mnt/hda5/landisk# df
Filesystem           1K-ブロック    使用   使用可 使用% マウント位置
rootfs                  396608    276222    116291  71% /
/dev/root               396608    276222    116291  71% /
/dev/shm                 62924      4232     58692   7% /mnt/ram0
tmpfs                    62924         0     62924   0% /dev/shm
/dev/md1                202208     20720    179404  11% /boot
/dev/md5                202219     21174    170605  12% /mnt/hda5
/dev/md6             1921515444 264323408 1559584716  15% /mnt/hda6

apt以下が大きいようですね。
そういえばduコマンドを忘れてました。

landisk:/mnt/hda6/landisk# du -h
4.0K    ./apt/lists/apt
4.6M    ./apt/lists/partial
120M    ./apt/lists
120M    ./apt
4.0K    ./apt-cache/archives/partial
15M     ./apt-cache/archives
25M     ./apt-cache
4.0K    ./dpkg/updates
1.4M    ./dpkg/info
24K     ./dpkg/alternatives
4.0K    ./dpkg/methods/disk
4.0K    ./dpkg/methods/mnt
4.0K    ./dpkg/methods/floppy
16K     ./dpkg/methods
4.0K    ./dpkg/parts
1.5M    ./dpkg
146M    .

/mnt/hda6/landisk/apt/lists以下が120MB、/mnt/hda5は200MBちょっとしかないので、さすがに厳しかったようです。
オリジナルの/mnt/hda5もついでにduしてみる。

landisk:~# du -h /mnt/hda5/
12K	/mnt/hda5/lost+found
514K	/mnt/hda5/dmsf
1.0K	/mnt/hda5/dmsf_data/conf/access/allow
1.0K	/mnt/hda5/dmsf_data/conf/access/deny
4.0K	/mnt/hda5/dmsf_data/conf/access
17K	/mnt/hda5/dmsf_data/conf/data
2.0K	/mnt/hda5/dmsf_data/conf/sync/share
1.0K	/mnt/hda5/dmsf_data/conf/sync/data
5.0K	/mnt/hda5/dmsf_data/conf/sync
59K	/mnt/hda5/dmsf_data/conf/upnp_root/description
4.0K	/mnt/hda5/dmsf_data/conf/upnp_root/presentation/mstweb/doc
2.0K	/mnt/hda5/dmsf_data/conf/upnp_root/presentation/mstweb/.conf/login
32K	/mnt/hda5/dmsf_data/conf/upnp_root/presentation/mstweb/.conf
245K	/mnt/hda5/dmsf_data/conf/upnp_root/presentation/mstweb
246K	/mnt/hda5/dmsf_data/conf/upnp_root/presentation
306K	/mnt/hda5/dmsf_data/conf/upnp_root
22K	/mnt/hda5/dmsf_data/conf/filetype
17K	/mnt/hda5/dmsf_data/conf/data_default
377K	/mnt/hda5/dmsf_data/conf
378K	/mnt/hda5/dmsf_data
1.0K	/mnt/hda5/landisk/.update
1.0K	/mnt/hda5/landisk/samba/perfmon
84K	/mnt/hda5/landisk/samba
21K	/mnt/hda5/landisk/conffiles
107K	/mnt/hda5/landisk
1.1M	/mnt/hda5/

ちっさい。

あと、
http://y2.r.ribbon.to/index.php?apt%20sources.list%A4%CE%C0%DF%C4%EA%20%28sarge%29
に従って/etc/apt/sources.listを

#100108 get to sarge
# deb ftp://ftp.riken.jp/Linux/debian/debian-archive/ sarge contrib main
deb http://archive.debian.org/debian-archive/debian/ sarge main contrib non-free
deb-src http://archive.debian.org/debian-archive/debian/ sarge main contrib non-free

deb http://archive.debian.org/debian-archive/debian-security/ sarge/updates main contrib non-free
deb-src http://archive.debian.org/debian-archive/debian-security/ sarge/updates main contrib non-free

deb-src ftp://ftp.jp.debian.org/debian/ etch main
deb-src ftp://ftp2.jp.debian.org/debian/ etch main
deb-src ftp://ftp.debian.org/debian/ etch main

deb-src ftp://ftp.jp.debian.org/debian/ lenny main
deb-src ftp://ftp2.jp.debian.org/debian/ lenny main
deb-src ftp://ftp.debian.org/debian/ lenny main

deb-src ftp://ftp.jp.debian.org/debian/ sid main
deb-src ftp://ftp2.jp.debian.org/debian/ sid main
deb-src ftp://ftp.debian.org/debian/ sid main

とした。